[Bf-blender-cvs] [c4ee94328fb] blender-v2.83-release: Fix invalid bit shift when GPU shader attribute is not found

Brecht Van Lommel noreply at git.blender.org
Mon May 18 22:04:30 CEST 2020


Commit: c4ee94328fba1f70ca29df42ffff471aaeee2a82
Author: Brecht Van Lommel
Date:   Mon May 18 21:22:02 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBc4ee94328fba1f70ca29df42ffff471aaeee2a82

Fix invalid bit shift when GPU shader attribute is not found

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

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

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

diff --git a/source/blender/gpu/intern/gpu_shader_interface.c b/source/blender/gpu/intern/gpu_shader_interface.c
index cb1cd9a6f6d..8cd1afad536 100644
--- a/source/blender/gpu/intern/gpu_shader_interface.c
+++ b/source/blender/gpu/intern/gpu_shader_interface.c
@@ -257,7 +257,9 @@ GPUShaderInterface *GPU_shaderinterface_create(int32_t program)
 
     input->location = glGetAttribLocation(program, name);
 
-    shaderface->enabled_attr_mask |= (1 << input->location);
+    if (input->location != -1) {
+      shaderface->enabled_attr_mask |= (1 << input->location);
+    }
 
     set_input_name(shaderface, input, name, name_len);



More information about the Bf-blender-cvs mailing list