Wgpu: bug: Invalid BindGroupLayout when using getBindGroupLayout from ComputePipeline

Created on 15 Mar 2021  路  9Comments  路  Source: gfx-rs/wgpu

Description
I'm getting a BindGroupLayout with label <Invalid-BindGroupLayout label=<derived>> when calling getBindGroupLayout on GPUComputePipeline.

Expected vs observed behavior
It should create a valid BindGroupLayout without any such label. The same shader is tested on Chrome Canary and works fine (provides a valid BindGroupLayout).

Extra materials
wgpu_trace.zip

Platform

image

wgpu version: 0.7.0

upstream bug

Most helpful comment

I see. We'll try to prioritize getting barriers now. It's not going to be available till later next week though.

All 9 comments

I'm not able to replay the trace, unfortunately. This was fixed by #1245, which is not a part of v0.7.
I also tried to port hello-compute to use the implicit BGL (see https://github.com/gfx-rs/wgpu-rs/pull/792), and it works fine. So this isn't a problem about compute vs render. It's rather the fact something went wrong with a particular shader you have. Could you attach the shader here, please?

Here's the shader (GLSL, which was compiled to SPIR-V using Glslang). And yeah, it only seems to go wrong with this particular shader.

Thank you! The problem here is that Naga fails to process the shader (because of the barrier instructions), and therefore its bindings are not reflected back to wgpu. Clearly, the error lacks this information.
I filed https://github.com/gfx-rs/naga/issues/583 to fix upstream.
In the meantime, I recommend providing the layout explicitly for this pipeline.

Another shader that has invalid bind group layout..

Providing layout explicitly is not something I can do right now :/

This shader also uses control barriers.
@DjDeveloperr what's the reason for you to not specify the layout?

I'm porting an existing project with not much knowledge about shaders

I see. We'll try to prioritize getting barriers now. It's not going to be available till later next week though.

Any update on this?

Sorry, we got sucked into other tasks :/
Thank you for pinging!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

unrelentingtech picture unrelentingtech  路  14Comments

z2oh picture z2oh  路  13Comments

porky11 picture porky11  路  13Comments

MarekLg picture MarekLg  路  39Comments

kvark picture kvark  路  11Comments