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 01:22:44 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-01 01:30:36 +0300
commit4e06afb0a1d65980be5675e1f60ea23f654505bc (patch)
treebcf0ec07465d42042002f4c802ba160f14547ff4
parent7f95d780e872c4ee01a5b7db2b97e74b3a0bc978 (diff)
GL: Fix two GLerror
The gizmo one was only reproducible in debug builds. The GLImmediate one was only affecting amdpro drivers when --debug-gpu was enabled.
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c1
-rw-r--r--source/blender/gpu/opengl/gl_immediate.cc2
2 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index 5f8ffc5f3f9..2259884f25c 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -388,6 +388,7 @@ static void axis_geom_draw(const wmGizmo *gz,
GPU_matrix_scale_1f(1.0 / sphere_scale);
}
+ GPU_batch_program_set_builtin(sphere, GPU_SHADER_3D_UNIFORM_COLOR);
GPU_batch_uniform_4fv(sphere, "color", is_pos_color ? color_current : color_current_fade);
GPU_batch_draw(sphere);
GPU_matrix_pop();
diff --git a/source/blender/gpu/opengl/gl_immediate.cc b/source/blender/gpu/opengl/gl_immediate.cc
index 6a461cc87fe..614b6893347 100644
--- a/source/blender/gpu/opengl/gl_immediate.cc
+++ b/source/blender/gpu/opengl/gl_immediate.cc
@@ -45,6 +45,7 @@ namespace blender::gpu {
GLImmediate::GLImmediate()
{
glGenVertexArrays(1, &vao_id_);
+ glBindVertexArray(vao_id_); /* Necessary for glObjectLabel. */
buffer.buffer_size = DEFAULT_INTERNAL_BUFFER_SIZE;
glGenBuffers(1, &buffer.vbo_id);
@@ -57,6 +58,7 @@ GLImmediate::GLImmediate()
glBufferData(GL_ARRAY_BUFFER, buffer_strict.buffer_size, NULL, GL_DYNAMIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
+ glBindVertexArray(0);
#ifndef __APPLE__
if ((G.debug & G_DEBUG_GPU) && (GLEW_VERSION_4_3 || GLEW_KHR_debug)) {