| name | renderdoc-gpu-debug |
| description | GPU frame debugging with RenderDoc via rdc-cli. Use this skill when the user mentions: GPU debugging, .rdc files, RenderDoc, shader issues, pipeline state, rendering artifacts, frame capture, shadow problems, visual glitches, draw calls, render targets, pixel history, texture inspection, depth buffer, blend state, rasterizer state, vertex shader, fragment shader, pixel shader, compute shader, mesh output, GPU performance, overdraw, bandwidth, shadow map, PCF filtering, screen-space artifacts, z-fighting, alpha blending, stencil, MSAA, "why does this look wrong", "debug this pixel", "what's drawing here", "capture a frame", "inspect the pipeline", "export render target", vulkan debugging, D3D debugging, GL debugging. DO NOT use for: CSS rendering, React rendering, server-side rendering, HTML layout, browser DevTools, web performance, canvas 2D, SVG rendering.
|
RenderDoc GPU Debugging Skill
Overview
This skill enables GPU frame capture, inspection, and debugging using rdc-cli, a 66-command CLI wrapping RenderDoc's Python API. It works with Vulkan, D3D11, D3D12, and OpenGL applications.
Prerequisites
Before any GPU debugging, verify the environment:
rdc doctor
All checks should pass. If rdc doctor fails, check:
RENDERDOC_PYTHON_PATH is set to the directory containing renderdoc.pyd
renderdoc.dll is in the same directory as renderdoc.pyd
renderdoccmd.exe is on PATH or in the module directory
1. Session Lifecycle
Every inspection session follows open-work-close:
rdc open path/to/capture.rdc
rdc close
Check session state with rdc status. Only one capture can be open per session (use --session name for parallel sessions).
IMPORTANT: Always close sessions when done. Leaked daemon processes consume GPU memory.
2. Capture Workflow
Capture from an executable
rdc capture -o output.rdc -- /path/to/app [app-args...]
Key options:
-o, --output: Output .rdc file path
--frame N: Capture frame N (default: first presented frame)
--timeout S: Capture timeout in seconds (default: 60)
--api-validation: Enable API validation layer
--ref-all-resources: Reference all resources (larger capture, more complete)
--wait-for-exit: Wait for the app to exit after capture
CWD matters
Many applications resolve assets relative to CWD. Always set CWD appropriately:
cd /path/to/app/root && rdc capture -o /output/path/capture.rdc -- ./app
For lux-playground specifically:
cd D:/shaderlang && python D:/renderdoc/capture_frame.py
Vulkan layer requirement
For Vulkan apps, the RenderDoc Vulkan layer must be registered:
- Registry:
HKCU\SOFTWARE\Khronos\Vulkan\ImplicitLayers must contain D:\renderdoc\module\renderdoc.json (DWORD 0)
- Environment:
ENABLE_VULKAN_RENDERDOC_CAPTURE=1 must be set
If headless capture fails
Headless Vulkan apps (no swapchain / no vkQueuePresentKHR) cannot be captured by RenderDoc since frame boundaries are defined by present calls. Options:
- Use
--interactive mode if the app supports it (opens a window with a swapchain)
- Use the Python API via
capture_frame.py for reliable programmatic capture
- Use
--trigger mode (inject without auto-capture, then rdc capture-trigger)
- Fall back to
renderdoccmd capture directly
3. Frame Exploration
After opening a capture, start with high-level overview:
rdc info --json
rdc stats --json
rdc passes
rdc draws --limit 20
rdc count draws
Navigate by pass
rdc draws --pass "Shadow Pass" --json
rdc draws --pass "GBuffer" --limit 10
Navigate by event
rdc events --limit 50
rdc events --type DrawIndexed --json
rdc event 42 --json
VFS browsing
The virtual filesystem provides a structured view of the capture:
rdc ls /
rdc ls /textures -l
rdc tree /pipelines --depth 2
rdc cat /events/42
4. Pipeline State Inspection
Get full pipeline state at any draw call:
rdc pipeline EID --json
rdc pipeline EID vs --json
rdc pipeline EID ps --json
rdc pipeline EID om --json
rdc pipeline EID rs --json
rdc pipeline EID ia --json
rdc pipeline EID ds --json
Bound resources
rdc bindings EID --json
rdc bindings EID --set 0 --json
5. Shader Inspection
View shader metadata and source
rdc shader EID vs --json
rdc shader EID ps --json
rdc shader EID ps --source
rdc shader EID ps --reflect --json
rdc shader EID ps --constants --json
Disassembly targets
rdc shader EID ps --targets
rdc shader EID ps --target spirv
rdc shader EID ps --target glsl
Search shaders
rdc search "shadow" --json
rdc search "main" --stage ps
rdc shaders --stage ps --json
rdc shader-map --json
6. Visual Inspection: Export-View-Analyze
This is the core pattern for visual debugging. Always export to PNG, then use Claude Code's Read tool to view the image.
Export render targets
rdc rt EID -o D:/renderdoc/captures/analysis/render_target.png
rdc rt EID --target 1 -o D:/renderdoc/captures/analysis/rt_target1.png
Export textures
rdc texture RESID -o D:/renderdoc/captures/analysis/texture.png
rdc texture RESID --mip 2 -o D:/renderdoc/captures/analysis/mip2.png
Export thumbnail
rdc thumbnail -o D:/renderdoc/captures/analysis/thumb.png
View exported images
After exporting a PNG, use the Read tool to view it (Claude Code is multimodal):
Read tool: D:/renderdoc/captures/analysis/render_target.png
Do NOT use cat or bash to view images. The Read tool renders them visually.
Analyze
Correlate what you see in the image with pipeline state data:
- Export the render target at the suspicious draw
- View it with the Read tool
- Check pipeline state (
rdc pipeline EID --json)
- Check shader constants (
rdc shader EID ps --constants --json)
- Form hypothesis and verify
7. Pixel Debugging
Pixel history
Find all draws that wrote to a pixel:
rdc pixel X Y --json
rdc pixel X Y EID --json
Pick pixel color
Read the current color at a pixel:
rdc pick-pixel X Y --json
rdc pick-pixel X Y EID --json
Debug pixel shader
Step through shader execution for a specific pixel:
rdc debug pixel EID X Y --json
rdc debug pixel EID X Y --trace
rdc debug pixel EID X Y --dump-at 42
Debug vertex shader
rdc debug vertex EID VTXID --json
rdc debug vertex EID VTXID --trace
Debug compute shader
rdc debug thread EID GX GY GZ TX TY TZ --json
8. Shader Edit-Replay
Modify shaders without recompiling the application:
rdc shader-encodings --json
rdc shader EID ps --source -o D:/renderdoc/captures/analysis/shader.frag
rdc shader-build D:/renderdoc/captures/analysis/shader.frag --encoding GLSL --stage ps --json
rdc shader-replace EID ps --with SHADER_ID --json
rdc rt EID -o D:/renderdoc/captures/analysis/after_edit.png
rdc shader-restore EID ps
9. Frame Comparison
Compare two captures:
rdc diff capture_a.rdc capture_b.rdc --shortstat
rdc diff capture_a.rdc capture_b.rdc --draws --json
rdc diff capture_a.rdc capture_b.rdc --resources --json
rdc diff capture_a.rdc capture_b.rdc --passes --json
rdc diff capture_a.rdc capture_b.rdc --framebuffer --json
rdc diff capture_a.rdc capture_b.rdc --framebuffer --diff-output D:/renderdoc/captures/analysis/diff.png
10. Debugging Recipes
Recipe: Object is invisible
rdc draws --json | jq '.[] | select(.name | contains("ObjectName"))'
rdc draws --pass "Main Pass" --json
rdc pipeline EID rs --json
rdc pipeline EID ds --json
rdc pipeline EID om --json
rdc debug vertex EID 0 --json
rdc draw EID --json
Recipe: Colors are wrong
rdc rt EID -o D:/renderdoc/captures/analysis/wrong_color.png
rdc pick-pixel X Y EID --json
rdc bindings EID --json
rdc texture RESID -o D:/renderdoc/captures/analysis/bound_texture.png
rdc shader EID ps --constants --json
rdc pipeline EID om --json
rdc debug pixel EID X Y --trace
Recipe: Shadows are broken
rdc passes --json
rdc draws --pass "Shadow*" --json
SHADOW_EID=$(rdc draws --pass "Shadow*" -q | tail -1)
rdc rt $SHADOW_EID -o D:/renderdoc/captures/analysis/shadow_map.png
rdc bindings $SHADOW_EID --json
rdc pipeline $SHADOW_EID rs --json
rdc draws --pass "Raster*" --json
LIGHT_EID=$(rdc draws --pass "Raster*" -q | head -1)
rdc shader $LIGHT_EID ps --source
rdc shader $LIGHT_EID ps --constants --json
rdc debug pixel $LIGHT_EID X Y --trace
Recipe: Performance is bad
rdc stats --json
rdc passes --json
rdc events --limit 500 --json | jq 'group_by(.type) | map({type: .[0].type, count: length}) | sort_by(-.count)'
rdc resources --sort size --json | jq '.[-10:]'
rdc counters --list
rdc counters --name "overdraw" --json
rdc rt EID --overlay wireframe -o D:/renderdoc/captures/analysis/wireframe.png
Recipe: What changed between two frames
rdc diff before.rdc after.rdc --shortstat
rdc diff before.rdc after.rdc --draws --json
rdc diff before.rdc after.rdc --framebuffer --diff-output D:/renderdoc/captures/analysis/frame_diff.png
rdc diff before.rdc after.rdc --pipeline EID --json
Recipe: Debug this pixel
rdc pixel X Y --json
rdc pick-pixel X Y EID --json
rdc debug pixel EID X Y --json
rdc debug pixel EID X Y --trace
rdc debug pixel EID X Y --dump-at LINE_NUMBER
11. Output Size Management
GPU captures can produce enormous output. Follow these rules:
- Always use
--limit for exploration: rdc draws --limit 20, rdc events --limit 50
- Filter by pass:
rdc draws --pass "Shadow Pass" instead of all draws
- Use
-q for ID lists: rdc draws -q returns only EIDs, not full details
- Use
--json selectively: JSON is verbose; use TSV default for scanning
- Pipeline sections:
rdc pipeline EID vs instead of full rdc pipeline EID
- Limit search results:
rdc search "pattern" --limit 10
Size estimates
rdc info: ~20 lines
rdc draws --limit 20: ~25 lines
rdc pipeline EID --json: ~200-500 lines (full), ~50 lines (per section)
rdc shader EID ps --source: ~50-500 lines depending on shader
rdc debug pixel EID X Y --trace: ~100-1000 lines depending on shader complexity
12. Error Handling
rdc not found
pip install rdc-cli
rdc doctor fails
Check RENDERDOC_PYTHON_PATH points to directory containing renderdoc.pyd and renderdoc.dll.
Capture fails with "no swapchain"
The app may not present frames in the expected way. Try:
rdc capture --trigger -- /path/to/app
Daemon not responding
rdc status
rdc close
rdc open capture.rdc
GPU feature not supported
Some features (GPU counters, pixel history) depend on the GPU and driver. Check:
rdc gpus --json
rdc counters --list
Command Reference
For the complete list of all 66 commands with arguments, options, types, and defaults, see references/commands-quick-ref.md.
For extended debugging recipes with expected output shapes, see references/debugging-recipes.md.