I'm writing some Vulkan code and write my shaders in GLSL.
I tried to use Renderdoc to debug my shaders, but I only got disassembly code.
Is it possible to debug shaders at the level of GLSL if I have the source code of the shaders in GLSL format?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityI'm writing some Vulkan code and write my shaders in GLSL.
I tried to use Renderdoc to debug my shaders, but I only got disassembly code.
Is it possible to debug shaders at the level of GLSL if I have the source code of the shaders in GLSL format?
No, as the main author Baldur Karlsson explicitly states in the tracking GitHub issue:
Currently the debugging is primarily at SPIR-V level, not source language level
Vulkan Shader Debugging tracking issue · Issue #1908 · baldurk/renderdoc
You can use the OpSource
SPIR-V instruction to include the source language text in the shader module, at which point the Source Unavailable
button becomes a clickable Debug in Source
button,
but at this point it just doesn't (and isn't supposed to) work; stepping seems to jump all over the place.
Though it might be worth mentioning that including the source language text with OpSource
enables you to use RenderDoc's shader editing feature which allows you to directly edit the GLSL code and immediately see the result in the texture viewer. (Use glslang::TIntermediate::addSourceText
if you're compiling with glslang.)