[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50905] branches/soc-2012-swiss_cheese/ source/blender/blenkernel/intern/cdderivedmesh.c: GPU_SAFETY fix: Was asserting when switching to "material" view port mode.

Jason Wilkins Jason.A.Wilkins at gmail.com
Wed Sep 26 14:18:08 CEST 2012


Revision: 50905
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50905
Author:   jwilkins
Date:     2012-09-26 12:18:07 +0000 (Wed, 26 Sep 2012)
Log Message:
-----------
GPU_SAFETY fix: Was asserting when switching to "material" view port mode.

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-09-26 12:17:28 UTC (rev 50904)
+++ branches/soc-2012-swiss_cheese/source/blender/blenkernel/intern/cdderivedmesh.c	2012-09-26 12:18:07 UTC (rev 50905)
@@ -1485,6 +1485,7 @@
 
 	memset(&attribs, 0, sizeof(attribs));
 
+	cddm_format_attrib_vertex(&attribs); /* XXX: jwilkins, just to make this simple to write for now */
 	gpuBegin(GL_QUADS);
 
 	for (a = 0; a < dm->numTessFaceData; a++, mf++) {
@@ -1495,10 +1496,12 @@
 
 		if (new_matnr != matnr) {
 			gpuEnd();
+			cddm_unformat_attrib_vertex();
 
 			setMaterial(userData, matnr = new_matnr, &gattribs);
 			DM_vertex_attributes_from_gpu(dm, &gattribs, &attribs);
 
+			cddm_format_attrib_vertex(&attribs);
 			gpuBegin(GL_QUADS);
 		}
 
@@ -1539,6 +1542,7 @@
 			cddm_draw_attrib_vertex(&attribs, mvert, a, mf->v3, 2, smoothnormal);
 	}
 	gpuEnd();
+	cddm_unformat_attrib_vertex();
 
 	glShadeModel(GL_FLAT);
 }




More information about the Bf-blender-cvs mailing list