Falcor
Falcor copied to clipboard
--debug-shaders option no effect
I am using PIX to capture frame, and the shader always show "PDB missing" even if I enable --debug-shaders options.
pix settings:
screen shot:
I use the master branch.
the slang version is v2023320
<package name="slang" version="2023.3.20" remotes="github-slang-windows" platforms="windows-x86_64"/>
I build this slang version myself and add hard code debug info just before dxc compile, and without --debug-shaders, then I get the hlsl code in PIX.
I build this slang version myself and add hard code debug info just before dxc compile, and without --debug-shaders, then I get the hlsl code in PIX.
Curious, what flags did you provide to dxc
? Was it just /Zi
or also /Fd
?
I've checked with NSight Graphics and there is source level information when --debug-shaders
is enabled. However, there is a caveat. If the shader cache is enabled (on by default) then changing the debug level setting on the shader compilation does not seem to invalidate the cached compiled shader, so if you run once without --debug-shaders
followed by a run with --debug-shaders
you get the cached shader without debug information. That is a bug in slang's shader cache and we have to fix that. As a workaround, you can manually delete the shader cache (delete .shadercache
folder in the runtime directory) or disable the shader cache by running Mogwai
with --shadercache=""
.
A fix in slang is up for review https://github.com/shader-slang/slang/pull/3439
I build this slang version myself and add hard code debug info just before dxc compile, and without --debug-shaders, then I get the hlsl code in PIX.
Curious, what flags did you provide to
dxc
? Was it just/Zi
or also/Fd
?
I insert /Zi before -no-warning inside function DXCDownstreamCompiler::compile
args.add(L"-Zi"); // new code
args.add(L"-no-warnings"); // old code
I've checked with NSight Graphics and there is source level information when
--debug-shaders
is enabled. However, there is a caveat. If the shader cache is enabled (on by default) then changing the debug level setting on the shader compilation does not seem to invalidate the cached compiled shader, so if you run once without--debug-shaders
followed by a run with--debug-shaders
you get the cached shader without debug information. That is a bug in slang's shader cache and we have to fix that. As a workaround, you can manually delete the shader cache (delete.shadercache
folder in the runtime directory) or disable the shader cache by runningMogwai
with--shadercache=""
.
So I use the private build only refresh the cache 🤣