# How to debug global shaders in 5.2?

**URL:** <https://forums.unrealengine.com/t/how-to-debug-global-shaders-in-5-2/1172962>\
**Category:** Rendering\
**Tags:** unreal-engine, question\
**Created:** [May 20, 2023, 10:17pm UTC](https://forums.unrealengine.com/t/how-to-debug-global-shaders-in-5-2/1172962 "2023-05-20T22:17:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![norsfell\_max](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@norsfell\_max](https://forums.unrealengine.com/u/norsfell_max)\
**Post date:** [May 20, 2023, 10:17pm UTC](https://forums.unrealengine.com/t/how-to-debug-global-shaders-in-5-2/1172962/1 "2023-05-20T22:17:52Z")

</div>

It looks like global shaders are not as easy to debug as they were in 5.1. With the same debug flags as I used in 5.1, the shader source now appears as assembly instead of proper unoptimized source code that is easily debuggable. I also noticed that they have a different file name with a .usf.intermediate.hlsl file extension. How can I make them debuggable like before?

Renderdoc shows the following compiler flags used:  
/Zi /Od /Zpr /Gec /O1 /T ps\_5\_0

The engine flags I use are:  
r.Shaders.GenerateSymbols=1  
r.ShaderDevelopmentMode=1  
r.Shaders.Optimize=0  
r.Shaders.Symbols=1  
r.Shaders.ExtraData=1

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [May 21, 2023, 9:07am UTC](https://forums.unrealengine.com/t/how-to-debug-global-shaders-in-5-2/1172962/2 "2023-05-21T09:07:26Z")

</div>

[

hi @norsfell_max  
In the 5.2 documentation is the section

UPDATE @norsfell_max  
you need to ADD

```auto

<BuildConfiguration>
bDisableDebugInfoForGeneratedCode>false</bDisableDebugInfoForGeneratedCode>
<BuildConfiguration>

```

to Located at: UnrealEngine\Engine\Saved\UnrealBuildTool\BuildConfiguration.xml  
see  
[Build Configuration for Unreal Engine | Unreal Engine 5.2 Documentation](https://docs.unrealengine.com/5.2/en-US/build-configuration-for-unreal-engine/)

> Example: Debugging Shaders Locally

> In this case, the user should edit the **[Platform]Engine.ini** locally and add the following:

```auto
[ShaderCompiler]
r.Shaders.WriteSymbols=1

```

[Shader Debugging Workflows Unreal Engine | Unreal Engine 5.2 Documentation](https://docs.unrealengine.com/5.2/en-US/shader-debugging-workflows-unreal-engine/)

[Unreal Engine 5.2 Release Notes | Unreal Engine 5.2 Documentation](https://docs.unrealengine.com/5.2/en-US/unreal-engine-5.2-release-notes/)  
Control +F Search “Materials and Shaders”

> Build machines will now output shader debug info for failed shaders as a build artifact.  
> Due to size limits, this output is limited to ten items. The number of debug info outputs is tracked and incremented when we dump a debug info (which happens on a worker thread), and is read on the main thread so the value is atomic.  
> Removed old code for dumping the debug info to the log.

Also 5.2 onward defaults templates to shader model 6 NOT 5 like in 5.1.

I have had immense trouble with Shader 6 (so much has changed) default in templates and Shaders 5 in [GPU Lightmass](https://forums.unrealengine.com/t/luoshuangs-gpulightmass/109474/2396)converting from 5.1 and my version is at 5.3 now as 5.2 wont work (no shadows)
