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_batch.cc | |
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_batch.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_batch.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc index 04e8985902d..953536de460 100644 --- a/source/blender/gpu/opengl/gl_batch.cc +++ b/source/blender/gpu/opengl/gl_batch.cc @@ -327,6 +327,8 @@ void GLBatch::bind(int i_first) void GLBatch::draw(int v_first, int v_count, int i_first, int i_count) { + GL_CHECK_ERROR("Batch Pre drawing"); + this->bind(i_first); BLI_assert(v_count > 0 && i_count > 0); @@ -353,6 +355,7 @@ void GLBatch::draw(int v_first, int v_count, int i_first, int i_count) glDrawElementsInstancedBaseVertex( gl_type, v_count, index_type, v_first_ofs, i_count, base_index); } + GL_CHECK_ERROR("Batch Post-drawing Indexed"); } else { #ifdef __APPLE__ @@ -367,6 +370,7 @@ void GLBatch::draw(int v_first, int v_count, int i_first, int i_count) #ifdef __APPLE__ glEnable(GL_PRIMITIVE_RESTART); #endif + GL_CHECK_ERROR("Batch Post-drawing Non-indexed"); } } |