(Edited the post by mistake and cleared it, if you can revert, please do). rewriting it and reuploading files.
Hi. When testing slang as a new target for a vulkan application, i found that shaders compiled with it that use the internal spirv generator create shaders that will crash nsight when trying to display the spirv, such as trying to check samples or open dissassembly. When the shader is generated with the glslang backend on slang, this error does not happen. No amount of config settings or passing the g
enerated spirv through spirv-opt or spirv-val can fix anything. The spirv passes spirv validation, works on renderdoc, and has no issue on the validation layers.
To replicate, open the attached capture and click the first compute shader in the frame. SlangCrashNsightProject.zip (2.1 KB)
The culprit shader is in this zip. scatter_write_i32.comp is the original glsl shader, scatter_write_i32.slang is the slang shader, and scatter_write_i32.slanginternal.spv is the spirv shader that crashes. shaders.zip (2.6 KB)
Thank you for using Nsight Graphics and providing your feedback. We are sorry for any inconvenience you have encountered. Could you please provide a simple example that would allow us to reproduce the issue? Maybe you can try to launch the sample with Frame Debug activity, and share us the serialization result (click ‘Export as C++ Capture’ after launch)? By launch the serialized capture, it might be possible for us to repro your crash.
Here is a cpp capture that replicates the issue reliably. To crash nsight, try to look at the samples and/or shader of the first non-nsight vkCmdDispatch of a frame, which is using slang.
Thanks for sharing it to us. I just tried to build and launch it with Nsight Graphics, unfortunately, I can’t repro the crash. Here is my step, could you check whether I missed anything?
Launch the app, select the first vkCmdDispatch event in Events view
Goto Api Inspector view, select CS stage, click the link named ‘View Source’
I tried all vkCmdDispatch events within the slangbug.zip, no crash happen. I also tried some old version of Nsight Graphics, still see no crash.
Thanks for sharing your dmp and screen shot. Unfortunately, I still can’t repro the crash, I am sure I select the same vkCmdDispatch, and click the comp.10000.spv as your screen shot, no crash happen on my machine.
What’s your Nsight Graphics detail version? Could you share the screen shot of Help->About?
I think I find the key here is using some public build, it’s fine on my machine since I am using some internal build. OK, I will create some internal case to track this. Thanks again to share this to us.