Course contentsShow
← Unreal Engine Game Development
Lesson 788 of 88011. Performance Profiling and OptimizationFree lesson

Visualizing GPU Bottlenecks with RenderDoc

Learn to capture frames and identify specific GPU-bound draw calls that exceed your frame budget using the RenderDoc debugging tool.

In this lesson, you will learn how to leverage RenderDoc to isolate specific high-cost draw calls that are causing your GPU frame time to exceed your budget.

While Unreal’s built-in profilers tell you that your GPU is struggling, RenderDoc allows you to see why by inspecting the state of the GPU for a single, frozen frame.

Setting Up the Capture

First, ensure you have the RenderDoc plugin enabled in your Unreal project (Edit > Plugins > RenderDoc). Launch the project using the -rdoc command-line argument. Once your scene is running at the performance bottleneck, press the hotkey (default is Ctrl + F12) to capture a frame.

Identifying the Bottleneck

Open the captured file in the standalone RenderDoc application. The core of your analysis happens in the Event Browser and the Pipeline State window:

  1. Analyze the Event Browser: Look for long-duration events. Focus on the "Draw Indexed" or "Draw" calls that occur during the main geometry pass.
  2. Examine the Pipeline State: Click on a suspicious draw call. In the Pipeline State tab, inspect the Vertex Shader and Pixel Shader stages. If a pixel shader is expensive, check the Texture Viewer to see if you are oversampling high-resolution textures or if a complex material calculation is running for every fragment.
  3. Check Depth/Stencil Pre-pass: If your GPU is bound by overdraw, you will notice a high volume of depth-testing operations in the Event Browser before the actual color pass begins.

Practical Optimization Check

If you isolate a draw call with a massive amount of triangles or complex pixel logic, you can verify your fix by re-capturing. For instance, if the RenderDoc capture shows that a specific mesh has excessive vertices for its screen space size:

// Example: Optimization path often suggested after RenderDoc validation
// Reducing the number of complex materials or using LODs
StaticMeshComponent->SetRelativeScale3D(OptimizedScale);
StaticMeshComponent->SetMaterial(0, SimplifiedOpaqueMaterial);

By correlating the visual results in RenderDoc—such as seeing "Red" pixels in the shader analysis indicating high instruction count—with your actual r.GPU.WaitTime stat, you can precisely target which assets or shaders require optimization.

Key Takeaway: RenderDoc allows you to inspect the exact state of the GPU pipeline, transforming "GPU bound" from a vague diagnostic into a pinpointed list of expensive draw calls and shader instructions.