Add inherited Bind Groups to Render Bundles. by toji · Pull Request #5185 · gpuweb/gpuweb
GPU Web WG 2025-05-14 Atlantic-time
- BJ: Given Mike's not here probably won't dive too deep, but some things worth socializing. I've written up a spec draft. The big thing is I have it as a feature, Corentin wondered if it could be core. Also, currently I have individual bind group slots inheritable, Corentin suggested it could be a contiguous sequence instead of sparse. Probably bit better for performance, about same for ergonomics.
- CW: In WebGPU and Vulkan there's this non-normative suggestion that lower bind groups should be changed less frequently. Doesn't matter for bindless hardware, but bindful hardware would need to repack all the bindings. But this is a backward looking concept… so happy to remove that suggestion.
- JB: Similar to secondary command buffers, not a performance win, so take the flexibility 🙂. Placeholders, having the layout certainly seems necessary for validation. Concern [with the placeholder bind group objects]: we have very few bind groups (4), constraining the flexibility by tying it to this limit?
- BJ: For placeholder BGL, thinking about removing that with some restructuring of the validation.
- BJ: For the limitation of the number of bind groups themselves, think it is useful for a bunch of use cases. Not so useful for Graphite with 100 textures. But for example it is useful to change a matrix or a few things per view of an object. These are the use cases that inheritance will help with. Won't help fill parametrization but at least some
- CW: Also solves the previously described use case with external texture.
- CW: Babylon.js has some models that are extremely static (e.g. chunk of the map) and could be in a render bundle. They can do this by updating the model-view-projection matrix in a bound bundle for example. Even this case benefits from inheritance, as each bundle doesn't have to bind the MVP matrix separately, they can just inherit it.
- BJ: Can also modify the contents of an indirect buffer, e.g. I do this in my frustum culling sample.
- BJ: Temperature check, is anyone opposed to this being core rather than a new feature?
- JB: Only needs to be a feature if it's a hardware/backend limitation.