[Bf-blender-cvs] [afecc4e976f] greasepencil-refactor: GPencil: Refactor: Fix fill stroke indices

Clément Foucault noreply at git.blender.org
Mon Dec 9 13:31:34 CET 2019


Commit: afecc4e976f97892a54ea23cb9714d20f02bcde8
Author: Clément Foucault
Date:   Mon Dec 9 14:02:38 2019 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBafecc4e976f97892a54ea23cb9714d20f02bcde8

GPencil: Refactor: Fix fill stroke indices

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

M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index b3364d113dd..3c60e750d70 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -149,9 +149,11 @@ static void gpencil_buffer_add_stroke(gpStrokeVert *verts, const bGPDstroke *str
 static void gpencil_buffer_add_fill(GPUIndexBufBuilder *ibo, const bGPDstroke *stroke)
 {
   int tri_len = stroke->tot_triangles;
+  /* Add one for the adjacency index. */
+  int v = stroke->runtime.stroke_start;
   for (int i = 0; i < tri_len; i++) {
     uint *tri = stroke->triangles[i].verts;
-    GPU_indexbuf_add_tri_verts(ibo, tri[0], tri[1], tri[2]);
+    GPU_indexbuf_add_tri_verts(ibo, v + tri[0], v + tri[1], v + tri[2]);
   }
 }



More information about the Bf-blender-cvs mailing list