wgpu can detect the case where a bind group layout is not included in the pipeline layout and not used in the shader or used in the shader but not included in the pipeline layout. wgsl_to_wgpu assumes all bind groups are used, which can create problems for different pipelines in the same WGSL file. A depth only pass for shadows might not use the material uniforms buffer but still want to use the same vertex code as the color pass, for example.
This may require recreating some of the validation code used by naga or wgpu. It's also worth investigating how this works with non consecutive bind groups if index 1 is unused for bind groups 0, 1, 2.
wgpu can detect the case where a bind group layout is not included in the pipeline layout and not used in the shader or used in the shader but not included in the pipeline layout. wgsl_to_wgpu assumes all bind groups are used, which can create problems for different pipelines in the same WGSL file. A depth only pass for shadows might not use the material uniforms buffer but still want to use the same vertex code as the color pass, for example.
This may require recreating some of the validation code used by naga or wgpu. It's also worth investigating how this works with non consecutive bind groups if index 1 is unused for bind groups 0, 1, 2.