Unable to debug shader source in editor using Renderdoc plugin in 5.6

In Unreal 5.5 and earlier, I was able to debug shader source code in the editor using the RenderDoc plugin. Unfortunately, it seems like in 5.6, this is no longer working.

I attached two pictures of what it looks like debugging a pixel shader inside Renderdoc in 5.5 and 5.6. Debugging HLSL code is much more useful, so it would be appreciated getting this working again. My guess is that something moved in the engine that the plugin didn’t get updated to account for.

This should happen on any project in 5.6, so I did not upload any projects to help with a repro.

Steps to Reproduce

  1. Create a new empty project in Unreal 5.6
  2. Install Renderdoc
    1. Install from renderdoc.org
    2. 1.38 is the latest version
    3. Older versions from last year did not support hlsl shader debugging, so update to latest
  3. Turn on the renderdoc plugin
    1. Open the plugin settings
    2. Search for renderdoc
    3. Check the box to enable
  4. Turn on shader symbols
    1. Open up ConsoleVariables.ini
    2. Uncomment the following lines
      1. r.Shaders.Optimize=0
      2. r.Shaders.Symbols=1
      3. r.Shaders.ExtraData=1
      4. r.Shaders.SkipCompression=1
      5. I don’t think ExtraData and SkipCompression are needed, but I usually do this for generalized graphics debugging inside a large project
  5. Turn on autoattach option for renderdoc
    1. Open the project settings
    2. Search for “autoattach”
    3. check the “Auto attach on startup” setting under the Render Doc Plugin Settings section
  6. Restart the editor
    1. If the editor crashes, which happened to me with debug shaders, then disable ray tracing in DefaultEngine.ini
  7. Perform a renderdoc capture
    1. Locate the icon right next to the camera settings in the viewport
    2. Press the button
    3. Alternatively press (Alt + F12)
    4. If you crash here, which is somewhat common, then try again and rotate the camera for a second before pressing capture
  8. Debug a shader in renderdoc
    1. A new Renderdoc instance has been opened
    2. Search for any shader, but I suggest searching for base pass
    3. Select a graphics event
    4. Select a pixel and select debug in the pixel context view
  9. Current view should show hlsl shader code
    1. in 5.6 this only shows shader dissassembly

Hi there,

I’ve been investigating your case and just wanted to give you a quick update, since it’s a long weekend starting tomorrow for us and I won’t be able to get back to this issue until Monday (NZT).

I’ve found the change that introduced the issue here:

https://github.com/EpicGames/UnrealEngine/commit/2b8334930fdb8b4db2ce75b4837504eb307fa737

One of the things this change does is strip out the embedded pdb (debugging info), and place it in a seperate pdb file. However, for some reason RenderDoc isn’t able to pick up the association between the shader and this external pdb file. From a brief test it appears PIX may also be affected by this issue. I will be investigating further on Monday.

For now, if you are using an engine source build, you can add the following line to D3DShaderCompilerDXC.cpp to work around the issue:

ExtraArguments.Add(TEXT(“-Qembed_debug”));

Add this line just before:

// generate the debug information (PDB)

ExtraArguments.Add(TEXT(“-Zi”));

in the FDxcArguments constructor.

Regards,

Lance

I wrote up a blurb that was supposed to be included in the release notes about this but somehow it got omitted, apologies; I will follow up with our release team on what happened here.

The gist is that PC symbols are now exported to external PDB files rather than embedded in the bytecode. As a result note an explicit symbol search path needs to be configured in any graphics debugging tools which require shader symbols (i.e. both PIX and RenderDoc). By default symbols are exported to the <project>/Saved/ShaderSymbols folder, but this is configurable.

Note that these changes exposed some bugs in both of these tools; it’s recommended to update to PIX 2505.09 and/or RenderDoc v1.38 to avoid these problems.

Note, for RenderDoc the setting is under Settings -> Core -> Shader debug search paths; I’ve also found that for some reason captures need to be reloaded after configuring the path (the “Tools -> Resolve Symbols” command doesn’t appear to do anything).

For PIX it’s under File -> Settings -> Symbol/PDB Options.

Thanks for the great replies. Manually pointing to the shader symbols worked for me and I was able to debug shaders again. I don’t think there’s anything more we need to discuss.

FYI, I’ve followed up with our docs team and the release notes have been updated to include the missing information (there were a number of other missing entries as well).