[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48685] branches/soc-2012-swiss_cheese/ source/blender/gpu/intern: stride and vertex copy done incorrectly for byte attributes.

Jason Wilkins Jason.A.Wilkins at gmail.com
Fri Jul 6 16:48:48 CEST 2012


Revision: 48685
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48685
Author:   jwilkins
Date:     2012-07-06 14:48:48 +0000 (Fri, 06 Jul 2012)
Log Message:
-----------
stride and vertex copy done incorrectly for byte attributes.  note: accidentally committed part of this fix with the last merge.

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_gl11.c

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.c	2012-07-06 14:47:25 UTC (rev 48684)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.c	2012-07-06 14:48:48 UTC (rev 48685)
@@ -65,7 +65,7 @@
 
 	if (GPU_IMMEDIATE->format.colorSize != 0) {
 		/* color always get 4 bytes for efficient memory alignment */
-		stride += 4; //-V112
+		stride += 4 * sizeof(GLubyte);
 	}
 
 	/* texture coordinate */
@@ -86,8 +86,7 @@
 
 	for (i = 0; i < GPU_IMMEDIATE->format.attribCount_ub; i++) {
 		/* byte attributes always get 4 bytes for efficient memory alignment */
-		stride +=
-			(size_t)(GPU_IMMEDIATE->format.attribSize_ub[i]) * sizeof(GLfloat);
+		stride += 4 * sizeof(GLubyte);
 	}
 
 	return (GLsizei)stride;

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_gl11.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_gl11.c	2012-07-06 14:47:25 UTC (rev 48684)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_gl11.c	2012-07-06 14:48:48 UTC (rev 48685)
@@ -126,7 +126,7 @@
 
 	if (GPU_IMMEDIATE->format.colorSize != 0) {
 		glColorPointer(
-			4, //-V112
+			4 * sizeof(GLubyte),
 			GL_UNSIGNED_BYTE,
 			GPU_IMMEDIATE->stride,
 			bufferData->ptr + offset);




More information about the Bf-blender-cvs mailing list