[Bf-blender-cvs] [4e06afb0a1d] master: GL: Fix two GLerror

Clément Foucault noreply at git.blender.org
Tue Sep 1 00:30:43 CEST 2020


Commit: 4e06afb0a1d65980be5675e1f60ea23f654505bc
Author: Clément Foucault
Date:   Tue Sep 1 00:22:44 2020 +0200
Branches: master
https://developer.blender.org/rB4e06afb0a1d65980be5675e1f60ea23f654505bc

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.

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

M	source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
M	source/blender/gpu/opengl/gl_immediate.cc

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

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)) {



More information about the Bf-blender-cvs mailing list