Blender V5.0
blender::gpu::debug Namespace Reference

Classes

class  VKDebuggingTools

Functions

static ColorTheme4f get_debug_group_color (StringRefNull name)
void mtl_debug_init ()
void object_label (VkObjectType vk_object_type, uint64_t object_handle, const char *name)
static VKAPI_ATTR VkBool32 VKAPI_CALL messenger_callback (VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT *callback_data, void *user_data)
template<typename T>
void object_label (T vk_object_type, const StringRefNull name)
void raise_message (int32_t id_number, VkDebugUtilsMessageSeverityFlagBitsEXT vk_severity_flag_bits, const char *fmt,...) ATTR_PRINTF_FORMAT(3
Debug Callbacks

Hooks up debug callbacks to a debug OpenGL context using extensions or 4.3 core debug capabilities.

static void APIENTRY debug_callback (GLenum, GLenum type, GLuint, GLenum severity, GLsizei, const GLchar *message, const GLvoid *)
void init_gl_callbacks ()
Error Checking

This is only useful for implementation that does not support the KHR_debug extension OR when the implementations do not report any errors even when clearly doing shady things.

void check_gl_error (const char *info)
void check_gl_resources (const char *info)
void raise_gl_error (const char *info)
Object Label

Useful for debugging through render-doc. Only defined if using --debug-gpu. Make sure to bind the object first so that it gets defined by the GL implementation.

static const char * to_str_prefix (GLenum type)
static const char * to_str_suffix (GLenum type)
void object_label (GLenum type, GLuint object, const char *name)

Variables

static blender::ColorTheme4f GPU_DEBUG_GROUP_COLOR_DEFAULT = {}
CLG_LogRef LOG = {"gpu.debug.metal"}

Function Documentation

◆ check_gl_error()

void blender::gpu::debug::check_gl_error ( const char * info)

Definition at line 159 of file gl_debug.cc.

References debug_callback(), error(), ERROR_CASE, G, G_DEBUG_GPU, and SNPRINTF.

◆ check_gl_resources()

void blender::gpu::debug::check_gl_resources ( const char * info)

◆ debug_callback()

◆ get_debug_group_color()

ColorTheme4f blender::gpu::debug::get_debug_group_color ( StringRefNull name)
inlinestatic

◆ init_gl_callbacks()

void blender::gpu::debug::init_gl_callbacks ( )

This function needs to be called once per context.

Definition at line 136 of file gl_debug.cc.

References debug_callback().

◆ messenger_callback()

VKAPI_ATTR VkBool32 VKAPI_CALL blender::gpu::debug::messenger_callback ( VkDebugUtilsMessageSeverityFlagBitsEXT message_severity,
VkDebugUtilsMessageTypeFlagsEXT ,
const VkDebugUtilsMessengerCallbackDataEXT * callback_data,
void * user_data )
static

◆ mtl_debug_init()

void blender::gpu::debug::mtl_debug_init ( )

Definition at line 34 of file mtl_debug.mm.

References CLOG_ENSURE, and LOG.

Referenced by blender::gpu::MTLContext::MTLContext().

◆ object_label() [1/3]

◆ object_label() [2/3]

template<typename T>
void blender::gpu::debug::object_label ( T vk_object_type,
const StringRefNull name )

Definition at line 37 of file vk_debug.hh.

References G, G_DEBUG_GPU, name, object_label(), SNPRINTF, T, and blender::gpu::to_vk_object_type().

◆ object_label() [3/3]

void blender::gpu::debug::object_label ( VkObjectType vk_object_type,
uint64_t object_handle,
const char * name )

◆ raise_gl_error()

void blender::gpu::debug::raise_gl_error ( const char * info)

◆ raise_message()

void blender::gpu::debug::raise_message ( int32_t id_number,
VkDebugUtilsMessageSeverityFlagBitsEXT vk_severity_flag_bits,
const char * fmt,
... )

How to use:

debug::raise_message(0xB41ca2, VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT,
"This is a raise message. %llx", (uintptr_t)vk_object);
void raise_message(int32_t id_number, VkDebugUtilsMessageSeverityFlagBitsEXT vk_severity_flag_bits, const char *fmt,...) ATTR_PRINTF_FORMAT(3

References ATTR_PRINTF_FORMAT.

◆ to_str_prefix()

const char * blender::gpu::debug::to_str_prefix ( GLenum type)
static

Definition at line 290 of file gl_debug.cc.

Referenced by object_label().

◆ to_str_suffix()

const char * blender::gpu::debug::to_str_suffix ( GLenum type)
static

Definition at line 315 of file gl_debug.cc.

Referenced by object_label().

Variable Documentation

◆ GPU_DEBUG_GROUP_COLOR_DEFAULT

blender::ColorTheme4f blender::gpu::debug::GPU_DEBUG_GROUP_COLOR_DEFAULT = {}
static

◆ LOG