Commit: 49a30112d4226f5e4861cafb3c1a1b9e010c4668
Author: Antony Riakiotakis
Date:   Mon Dec 28 20:51:38 2015 +0100
Branches: master
https://developer.blender.org/rB49a30112d4226f5e4861cafb3c1a1b9e010c4668

Fix opengl error when GLSL is on for basic shader: shader needs to be
bound before setting uniforms

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

M       source/blender/gpu/intern/gpu_basic_shader.c

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

diff --git a/source/blender/gpu/intern/gpu_basic_shader.c 
b/source/blender/gpu/intern/gpu_basic_shader.c
index c01d532..8a36589 100644
--- a/source/blender/gpu/intern/gpu_basic_shader.c
+++ b/source/blender/gpu/intern/gpu_basic_shader.c
@@ -362,8 +362,11 @@ static GPUShader *gpu_basic_shader(int options)
                
                if (shader) {
                        /* set texture map to first texture unit */
-                       if (options & GPU_SHADER_TEXTURE_2D)
+                       if (options & GPU_SHADER_TEXTURE_2D) {
+                               GPU_shader_bind(shader);
                                glUniform1i(GPU_shader_get_uniform(shader, 
"texture_map"), 0);
+                               GPU_shader_unbind();
+                       }
 
                        GPU_MATERIAL_STATE.cached_shaders[options] = shader;
                }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to