[Bf-blender-cvs] [fa1abf5] strand_gpu: update "bound" flag of GPU strand shaders

Mike Erwin noreply at git.blender.org
Fri Jul 8 03:04:16 CEST 2016


Commit: fa1abf564e9d551db6d5be38891d246a055300c7
Author: Mike Erwin
Date:   Thu Jul 7 20:22:13 2016 -0400
Branches: strand_gpu
https://developer.blender.org/rBfa1abf564e9d551db6d5be38891d246a055300c7

update "bound" flag of GPU strand shaders

Not sure how useful it is to track this. Just making it consistent.

"bound" only stays in sync with GL if we are careful to use the
GPU_strand_shader_bind/unbind functions. Rogue calls to GPU_shader_bind
update GL's state without updating strand shader's "bound" flag.

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

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

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

diff --git a/source/blender/gpu/intern/gpu_strands.c b/source/blender/gpu/intern/gpu_strands.c
index 5126124..3dff377 100644
--- a/source/blender/gpu/intern/gpu_strands.c
+++ b/source/blender/gpu/intern/gpu_strands.c
@@ -212,6 +212,8 @@ void GPU_strand_shader_bind(GPUStrandsShader *gpu_shader,
 
 	GPU_shader_bind(gpu_shader->shader);
 
+	gpu_shader->bound = true;
+
 	UNUSED_VARS(viewmat, viewinv);
 }
 
@@ -226,7 +228,7 @@ void GPU_strand_shader_bind_uniforms(GPUStrandsShader *gpu_shader,
 
 void GPU_strand_shader_unbind(GPUStrandsShader *gpu_shader)
 {
-	gpu_shader->bound = 0;
+	gpu_shader->bound = false;
 	GPU_shader_unbind();
 }




More information about the Bf-blender-cvs mailing list