Must bind groups start from 0 and be contiguous? #4608
-
let's say I have a shader. @group(1) @binding(0)
var<uniform> ss: ShrimpleStruct;
@group(3) @binding(0)
var<uniform> ppt: PrawnPlicatedType; while rendering I can call rpass.set_bind_group(1, ss_bind_group);
rpass.set_bind_group(3, ppt_bind_group); But I can't construct a pipeline with the same mapping unless I have two empty dummy bind group layouts in between my sets in my pipeline descriptor. Is this an intentional API decision? Could a pipeline not portably support discontinuous groups? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
AFAIK the WebGPU API doesnt allow for that. For the pipeline-layout you pass in the bindgroup-layouts as an array, so the index in that array should correspond with the bindgroup-index. Only the entries in the bindgroup have their indexes explicitly stated, and I believe you can actually skip entries there. |
Beta Was this translation helpful? Give feedback.
AFAIK the WebGPU API doesnt allow for that. For the pipeline-layout you pass in the bindgroup-layouts as an array, so the index in that array should correspond with the bindgroup-index.
Only the entries in the bindgroup have their indexes explicitly stated, and I believe you can actually skip entries there.