Blender  V3.3
Namespaces | Macros | Typedefs | Functions
gl_debug_layer.cc File Reference
#include "BLI_utildefines.h"
#include "gl_debug.hh"

Go to the source code of this file.

Namespaces

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

Macros

#define GPUvoidptr_set   void *ret =
 
#define GPUvoidptr_ret   return ret
 
#define GLboolean_set   GLboolean ret =
 
#define GLboolean_ret   return ret
 
#define void_set
 
#define void_ret
 
#define DEBUG_FUNC_DECLARE(pfn, rtn_type, fn, ...)
 
#define DEBUG_WRAP(function)
 

Typedefs

using GPUvoidptr = void *
 

Functions

 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBEGINQUERYPROC, void, glBeginQuery, GLenum, target, GLuint, id)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBEGINTRANSFORMFEEDBACKPROC, void, glBeginTransformFeedback, GLenum, primitiveMode)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBINDBUFFERBASEPROC, void, glBindBufferBase, GLenum, target, GLuint, index, GLuint, buffer)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBINDBUFFERPROC, void, glBindBuffer, GLenum, target, GLuint, buffer)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBINDFRAMEBUFFERPROC, void, glBindFramebuffer, GLenum, target, GLuint, framebuffer)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBINDSAMPLERPROC, void, glBindSampler, GLuint, unit, GLuint, sampler)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBINDVERTEXARRAYPROC, void, glBindVertexArray, GLuint, array)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBLITFRAMEBUFFERPROC, void, glBlitFramebuffer, GLint, srcX0, GLint, srcY0, GLint, srcX1, GLint, srcY1, GLint, dstX0, GLint, dstY0, GLint, dstX1, GLint, dstY1, GLbitfield, mask, GLenum, filter)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBUFFERDATAPROC, void, glBufferData, GLenum, target, GLsizeiptr, size, const void *, data, GLenum, usage)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLBUFFERSUBDATAPROC, void, glBufferSubData, GLenum, target, GLintptr, offset, GLsizeiptr, size, const void *, data)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDELETEBUFFERSPROC, void, glDeleteBuffers, GLsizei, n, const GLuint *, buffers)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDELETEFRAMEBUFFERSPROC, void, glDeleteFramebuffers, GLsizei, n, const GLuint *, framebuffers)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDELETEPROGRAMPROC, void, glDeleteProgram, GLuint, program)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDELETEQUERIESPROC, void, glDeleteQueries, GLsizei, n, const GLuint *, ids)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDELETESAMPLERSPROC, void, glDeleteSamplers, GLsizei, count, const GLuint *, samplers)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDELETESHADERPROC, void, glDeleteShader, GLuint, shader)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDELETEVERTEXARRAYSPROC, void, glDeleteVertexArrays, GLsizei, n, const GLuint *, arrays)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC, void, glDrawArraysInstancedBaseInstance, GLenum, mode, GLint, first, GLsizei, count, GLsizei, primcount, GLuint, baseinstance)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDRAWARRAYSINSTANCEDPROC, void, glDrawArraysInstanced, GLenum, mode, GLint, first, GLsizei, count, GLsizei, primcount)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDRAWBUFFERSPROC, void, glDrawBuffers, GLsizei, n, const GLenum *, bufs)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC, void, glDrawElementsInstancedBaseVertexBaseInstance, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, primcount, GLint, basevertex, GLuint, baseinstance)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC, void, glDrawElementsInstancedBaseVertex, GLenum, mode, GLsizei, count, GLenum, type, const void *, indices, GLsizei, instancecount, GLint, basevertex)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLENDQUERYPROC, void, glEndQuery, GLenum, target)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDISPATCHCOMPUTEPROC, void, glDispatchCompute, GLuint, num_groups_x, GLuint, num_groups_y, GLuint, num_groups_z)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLDISPATCHCOMPUTEINDIRECTPROC, void, glDispatchComputeIndirect, GLintptr, indirect)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLENDTRANSFORMFEEDBACKPROC, void, glEndTransformFeedback, void)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLFRAMEBUFFERTEXTURE2DPROC, void, glFramebufferTexture2D, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLFRAMEBUFFERTEXTURELAYERPROC, void, glFramebufferTextureLayer, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLint, layer)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLFRAMEBUFFERTEXTUREPROC, void, glFramebufferTexture, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLGENBUFFERSPROC, void, glGenBuffers, GLsizei, n, GLuint *, buffers)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLGENERATEMIPMAPPROC, void, glGenerateMipmap, GLenum, target)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLGENERATETEXTUREMIPMAPPROC, void, glGenerateTextureMipmap, GLuint, texture)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLGENFRAMEBUFFERSPROC, void, glGenFramebuffers, GLsizei, n, GLuint *, framebuffers)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLGENQUERIESPROC, void, glGenQueries, GLsizei, n, GLuint *, ids)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLGENSAMPLERSPROC, void, glGenSamplers, GLsizei, n, GLuint *, samplers)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLGENVERTEXARRAYSPROC, void, glGenVertexArrays, GLsizei, n, GLuint *, arrays)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLLINKPROGRAMPROC, void, glLinkProgram, GLuint, program)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLMAPBUFFERRANGEPROC, GPUvoidptr, glMapBufferRange, GLenum, target, GLintptr, offset, GLsizeiptr, length, GLbitfield, access)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLTEXBUFFERPROC, void, glTexBuffer, GLenum, target, GLenum, internalFormat, GLuint, buffer)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLTEXIMAGE3DPROC, void, glTexImage3D, GLenum, target, GLint, level, GLint, internalFormat, GLsizei, width, GLsizei, height, GLsizei, depth, GLint, border, GLenum, format, GLenum, type, const GLvoid *, pixels)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLTEXSUBIMAGE3DPROC, void, glTexSubImage3D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLint, zoffset, GLsizei, width, GLsizei, height, GLsizei, depth, GLenum, format, GLenum, type, const GLvoid *, pixels)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLTEXTUREBUFFERPROC, void, glTextureBuffer, GLuint, texture, GLenum, internalformat, GLuint, buffer)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLUNMAPBUFFERPROC, GLboolean, glUnmapBuffer, GLenum, target)
 
 blender::gpu::debug::DEBUG_FUNC_DECLARE (PFNGLUSEPROGRAMPROC, void, glUseProgram, GLuint, program)
 
