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-01 00:14:42 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-01 01:30:36 +0300
commit7f95d780e872c4ee01a5b7db2b97e74b3a0bc978 (patch)
treedadf4b2cec51e6096a9852c3ff6b756606e611a9 /source/blender/gpu/opengl/gl_immediate.cc
parent9d932b426f0db9350a3fe49cd5bcf8b25e7cf8bb (diff)
GLImmediate: Use CL_CHECK_ERROR
This provides a bit more debugging info on MacOS.
Diffstat (limited to 'source/blender/gpu/opengl/gl_immediate.cc')
-rw-r--r--source/blender/gpu/opengl/gl_immediate.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_immediate.cc b/source/blender/gpu/opengl/gl_immediate.cc
index ff598f79b3f..6a461cc87fe 100644
--- a/source/blender/gpu/opengl/gl_immediate.cc
+++ b/source/blender/gpu/opengl/gl_immediate.cc
@@ -30,6 +30,7 @@
#include "gpu_vertex_format_private.h"
#include "gl_context.hh"
+#include "gl_debug.hh"
#include "gl_primitive.hh"
#include "gl_vertex_array.hh"
@@ -87,6 +88,8 @@ uchar *GLImmediate::begin()
/* Does the current buffer have enough room? */
const size_t available_bytes = buffer_size() - buffer_offset();
+ GL_CHECK_ERROR("Immediate Pre-Begin");
+
glBindBuffer(GL_ARRAY_BUFFER, vbo_id());
bool recreate_buffer = false;
@@ -129,6 +132,7 @@ 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;
@@ -150,6 +154,8 @@ void GLImmediate::end(void)
}
glUnmapBuffer(GL_ARRAY_BUFFER);
+ GL_CHECK_ERROR("Immediate Post-Unmap");
+
if (vertex_len > 0) {
GPU_context_active_get()->state_manager->apply_state();
@@ -173,6 +179,8 @@ 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;