🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DXC spirv PDB

Started by
4 comments, last by MJP 2 years, 4 months ago

Hi all,

I have troubles getting the PDB part out of my IDxcResult.

I compile HLSL for D3D12 and for Vulkan SPIRV using the same DXC, using IDxcCompiler3::Compile, with pretty much the same “command line” arguments (the only extras are -spirv itself and some -fvk options).

With D3D12, I can simply do IDxcResult::GetOutput(DXC_OUT_PDB, IID_PPV_ARGS(&pdbBlob), &pdbName)

and it succesfully returns a good PDB blob.

With SPIRV, however, there's no such PDB part in my compilation output :(

Of course, I do have “-Zi”. I tried all the thinkable arguments, nothing changed it.

Running from command line:

dxc my.vs -spirv -T vs_6_0 -Zi -Fo my.bin

with the same DLL as the API version yields the expected results, i.e. my.bin contains my source code, etc.. The DLL version I'm trying is 1.6.0.3336, but it's the same with 1.5.

What could I be forgetting? Without -spirv, it works just fine. The SPIRV shaders themselves also work fine, I just miss the PDBs. Thanks for any ideas!

Advertisement

Looks like there might a bug in DXC, based on whether it's loading a file or compiling from memory. I'll update this thread for future reference, once I know more ?

I'm not sure that DXC actually supports outputting a PDB for SPIR-V. As far as I know SPIR-V debug info is always embedded directly in the compiled instruction stream.

Correct, they don't and can't support a PDB for SPIR-V. That I've learnt in the meantime.

This situation is very unfortunate, compared to some consoles which can have quite tiny runtime shaders, each of which with a hash, and then separate PDBs which the GPU debugging tools load up on demand, not wasting your application/game memory.

Microsoft's DXC still does have a bug where the SPIR-V source code isn't correctly included at all.

Yeah I agree, having the debug info in a separate file is way better for workflow. Maybe the DXC SPIR-V people can figure out a way to make it work.

This topic is closed to new replies.

Advertisement