$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
gl_debug.c File Reference
#include "gl_debug.h"
#include "gl_common.h"
#include "log.h"
#include "utils.h"
#include <stdint.h>
Include dependency graph for gl_debug.c:

Data Structures

struct  DebugMessageEntry
 

Macros

#define LOG_TAG   "OpenGL Debug"
 

Enumerations

enum  { DEBUG_HASH_SIZE = 1024 }
 

Functions

static uint32_t hash_id (GLuint message_id)
 
static const char * get_source_str (GLenum source)
 
static const char * get_type_str (GLenum type)
 
static const char * get_severity_str (GLenum severity)
 
static void APIENTRY gl_debug_callback (GLenum source, GLenum type, GLuint message_id, GLenum severity, GLsizei length, const GLchar *message, const void *user_param)
 
void setup_opengl_debug (void)
 Configures OpenGL debug callback. More...
 
void gl_debug_push_group (const char *name)
 Push a named debug group onto the OpenGL debug stack. More...
 
void gl_debug_pop_group (void)
 Pop the current debug group from the OpenGL debug stack. More...
 

Macro Definition Documentation

◆ LOG_TAG

#define LOG_TAG   "OpenGL Debug"

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEBUG_HASH_SIZE 

Function Documentation

◆ get_severity_str()

static const char* get_severity_str ( GLenum  severity)
static

◆ get_source_str()

static const char* get_source_str ( GLenum  source)
static

◆ get_type_str()

static const char* get_type_str ( GLenum  type)
static

◆ gl_debug_callback()

static void APIENTRY gl_debug_callback ( GLenum  source,
GLenum  type,
GLuint  message_id,
GLenum  severity,
GLsizei  length,
const GLchar *  message,
const void *  user_param 
)
static
Here is the call graph for this function:

◆ gl_debug_pop_group()

void gl_debug_pop_group ( void  )

Pop the current debug group from the OpenGL debug stack.

Wraps glPopDebugGroup(). Must be paired with gl_debug_push_group().

◆ gl_debug_push_group()

void gl_debug_push_group ( const char *  name)

Push a named debug group onto the OpenGL debug stack.

Wraps glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, name). These groups appear as hierarchical regions in RenderDoc's Event Browser.

Parameters
nameHuman-readable label for the debug region.

◆ hash_id()

static uint32_t hash_id ( GLuint  message_id)
static

◆ setup_opengl_debug()

void setup_opengl_debug ( void  )

Configures OpenGL debug callback.

Enables GL_DEBUG_OUTPUT and GL_DEBUG_OUTPUT_SYNCHRONOUS, then registers a callback that logs messages via log.h.

Here is the call graph for this function: