diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-25 15:47:23 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-25 16:02:34 +0300 |
commit | b43f4fda19b935ebeb144e14bba2fc7c590d2ffb (patch) | |
tree | cf163de0fd838b1e8c4aaab6f3c980b077fde90c /source/blender/gpu/opengl/gl_context.hh | |
parent | e51c428be64feef0877a957b483aa71e5753b29c (diff) |
GL: Add error checking function
This is to ease the debugging process on Apple GL implementation.
Diffstat (limited to 'source/blender/gpu/opengl/gl_context.hh')
-rw-r--r-- | source/blender/gpu/opengl/gl_context.hh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_context.hh b/source/blender/gpu/opengl/gl_context.hh index ee8189255ca..e16f4bbf076 100644 --- a/source/blender/gpu/opengl/gl_context.hh +++ b/source/blender/gpu/opengl/gl_context.hh @@ -34,6 +34,15 @@ #include <mutex> +#ifdef DEBUG +/* Enabled on MacOS by default since there is no support for debug callbacks. */ +# ifdef __APPLE__ +# define GL_CHECK_ERROR(info) GLContext::check_error(info) +# else +# define GL_CHECK_ERROR(info) +# endif +#endif + namespace blender { namespace gpu { @@ -78,6 +87,8 @@ class GLContext : public GPUContext { GLContext(void *ghost_window, GLSharedOrphanLists &shared_orphan_list); ~GLContext(); + static void check_error(const char *info); + void activate(void) override; void deactivate(void) override; |