Graphics Debugger
We got RenderDoc at home
Overview
As part of a tools development assignment (4 weeks, half-time), I challenged myself to build a RenderDoc-like graphics debugger directly inside LAMP Engine, my project group’s custom built game engine, using Dear ImGui.
The result is an in-engine debugging tool that can be opened as a overlay while the game is running and provides detailed graphics debugging information for the current frame.
Many of the features are inspired by tools such as RenderDoc and the Visual Studio Graphics Debugger, but implemented directly in the engine to allow faster iteration and debugging during active gameplay without needing to restart or capture external frames.
In short, I hooked into our graphics engine to capture draw call events, textures and raw byte data and then parsed and organized it into a clear, interactive overview for debugging.
Showcase of the graphics debugger
Features
The tool visualizes every draw call executed during a frame, organized chronologically in a tree structure based on the render events defined in the graphics engine render pass.
For each draw call, the tool displays:
- A snapshot of all the render target textures immediately after the draw call
-
GPU draw time, compound and individually. Extremly usefull when finding bottlenecks and optimizing
Shader resources, including slot, texture preview, format and resolution
All bound constant buffers with parsed data
Parsed vertex buffer data
Pipeline State Object (PSO) information:
Active shaders
Blend state
Depth-stencil state
Rasterizer state
Input layout
- A mesh viewer with debug rendering and wireframe mode to inspect material, scale, rotation and vertex density
Motivation
The main motivation for creating this tool was both technical curiosity and practical need.
While tools like RenderDoc are powerful, they require restarting the game and capturing a frame, which can slow down iteration during development. This tool allows us, developers, to inspect rendering data instantly during gameplay, making debugging significantly faster.
It has also been useful when helping other disciplines. When artists or level designers encounter visual issues, it is much quicker to open the tool and inspect the relevant draw call than restarting the game with an external graphics debugger.
For example, we previously had issues with incorrect sRGB settings on albedo textures and meshes not appearing during pre-production. The tool made it much easier to identify problems such as missing textures, incorrect scaling, or rendering state errors.
Conclusions
The tool successfully achieved its main goals:
Visualizing draw calls
Inspecting PSO states and shader resources
Providing quick access to rendering data directly inside the engine
Over time I expanded it with additional features as the project progressed. One feature I attempted but did not fully complete was displaying VertexShader-to-PixelShader interpolator data. After research on how RenderDoc does it, it seems like they manipulate the bytedata of the compiled shader and that was a bit out of scope of the current project.
Finally, the tool has already proven useful during development. It has helped with debugging particle systems, where quickly inspecting particle vertex buffers made it easier to identify rendering issues. It has also saved time when diagnosing problems such as missing textures or incorrectly scaled meshes, both for programmers and other team members.