Skip to content

Internal error in writing type when atomicCompareExchangeWeak is used in compute shader, on GL backend #7578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
suguruwataru opened this issue Apr 19, 2025 · 0 comments · May be fixed by #7658
Labels
area: naga back-end Outputs of naga shader conversion backend: gles Issues with GLES or WebGL lang: GLSL OpenGL Shading Language naga Shader Translator type: bug Something isn't working

Comments

@suguruwataru
Copy link

suguruwataru commented Apr 19, 2025

Description
When atomicCompareExchangeWeak is called in compute shader, on a GL backend, wgpu will report internal error:

Caused by:
      In Device::create_compute_pipeline
        Internal error: Unable to write type Struct { members: [StructMember { name: Some("old_value"), ty: [3], binding: None, offset: 0 }, StructMember { name: Some("exchanged"), ty: [8], binding: None, offset: 4 }], span: 8 }

Repro steps
I'm reusing a repo I created for exploring other things: https://github.com/suguruwataru/wgsl-loop
The branch atomic-compare-exchange-weak contains a test that just runs a compute shader calling
atomicCompareExchangeWeak:
https://github.com/suguruwataru/wgsl-loop/tree/atomic-compare-exchange-weak

cargo test to run it, and you should see the internal error being reported.

Expected vs observed behavior
Expectation is atomicCompareExchangeWeak won't cause an internal error and be successfully translated.

Platform
I was running it on Linux without Vulkan driver. I have tried wgpu 23.0.1 and wgpu 25.0.0.

@suguruwataru suguruwataru changed the title Internal error in writing type when atomicCompareExchangeWeak is used in compute shader Internal error in writing type when atomicCompareExchangeWeak is used in compute shader, on GL backend Apr 19, 2025
@cwfitzgerald cwfitzgerald added type: bug Something isn't working backend: gles Issues with GLES or WebGL area: naga back-end Outputs of naga shader conversion naga Shader Translator lang: GLSL OpenGL Shading Language labels Apr 23, 2025
@cryvosh cryvosh linked a pull request May 5, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga back-end Outputs of naga shader conversion backend: gles Issues with GLES or WebGL lang: GLSL OpenGL Shading Language naga Shader Translator type: bug Something isn't working
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants