Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Rood <dev@lucarood.com>2017-05-23 19:11:50 +0300
committerLuca Rood <dev@lucarood.com>2017-05-23 19:39:22 +0300
commite1c4908771a6090ba2ba9d74d95965ee93779b11 (patch)
treeec0d33f607fb7935fc99e74741ddfecd60e6f684 /source/blender/draw
parent9bc88b69d81fc1839733c0ffb7179fba22d9920c (diff)
Temp fix for vertex format with batch instancing
This prevents memory alignment from being screwed up when attributes are optimized out in shader.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/intern/draw_manager.c4
1 files changed, 4 insertions, 0 deletions
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);