Skip to content
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

[naga] [glsl-in] Crashes when we go over a certain nested stack depth (including if/else chains) #5652

Open
magcius opened this issue May 2, 2024 · 1 comment
Labels
area: naga front-end lang: GLSL OpenGL Shading Language naga Shader Translator type: bug Something isn't working

Comments

@magcius
Copy link
Contributor

magcius commented May 2, 2024

Description
It seems that glsl-in crashes after a certain recursion limit; the call stack is blown.

Repro steps
https://gist.github.com/magcius/b53f33c9135355fe7fed542a748c60b3

Expected vs observed behavior
I'd expect a successful parse, or at least an error, rather than a crash.

Extra materials
This was found when trying to translate this shader to WGSL for noclip.website, which uses Naga to transform GLSL to WGSL for the WebGPU backend. https://github.com/magcius/noclip.website/blob/fe8dd8f74d93579296e7d087147de0b3a1bfcebd/src/MarioKart8Deluxe/Render.ts#L534-L597

Platform
wgpu commit bdf30fa. This was found with a version of Naga compiled to WebAssembly, but it crashes anywhere.

@ErichDonGubler
Copy link
Member

@teoxoy teoxoy added type: bug Something isn't working naga Shader Translator area: naga front-end lang: GLSL OpenGL Shading Language labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga front-end lang: GLSL OpenGL Shading Language naga Shader Translator type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants