Renderdoc is a widely used open source GPU debugger. Blender has several options to benefit using renderdoc for debugging.
When Blender is compiled with
WITH_RENDERDOC=On you can start and stop a renderdoc
frame capture from within Blenders' source code.
GPU_debug_capture_endaround the code you want to capture.
- Start renderdoc and launch from within renderdoc using the
--debug-gpu-renderdoccommand line parameter
- Every time the
GPU_debug_capture_begin/endpair is reached it will automatically record a frame capture.
view3d_draw_view the viewport drawing events can be captured by surrounding
DRW_draw_view with the GPU_debug_capture_begin/end function calls.
it is not allowed to land calls to
GPU_debug_capture_begin/end in main as
they are considered to be debug code.
With the command line parameter
--debug-gpu blender will add meta-data to the buffers and
commands. This makes it easier to navigate complex frame captures. Command grouping
is automatically enabled when running with the
With the command
GPU_debug_group_begin(const char * name) a new group can be added.
All groups must be closed by calling
GPU_debug_group_end(). Many areas already have
these debug groups defined.