-
Notifications
You must be signed in to change notification settings - Fork 371
Clarify .getBindGroupLayout() behavior #5559
Description
Current spec wording:
I'm not sure what is meant by "Initialize layout so it is a copy of this.layout.bindGroupLayouts[index]." because entries in bindGroupLayouts can be GPUBindGroupLayout or null.
Relevant PRs:
- Specify how
getBindGroupLayouthandles out-of-bounds indices. #2803 - Don't trail with empty BGLs in default pipeline layout #3505
- Allow empty bindGroupLayouts in GPUPipelineLayoutDescriptor #4946 (with this PR
bindGroupLayoutscan now havenulls) - Allow
index < limits.maxBindGroupsingetBindGroupLayout()#5042 (with this PRbindGroupLayoutscan now have trailingnulls)
Looking at #5042 what seems intended is to return an empty BGL when encountering a null in bindGroupLayouts.
This is a small improvement found while implementing the "empty BGLs are equivalent to null" in Dawn. Basically any BGL in the pipeline is fine to query, even once past what's specified in the pipeline layout, because it's as if they are null/empty.
from #5042 (comment)
One rather minor consequence of #4946 is that the label on empty BGLs passed to createPipelineLayout is effectively discarded since they get replaced with null entries in bindGroupLayouts. It might be worth adding this as a note.