18#define GPUvoidptr_set void *ret =
19#define GPUvoidptr_ret return ret
21#define GLboolean_set GLboolean ret =
22#define GLboolean_ret return ret
27#define DEBUG_FUNC_DECLARE(pfn, rtn_type, fn, ...) \
28 static pfn real_##fn; \
29 static rtn_type GLAPIENTRY debug_##fn(ARG_LIST(__VA_ARGS__)) \
31 debug::check_gl_error("generated before " #fn); \
32 rtn_type##_set real_##fn(ARG_LIST_CALL(__VA_ARGS__)); \
33 debug::check_gl_error("" #fn); \
46DEBUG_FUNC_DECLARE(PFNGLBEGINTRANSFORMFEEDBACKPROC,
void, glBeginTransformFeedback, GLenum, primitiveMode);
47DEBUG_FUNC_DECLARE(PFNGLBINDBUFFERBASEPROC,
void, glBindBufferBase, GLenum, target, GLuint, index, GLuint, buffer);
49DEBUG_FUNC_DECLARE(PFNGLBINDFRAMEBUFFERPROC,
void, glBindFramebuffer, GLenum, target, GLuint, framebuffer);
52DEBUG_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);
53DEBUG_FUNC_DECLARE(PFNGLBUFFERDATAPROC,
void, glBufferData, GLenum, target, GLsizeiptr, size,
const void *, data, GLenum, usage);
54DEBUG_FUNC_DECLARE(PFNGLBUFFERSUBDATAPROC,
void, glBufferSubData, GLenum, target, GLintptr, offset, GLsizeiptr, size,
const void *, data);
58DEBUG_FUNC_DECLARE(PFNGLDELETEQUERIESPROC,
void, glDeleteQueries, GLsizei, n,
const GLuint *, ids);
61DEBUG_FUNC_DECLARE(PFNGLDELETEVERTEXARRAYSPROC,
void, glDeleteVertexArrays, GLsizei, n,
const GLuint *, arrays);
62DEBUG_FUNC_DECLARE(PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC,
void, glDrawArraysInstancedBaseInstance, GLenum, mode, GLint, first, GLsizei,
count, GLsizei, primcount, GLuint, baseinstance);
63DEBUG_FUNC_DECLARE(PFNGLDRAWARRAYSINSTANCEDPROC,
void, glDrawArraysInstanced, GLenum, mode, GLint, first, GLsizei,
count, GLsizei, primcount);
65DEBUG_FUNC_DECLARE(PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC,
void, glDrawElementsInstancedBaseVertexBaseInstance, GLenum, mode, GLsizei,
count, GLenum, type,
const void *, indices, GLsizei, primcount, GLint, basevertex, GLuint, baseinstance);
66DEBUG_FUNC_DECLARE(PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC,
void, glDrawElementsInstancedBaseVertex, GLenum, mode, GLsizei,
count, GLenum, type,
const void *, indices, GLsizei, instancecount, GLint, basevertex);
68DEBUG_FUNC_DECLARE(PFNGLDISPATCHCOMPUTEPROC,
void, glDispatchCompute, GLuint, num_groups_x, GLuint, num_groups_y, GLuint, num_groups_z);
69DEBUG_FUNC_DECLARE(PFNGLDISPATCHCOMPUTEINDIRECTPROC,
void, glDispatchComputeIndirect, GLintptr, indirect);
71DEBUG_FUNC_DECLARE(PFNGLFRAMEBUFFERTEXTURE2DPROC,
void, glFramebufferTexture2D, GLenum, target, GLenum, attachment, GLenum, textarget, GLuint, texture, GLint, level);
72DEBUG_FUNC_DECLARE(PFNGLFRAMEBUFFERTEXTURELAYERPROC,
void, glFramebufferTextureLayer, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level, GLint, layer);
73DEBUG_FUNC_DECLARE(PFNGLFRAMEBUFFERTEXTUREPROC,
void, glFramebufferTexture, GLenum, target, GLenum, attachment, GLuint, texture, GLint, level);
76DEBUG_FUNC_DECLARE(PFNGLGENERATETEXTUREMIPMAPPROC,
void, glGenerateTextureMipmap, GLuint, texture);
80DEBUG_FUNC_DECLARE(PFNGLGENVERTEXARRAYSPROC,
void, glGenVertexArrays, GLsizei, n, GLuint *, arrays);
82DEBUG_FUNC_DECLARE(PFNGLMAPBUFFERRANGEPROC,
GPUvoidptr, glMapBufferRange, GLenum, target, GLintptr, offset, GLsizeiptr, length, GLbitfield, access);
83DEBUG_FUNC_DECLARE(PFNGLTEXBUFFERPROC,
void, glTexBuffer, GLenum, target, GLenum, internalFormat, GLuint, buffer);
84DEBUG_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);
85DEBUG_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);
86DEBUG_FUNC_DECLARE(PFNGLTEXTUREBUFFERPROC,
void, glTextureBuffer, GLuint, texture, GLenum, internalformat, GLuint, buffer);
91#undef DEBUG_FUNC_DECLARE
95#define DEBUG_WRAP(function) \
97 real_##function = ::function; \
98 ::function = &debug_##function; \
121 DEBUG_WRAP(glDrawArraysInstancedBaseInstance);
123 DEBUG_WRAP(glDrawElementsInstancedBaseVertex);
124 DEBUG_WRAP(glDrawElementsInstancedBaseVertexBaseInstance);
local_group_size(16, 16) .push_constant(Type local_group_size(16, 16) .push_constant(Type input_tx sampler(1, ImageType::FLOAT_2D, "matte_tx") .image(0
#define DEBUG_WRAP(function)
#define DEBUG_FUNC_DECLARE(pfn, rtn_type, fn,...)
GPUFrameBuffer * framebuffers[FRAMEBUFFER_STACK_DEPTH]