-
Notifications
You must be signed in to change notification settings - Fork 32
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
Make naga
validation errors easier to debug
#204
Comments
I don't have the slightest idea how difficult it would be provide source mapping, but that would be amazing. Of course, there's multiple translations here:
And |
With zero knowledge of the details, I can't imagine it would be too hard on the rustc-> spirv side, as rustc likely already has the plumbing because you need to do similar stuff mapping debug symbols back to source code. We'd need to patch naga at least though, yeah. |
On the web side, webgpu supports it: https://developer.mozilla.org/en-US/docs/Web/API/GPUDevice/createShaderModule But wgpu does not use it (doesn't even generate the API in -sys). It looks like the Microsoft shader compiler stuff supports embedded pdb and metal supports dwarf debug info. So much of the plumbing appears to be there. |
I'd like to chime in here and offer help if needed, since I already wrote a debug info implementation for the SPIR-V backend in CubeCL. The extended debug info API (NonSemantic.Shader.DebugInfo.100) can be temperamental but is extremely useful for profiling and debugging shaders, so it would be great to have access to it in I'm not familiar enough with the codebase atm to do my own PR, but if there are any questions I'd be happy to help out. There are some quirks you do need to keep track of (like |
Currently when
naga
fails validation (when usingwgpu
+rust-gpu
for the web) it can be really confusing and really hard to debug:We should make it better so it is obvious what
naga
-generated code is causing the failure and how it maps to therust-gpu
inputThe text was updated successfully, but these errors were encountered: