diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-11 13:56:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-11 14:05:49 +0300 |
commit | f1242ea93b1cdbd8a6125e1760146db187075c79 (patch) | |
tree | bd0ea761ba806a146ca34d550b8b60b7bf3adc43 /intern/gawain/src | |
parent | 0ffb19ca645ed2fa7d95e49472332dcfc2690312 (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.c | 3 |
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) |