[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48627] branches/soc-2012-swiss_cheese/ source/blender/blenkernel/intern/cdderivedmesh.c: OpenGL Regression Fixes: incorrect format made by cddm_format_attrib_vertex

Jason Wilkins Jason.A.Wilkins at gmail.com
Thu Jul 5 10:56:30 CEST 2012


Revision: 48627
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48627
Author:   jwilkins
Date:     2012-07-05 08:56:29 +0000 (Thu, 05 Jul 2012)
Log Message:
-----------
OpenGL Regression Fixes: incorrect format made by cddm_format_attrib_vertex

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/cdderivedmesh.c

Modified: branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/cdderivedmesh.c	2012-07-05 08:33:26 UTC (rev 48626)
+++ branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/cdderivedmesh.c	2012-07-05 08:56:29 UTC (rev 48627)
@@ -1032,18 +1032,24 @@
 static void cddm_format_attrib_vertex(DMVertexAttribs *attribs)
 {
 	int b;
+
 	GLboolean texco = GL_FALSE;
+	GLint texSize[1];
+
 	GLint attribMap_f[16];
 	GLint attribSize_f[16];
 	GLint attrib_f = 0;
+
 	GLint attribMap_ub[16];
 	GLint attribSize_ub[16];
 	GLint attrib_ub = 0;
 
 	/* orco texture coordinates */
 	if (attribs->totorco) {
-		if (attribs->orco.gl_texco)
+		if (attribs->orco.gl_texco) {
 			texco = GL_TRUE;
+			texSize[0] = 3;
+		}
 		else {
 			attribMap_f[attrib_f] = attribs->orco.gl_index;
 			attribSize_f[attrib_f] = 3;
@@ -1053,8 +1059,10 @@
 
 	/* uv texture coordinates */
 	for (b = 0; b < attribs->tottface; b++) {
-		if (attribs->tface[b].gl_texco)
+		if (attribs->tface[b].gl_texco) {
 			texco = GL_TRUE;
+			texSize[0] = 2;
+		}
 		else {
 			attribMap_f[attrib_f] = attribs->tface[b].gl_index;
 			attribSize_f[attrib_f] = 2;
@@ -1084,6 +1092,7 @@
 		static const GLenum texmap[1] = { GL_TEXTURE0 };
 		gpuImmediateTextureUnitCount(1);
 		gpuImmediateTextureUnitMap(texmap);
+		gpuImmediateTexCoordSizes(texSize);
 	}
 
 	gpuImmediateFloatAttribCount(attrib_f);
@@ -1092,7 +1101,7 @@
 
 	gpuImmediateUbyteAttribCount(attrib_ub);
 	gpuImmediateUbyteAttribIndexMap(attribMap_ub);
-	gpuImmediateUbyteAttribSizes(attribMap_ub);
+	gpuImmediateUbyteAttribSizes(attribSize_ub);
 
 	gpuImmediateLock();
 }




More information about the Bf-blender-cvs mailing list