Blender V5.3
GPU_debug.hh File Reference
#include "BLI_index_range.hh"
#include <string>

Go to the source code of this file.

Classes

struct  blender::gpu::DebugScope
struct  blender::gpu::DebugScope::ScopedCapture

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::gpu

Macros

#define GPU_DEBUG_SHADER_COMPILATION_GROUP   "Shader Compilation"
#define GPU_DEBUG_SHADER_SPECIALIZATION_GROUP   "Shader Specialization"

Functions

void blender::GPU_debug_group_begin (const char *name)
void blender::GPU_debug_group_end ()
void blender::GPU_debug_get_groups_names (int name_buf_maxncpy, char *r_name_buf)
std::string blender::GPU_debug_get_groups_names (IndexRange levels=IndexRange(0, 9999))
bool blender::GPU_debug_group_match (const char *ref)
void blender::GPU_debug_capture_begin (const char *title)
void blender::GPU_debug_capture_end ()
void * blender::GPU_debug_capture_scope_create (const char *name)
bool blender::GPU_debug_capture_scope_begin (void *scope)
void blender::GPU_debug_capture_scope_end (void *scope)

Detailed Description

Helpers for GPU / drawing debugging.

GPU debug capture usage example:

Instant frame capture.

Will trigger a capture and load it inside RenderDoc or Xcode.

#include "GPU_debug.hh"
void render_function()
{
GPU_debug_capture_begin(__func__);
// Draw-call submission goes here.
GPU_debug_capture_end();
}

Capture scopes.

Capture scope can be sprinkled around the codebase for easier selective capture.

They are listed from inside Xcode (on Mac) when doing a Metal capture.

OpenGL and Vulkan backend need to use the --debug-gpu-scope-capture launch argument to specify which scope to capture. Building with RenderDoc API support is required for this launch option to be available.

They can be nested but only one can be captured at a time.

#include "GPU_debug.hh"
void render_function()
{
static gpu::DebugScope capture_scope = {"UniqueName"};
// Manually triggered version, better for conditional capture.
capture_scope.begin();
// Draw-call submission goes here.
capture_scope.end();
{
// Scoped version, better for complex control flow.
static gpu::DebugScope capture_scope = {"AnotherUniqueName"};
capture_scope.scoped_capture();
// Draw-call submission goes here.
}
}

Definition in file GPU_debug.hh.

Macro Definition Documentation

◆ GPU_DEBUG_SHADER_COMPILATION_GROUP

#define GPU_DEBUG_SHADER_COMPILATION_GROUP   "Shader Compilation"

◆ GPU_DEBUG_SHADER_SPECIALIZATION_GROUP

#define GPU_DEBUG_SHADER_SPECIALIZATION_GROUP   "Shader Specialization"

Definition at line 71 of file GPU_debug.hh.

Referenced by blender::gpu::debug::debug_callback().