-
Notifications
You must be signed in to change notification settings - Fork 345
Description
See also: #2043
It's good advice to keep the binding layout similar between shaders for best performance. However, there sometimes comes times when binding entries might not be able to be filled completely. Say I have a binding group layout like: [ texture, textureCube ].
Even if I want to draw with a shader that only uses the first texture, it's impossible to leave the second argument blank. As such, currently, I have to create a dummy 1x1x6 cube texture and bind that. This is not that awful (tbh I expect any engine to have these textures lying around anyway), but it's perhaps not the best experience, ergonomically.
It would be better if I could specify a null entry, and the draw only goes through if validation ensures that the shader does not reference such holes. Only if this is not prohibitively expensive, though.
( Alternatively, we could specify that reading from a "null" slot will result in some default value like 0,0,0,1, which could be backed by a texture on the WebGPU side )