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
path: root/source
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-10-24 22:09:40 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-10-24 22:44:57 +0300
commite2d06eb68ab4bb474694ffd96b5d11dbb6741bb1 (patch)
treec57317ceb3baaceb3a76360d145ed4a5f46bdcde /source
parent954b834053f17f1c0ff1f3096030b81d0d9ea7ec (diff)
GPencil: Fix missing fills
For some reason stroke_id needs to be the triangle index, not the vertex index.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c2
-rw-r--r--source/blender/draw/intern/draw_cache_impl_gpencil.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 21e536ffbd4..78e658d35eb 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -536,7 +536,7 @@ static void gpencil_stroke_cache_populate(bGPDlayer *gpl,
gpencil_drawcall_add(iter, geom, vfirst, vcount);
}
- iter->stroke_index_last = gps->runtime.vertex_start + gps->totpoints + 1;
+ iter->stroke_index_last = gps->runtime.stroke_start + gps->totpoints + 1;
}
static void gpencil_sbuffer_cache_populate_fast(GPENCIL_Data *vedata, gpIterPopulateData *iter)
diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.cc b/source/blender/draw/intern/draw_cache_impl_gpencil.cc
index 667ae380ae4..9dbab8fef02 100644
--- a/source/blender/draw/intern/draw_cache_impl_gpencil.cc
+++ b/source/blender/draw/intern/draw_cache_impl_gpencil.cc
@@ -319,7 +319,7 @@ static void gpencil_buffer_add_point(GPUIndexBufBuilder *ibo,
vert->strength = (round_cap0) ? pt->strength : -pt->strength;
vert->u_stroke = pt->uv_fac;
- vert->stroke_id = gps->runtime.vertex_start;
+ vert->stroke_id = gps->runtime.stroke_start;
vert->point_id = v;
vert->thickness = max_ff(0.0f, gps->thickness * pt->pressure) * (round_cap1 ? 1.0f : -1.0f);
/* Tag endpoint material to -1 so they get discarded by vertex shader. */