Cleanup: declare original function storage variables static
Also minor comment formatting changes.
This commit is contained in:
@@ -42,7 +42,7 @@ typedef void *GPUvoidptr;
|
||||
#define void_ret
|
||||
|
||||
#define DEBUG_FUNC_DECLARE(pfn, rtn_type, fn, ...) \
|
||||
pfn real_##fn; \
|
||||
static pfn real_##fn; \
|
||||
static rtn_type GLAPIENTRY debug_##fn(ARG_LIST(__VA_ARGS__)) \
|
||||
{ \
|
||||
debug::check_gl_error("generated before " #fn); \
|
||||
@@ -54,7 +54,7 @@ typedef void *GPUvoidptr;
|
||||
namespace blender::gpu::debug {
|
||||
|
||||
/* List of wrapped functions. We dont have to support all of them.
|
||||
* Some functions might be declared as extern in GLEW. We cannot override them in this case.
|
||||
* Some functions might be declared as `extern` in GLEW. We cannot override them in this case.
|
||||
* Keep the list in alphabetical order. */
|
||||
|
||||
/* Avoid very long declarations. */
|
||||
@@ -105,9 +105,11 @@ DEBUG_FUNC_DECLARE(PFNGLUSEPROGRAMPROC, void, glUseProgram, GLuint, program);
|
||||
|
||||
#undef DEBUG_FUNC_DECLARE
|
||||
|
||||
/* Init a fallback layer (to KHR_debug) that covers only some functions.
|
||||
* We override the functions pointers by our own implementation that just checks glGetError.
|
||||
* Some additional functions (not overridable) are covered inside the header using wrappers. */
|
||||
/**
|
||||
* Initialize a fallback layer (to KHR_debug) that covers only some functions.
|
||||
* We override the functions pointers by our own implementation that just checks #glGetError.
|
||||
* Some additional functions (not overridable) are covered inside the header using wrappers.
|
||||
*/
|
||||
void init_debug_layer()
|
||||
{
|
||||
#define DEBUG_WRAP(function) \
|
||||
|
||||
Reference in New Issue
Block a user