[Bf-blender-cvs] [20a9ab700df] tmp-gldebuglayer: Remove GL_CHECK_ERROR as we now have debug wrappers

Clément Foucault noreply at git.blender.org
Wed Sep 9 15:50:23 CEST 2020


Commit: 20a9ab700df471174b9987689ee9311a357c0b28
Author: Clément Foucault
Date:   Wed Sep 9 15:28:09 2020 +0200
Branches: tmp-gldebuglayer
https://developer.blender.org/rB20a9ab700df471174b9987689ee9311a357c0b28

Remove GL_CHECK_ERROR as we now have debug wrappers

===================================================================

M	source/blender/gpu/opengl/gl_batch.cc
M	source/blender/gpu/opengl/gl_debug.hh
M	source/blender/gpu/opengl/gl_immediate.cc
M	source/blender/gpu/opengl/gl_texture.cc

===================================================================

diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc
index b25bafad6a3..17bc1013a78 100644
--- a/source/blender/gpu/opengl/gl_batch.cc
+++ b/source/blender/gpu/opengl/gl_batch.cc
@@ -324,7 +324,6 @@ void GLBatch::bind(int i_first)
 void GLBatch::draw(int v_first, int v_count, int i_first, int i_count)
 {
   GL_CHECK_RESOURCES("Batch");
-  GL_CHECK_ERROR("Batch Pre drawing");
 
   this->bind(i_first);
 
@@ -346,7 +345,6 @@ 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__
@@ -361,7 +359,6 @@ 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");
   }
 }
 
diff --git a/source/blender/gpu/opengl/gl_debug.hh b/source/blender/gpu/opengl/gl_debug.hh
index 537c034acf6..71d97c2fc58 100644
--- a/source/blender/gpu/opengl/gl_debug.hh
+++ b/source/blender/gpu/opengl/gl_debug.hh
@@ -75,13 +75,6 @@ namespace debug {
 #define ARG_LIST_CALL(...) VA_NARGS_CALL_OVERLOAD(_VA_ARG_LIST_CALL, __VA_ARGS__)
 /* clang-format on */
 
-/* Enabled on MacOS by default since there is no support for debug callbacks. */
-#if defined(DEBUG) && defined(__APPLE__)
-#  define GL_CHECK_ERROR(info) debug::check_gl_error(info)
-#else
-#  define GL_CHECK_ERROR(info)
-#endif
-
 #ifdef DEBUG
 #  define GL_CHECK_RESOURCES(info) debug::check_gl_resources(info)
 #else
diff --git a/source/blender/gpu/opengl/gl_immediate.cc b/source/blender/gpu/opengl/gl_immediate.cc
index 7afbbf9965c..86d61f02318 100644
--- a/source/blender/gpu/opengl/gl_immediate.cc
+++ b/source/blender/gpu/opengl/gl_immediate.cc
@@ -89,7 +89,6 @@ uchar *GLImmediate::begin()
   const size_t available_bytes = buffer_size() - buffer_offset();
 
   GL_CHECK_RESOURCES("Immediate");
-  GL_CHECK_ERROR("Immediate Pre-Begin");
 
   glBindBuffer(GL_ARRAY_BUFFER, vbo_id());
 
@@ -133,7 +132,6 @@ uchar *GLImmediate::begin()
   }
   void *data = glMapBufferRange(GL_ARRAY_BUFFER, buffer_offset(), bytes_needed, access);
   BLI_assert(data != NULL);
-  GL_CHECK_ERROR("Immediate Post-Begin");
 
   bytes_mapped_ = bytes_needed;
   return (uchar *)data;
@@ -155,8 +153,6 @@ void GLImmediate::end(void)
   }
   glUnmapBuffer(GL_ARRAY_BUFFER);
 
-  GL_CHECK_ERROR("Immediate Post-Unmap");
-
   if (vertex_len > 0) {
     GLContext::get()->state_manager->apply_state();
 
@@ -180,8 +176,6 @@ void GLImmediate::end(void)
      * They are not required so just comment them. (T55722) */
     // glBindBuffer(GL_ARRAY_BUFFER, 0);
     // glBindVertexArray(0);
-
-    GL_CHECK_ERROR("Immediate Post-drawing");
   }
 
   buffer_offset() += buffer_bytes_used;
diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc
index ec08b736af2..cc042b72951 100644
--- a/source/blender/gpu/opengl/gl_texture.cc
+++ b/source/blender/gpu/opengl/gl_texture.cc
@@ -102,8 +102,6 @@ bool GLTexture::init_internal(void)
     /* Binding before setting the label is needed on some drivers. */
     glObjectLabel(GL_TEXTURE, tex_id_, -1, sh_name);
   }
-
-  GL_CHECK_ERROR("Post-texture creation");
   return true;
 }
 
@@ -131,8 +129,6 @@ bool GLTexture::init_internal(GPUVertBuf *vbo)
     /* Binding before setting the label is needed on some drivers. */
     glObjectLabel(GL_TEXTURE, tex_id_, -1, sh_name);
   }
-
-  GL_CHECK_ERROR("Post-texture buffer creation");
   return true;
 }
 
@@ -193,8 +189,6 @@ void GLTexture::ensure_mipmaps(int miplvl)
           break;
       }
     }
-
-    GL_CHECK_ERROR("Post-mipmap creation");
   }
 
   this->mip_range_set(0, mipmaps_);
@@ -240,7 +234,6 @@ void GLTexture::update_sub_direct_state_access(
         break;
     }
   }
-  GL_CHECK_ERROR("Post-update_sub_direct_state_access");
 }
 
 void GLTexture::update_sub(
@@ -304,8 +297,6 @@ void GLTexture::update_sub(
         break;
     }
   }
-
-  GL_CHECK_ERROR("Post-update_sub");
 }
 
 /** This will create the mipmap images and populate them with filtered data from base level.



More information about the Bf-blender-cvs mailing list