Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-09 01:47:59 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-10 15:19:00 +0300
commit9d5977f5e1fa2eac782278c61c3cc86685cc1b5a (patch)
treed88fad9af66de5ef23c50e12a886cee109342bbf /source/blender/gpu/opengl/gl_immediate.cc
parentb8bcbb2cf26f7217099076e17d69088e690c0790 (diff)
GL: Add fallback debug layer
This is to improve debugging on older hardware that may not support 4.3 debug capabilities (like Macs). This avoids sprinkling glGetErrors manually. This might still be needed to find the root cause since not all functions are covered. This overrides the functions pointers that GLEW have already init. This is only enabled if using --debug-gpu option and the debug extension are not available. This also cleanup the usage of GLContext::debug_layer_support and use wrapper to set object labels.
Diffstat (limited to 'source/blender/gpu/opengl/gl_immediate.cc')
-rw-r--r--source/blender/gpu/opengl/gl_immediate.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/source/blender/gpu/opengl/gl_immediate.cc b/source/blender/gpu/opengl/gl_immediate.cc
index 7afbbf9965c..fd31d77cc80 100644
--- a/source/blender/gpu/opengl/gl_immediate.cc
+++ b/source/blender/gpu/opengl/gl_immediate.cc
@@ -60,11 +60,9 @@ GLImmediate::GLImmediate()
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);
- if (GLContext::debug_layer_support) {
- glObjectLabel(GL_VERTEX_ARRAY, vao_id_, -1, "VAO-Immediate");
- glObjectLabel(GL_BUFFER, buffer.vbo_id, -1, "VBO-ImmediateBuffer");
- glObjectLabel(GL_BUFFER, buffer_strict.vbo_id, -1, "VBO-ImmediateBufferStrict");
- }
+ debug::object_label(GL_VERTEX_ARRAY, vao_id_, "Immediate");
+ debug::object_label(GL_BUFFER, buffer.vbo_id, "ImmediateVbo");
+ debug::object_label(GL_BUFFER, buffer_strict.vbo_id, "ImmediateVboStrict");
}
GLImmediate::~GLImmediate()
@@ -89,7 +87,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 +130,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 +151,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 +174,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;