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:
authorCampbell Barton <ideasman42@gmail.com>2017-05-11 13:56:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-05-11 14:05:49 +0300
commitf1242ea93b1cdbd8a6125e1760146db187075c79 (patch)
treebd0ea761ba806a146ca34d550b8b60b7bf3adc43 /intern/gawain/src
parent0ffb19ca645ed2fa7d95e49472332dcfc2690312 (diff)
Fix bug in copying VertexFormat
Pointer-offsets need updating on copy, seems VertexFormat's were being made static to avoid this bug?
Diffstat (limited to 'intern/gawain/src')
-rw-r--r--intern/gawain/src/vertex_format.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/intern/gawain/src/vertex_format.c b/intern/gawain/src/vertex_format.c
index 620d270a26a..d9382c284bd 100644
--- a/intern/gawain/src/vertex_format.c
+++ b/intern/gawain/src/vertex_format.c
@@ -35,6 +35,9 @@ void VertexFormat_copy(VertexFormat* dest, const VertexFormat* src)
{
// copy regular struct fields
memcpy(dest, src, sizeof(VertexFormat));
+
+ for (unsigned i = 0; i < dest->attrib_ct; i++)
+ dest->attribs[i].name = (char *)dest + (dest->attribs[i].name - ((char *)src));
}
static GLenum convert_comp_type_to_gl(VertexCompType type)