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);

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

Reply via email to