void blender::gpu::debug::init_debug_layer ()
 

Detailed Description

Implement our own subset of KHR_debug extension. We override the functions pointers by our own implementation that just checks glGetError.

Definition in file gl_debug_layer.cc.

Macro Definition Documentation

◆ DEBUG_FUNC_DECLARE

#define DEBUG_FUNC_DECLARE (   pfn,
  rtn_type,
  fn,
  ... 
)
Value:
static pfn real_##fn; \
static rtn_type GLAPIENTRY debug_##fn(ARG_LIST(__VA_ARGS__)) \
{ \
debug::check_gl_error("generated before " #fn); \
rtn_type##_set real_##fn(ARG_LIST_CALL(__VA_ARGS__)); \
rtn_type##_ret; \
}
#define ARG_LIST(...)
Definition: gl_debug.hh:37
#define ARG_LIST_CALL(...)
Definition: gl_debug.hh:61
void check_gl_error(const char *info)
Definition: gl_debug.cc:181

Definition at line 26 of file gl_debug_layer.cc.

◆ DEBUG_WRAP

#define DEBUG_WRAP (   function)
Value:
do { \
real_##function = ::function; \
::function = &debug_##function; \
} while (0)

◆ GLboolean_ret

#define GLboolean_ret   return ret

Definition at line 21 of file gl_debug_layer.cc.

◆ GLboolean_set

#define GLboolean_set   GLboolean ret =

Definition at line 20 of file gl_debug_layer.cc.

◆ GPUvoidptr_ret

#define GPUvoidptr_ret   return ret

Definition at line 18 of file gl_debug_layer.cc.

◆ GPUvoidptr_set

#define GPUvoidptr_set   void *ret =

Definition at line 17 of file gl_debug_layer.cc.

◆ void_ret

#define void_ret

Definition at line 24 of file gl_debug_layer.cc.

◆ void_set

#define void_set

Definition at line 23 of file gl_debug_layer.cc.

Typedef Documentation

◆ GPUvoidptr

using GPUvoidptr = void *

Definition at line 15 of file gl_debug_layer.cc.