jaho
jaho

Reputation: 5002

How to generate shader debug information (pdb) in VS2012

I'm trying to debug my shaders in Directx 11 SDK application using graphics diagnostics tool in VS2012, however when I click Start Debugging on one of the shaders in Graphics Pixel History panel I'm getting Pixel Shader.pdb not loaded and I'm not able to find the pdb file anywhere.

I tried compiling shaders at runtime using D3DX11CompileFromFile with D3DCOMPILE_DEBUG flag as well as using the HLSL compiler with debugging information turned on (/Od /Zi) but none of these options is producing the pdb file I could use in graphics diagnostics tool.

How do I generate these files?

Upvotes: 1

Views: 2593

Answers (1)

Drop
Drop

Reputation: 13003

I think this "Pixel Shader.pdb not loaded" message is misleading. The is no any .pdb files generated by HLSL-compiler. All debug info are integrated into binary (either memory blob or .cso file). Does your shader file named "Pixel Shader"? Maybe it says not about a shader, but some kind of Visual Studio's internal source files (shader debugger in VS2012 was somewhat unstable sometimes)

Some ideas that, probably, can help you to solve issue:

  1. Make sure that your debug and release output binaries are not messed up. Check both debug and release configuration of project's properties and each shader's properties.
  2. Make sure that you are loading right shader file. Check ten times all file paths.
  3. Clean your project, eliminate all binaries by hand. Rebuild again.
  4. IIRC, in graphics debugger you can only debug shaders, compiled offline (i.e. not by D3DX11CompileFromFile).
  5. Try to compile using fxc.exe directly.
  6. Use filenames that does not contains spaces and special characters.
  7. Make sure your test shader is simple enough, so debugger will not crash. Thy to use default template.
  8. If it's still doesn't works, write a minimal example project, check that it doesn't works, post it here so we can test it.
  9. Try VS2013
  10. Try your videocard vendor's debugging tool (such as NVIDIA nsight or AMD GPU PerfStudio), to see if it is problem with Microsoft tools or not.

Hope it helps somehow.

Upvotes: 2

Related Questions