Blender V4.3
gl_debug.cc File Reference
#include "BLI_compiler_attrs.h"
#include "BLI_string.h"
#include "BLI_system.h"
#include "BLI_utildefines.h"
#include "BKE_global.hh"
#include "GPU_debug.hh"
#include "GPU_platform.hh"
#include "CLG_log.h"
#include "gl_backend.hh"
#include "gl_context.hh"
#include "gl_uniform_buffer.hh"
#include "gl_debug.hh"
#include <cstdio>

Go to the source code of this file.

Namespaces

namespace  blender
 
namespace  blender::gpu
 
namespace  blender::gpu::debug
 

Macros

#define TRIM_NVIDIA_BUFFER_INFO   1
 
#define TRIM_SHADER_STATS_INFO   1
 
#define ERROR_CASE(err)
 

Functions

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 blender::gpu::debug::check_gl_error (const char *info)
 
void blender::gpu::debug::check_gl_resources (const char *info)
 
void blender::gpu::debug::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 * blender::gpu::debug::to_str_prefix (GLenum type)
 
static const char * blender::gpu::debug::to_str_suffix (GLenum type)
 
void blender::gpu::debug::object_label (GLenum type, GLuint object, const char *name)
 

Variables

static CLG_LogRef LOG = {"gpu.debug"}
 

Debug Callbacks

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

#define APIENTRY
 
static void APIENTRY blender::gpu::debug::debug_callback (GLenum, GLenum type, GLuint, GLenum severity, GLsizei, const GLchar *message, const GLvoid *)
 
void blender::gpu::debug::init_gl_callbacks ()
 

Detailed Description

Debug features of OpenGL.

Definition in file gl_debug.cc.

Macro Definition Documentation

◆ APIENTRY

#define APIENTRY

Definition at line 51 of file gl_debug.cc.

◆ ERROR_CASE

#define ERROR_CASE ( err)
Value:
case err: { \
char msg[256]; \
SNPRINTF(msg, "%s : %s", #err, info); \
debug_callback(0, GL_DEBUG_TYPE_ERROR, 0, GL_DEBUG_SEVERITY_HIGH, 0, msg, nullptr); \
break; \
}

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

◆ TRIM_NVIDIA_BUFFER_INFO

#define TRIM_NVIDIA_BUFFER_INFO   1

Definition at line 34 of file gl_debug.cc.

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

◆ TRIM_SHADER_STATS_INFO

#define TRIM_SHADER_STATS_INFO   1

Definition at line 36 of file gl_debug.cc.

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

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"gpu.debug"}
static

Definition at line 31 of file gl_debug.cc.