[Bf-blender-cvs] [dd02fbd] strand_gpu: Use consistent checks for valid attribute index.

Lukas Tönne noreply at git.blender.org
Tue Jul 5 09:57:26 CEST 2016


Commit: dd02fbddf52bd1aac88a1afd576a58c295a3100d
Author: Lukas Tönne
Date:   Tue Jul 5 08:45:33 2016 +0200
Branches: strand_gpu
https://developer.blender.org/rBdd02fbddf52bd1aac88a1afd576a58c295a3100d

Use consistent checks for valid attribute index.

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

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

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

diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 082c135..61e64fd 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -803,7 +803,7 @@ void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numda
 		BLI_assert(ELEM(data[i].type, SUPPORTED_GL_ATTRIB_TYPES) &&
 		           "Unsupported attribute data type!");
 		
-		if (data[i].info_index >= 0) {
+		if (data[i].info_index != -1) {
 			int info = 0;
 			if (data[i].type == GL_UNSIGNED_BYTE) {
 				info |= GPU_ATTR_INFO_SRGB;
@@ -811,7 +811,7 @@ void GPU_interleaved_attrib_setup(GPUBuffer *buffer, GPUAttrib data[], int numda
 			glUniform1i(data[i].info_index, info);
 		}
 
-		if (data[i].index >= 0) {
+		if (data[i].index != -1) {
 			glEnableVertexAttribArray(data[i].index);
 			switch (data[i].type) {
 				case GL_FLOAT:




More information about the Bf-blender-cvs mailing list