DRW Batch Cache: Fix hack being a bit too much hacky
authorClément Foucault <foucault.clem@gmail.com>
Fri, 14 Dec 2018 01:54:39 +0000 (02:54 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Fri, 14 Dec 2018 15:17:29 +0000 (16:17 +0100)
source/blender/draw/intern/draw_cache.c

index dbd05baa144f67be19ded9d4ea1f3cd8773aaecd..9186191cea5e05fb9396edef587b659d62bb5166 100644 (file)
@@ -3718,8 +3718,10 @@ void DRW_vbo_request(GPUBatch *batch, GPUVertBuf **vbo)
        }
        else {
                /* HACK: bypass assert */
+               int vbo_vert_len = (*vbo)->vertex_len;
                (*vbo)->vertex_len = batch->verts[0]->vertex_len;
                GPU_batch_vertbuf_add(batch, *vbo);
+               (*vbo)->vertex_len = vbo_vert_len;
        }
 }