[Bf-blender-cvs] [e1c4908771a] blender2.8: Temp fix for vertex format with batch instancing

Luca Rood noreply at git.blender.org
Tue May 23 18:40:10 CEST 2017


Commit: e1c4908771a6090ba2ba9d74d95965ee93779b11
Author: Luca Rood
Date:   Tue May 23 18:11:50 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBe1c4908771a6090ba2ba9d74d95965ee93779b11

Temp fix for vertex format with batch instancing

This prevents memory alignment from being screwed up when attributes are
optimized out in shader.

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

M	source/blender/draw/intern/draw_manager.c

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

diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 5765a5a7292..f0f4564e8a4 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -642,6 +642,9 @@ static void DRW_interface_attrib(DRWShadingGroup *shgroup, const char *name, DRW
 	attrib->type = type;
 	attrib->size = size;
 
+/* Adding attribute even if not found for now (to keep memory alignment).
+ * Should ideally take vertex format automatically from batch eventually */
+#if 0
 	if (attrib->location == -1 && !dummy) {
 		if (G.debug & G_DEBUG)
 			fprintf(stderr, "Attribute '%s' not found!\n", name);
@@ -649,6 +652,7 @@ static void DRW_interface_attrib(DRWShadingGroup *shgroup, const char *name, DRW
 		MEM_freeN(attrib);
 		return;
 	}
+#endif
 
 	BLI_assert(BLI_strnlen(name, 32) < 32);
 	BLI_strncpy(attrib->name, name, 32);




More information about the Bf-blender-cvs mailing list