Blender  V3.3
Namespaces | Macros | Variables
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.h"
#include "GPU_debug.h"
#include "GPU_platform.h"
#include "CLG_log.h"
#include "glew-mx.h"
#include "gl_context.hh"
#include "gl_uniform_buffer.hh"
#include "gl_debug.hh"
#include <cstdio>

Go to the source code of this file.

Namespaces

 blender
 
 blender::gpu
 
 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 UNUSED(source), GLenum type, GLuint UNUSED(id), GLenum severity, GLsizei UNUSED(length), const GLchar *message, const GLvoid *UNUSED(userParm))
 
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; \
}
static FT_Error err

◆ TRIM_NVIDIA_BUFFER_INFO

#define TRIM_NVIDIA_BUFFER_INFO   1

Definition at line 34 of file gl_debug.cc.

◆ TRIM_SHADER_STATS_INFO

#define TRIM_SHADER_STATS_INFO   1

Definition at line 36 of file gl_debug.cc.

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"gpu.debug"}
static

Definition at line 31 of file gl_debug.cc.