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:
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_mesh.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index b8b657354b2..49db8bd9765 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -879,6 +879,13 @@ GPUBatch *DRW_mesh_batch_cache_get_edit_facedots(Mesh *me)
return DRW_batch_request(&cache->batch.edit_fdots);
}
+GPUBatch *DRW_mesh_batch_cache_get_edit_skin_roots(Mesh *me)
+{
+ MeshBatchCache *cache = mesh_batch_cache_get(me);
+ mesh_batch_cache_add_request(cache, MBC_SKIN_ROOTS);
+ return DRW_batch_request(&cache->batch.edit_skin_roots);
+}
+
/** \} */
/* ---------------------------------------------------------------------- */
@@ -1319,6 +1326,18 @@ void DRW_mesh_batch_cache_create_requested(
DRW_vbo_request(cache->batch.edit_fdots, &mbufcache->vbo.fdots_pos);
DRW_vbo_request(cache->batch.edit_fdots, &mbufcache->vbo.fdots_nor);
}
+ if (DRW_batch_requested(cache->batch.edit_skin_roots, GPU_PRIM_LINES)) {
+ DRW_vbo_request(cache->batch.edit_skin_roots, &mbufcache->vbo.skin_roots);
+ /* HACK(fclem): This is a workaround the deferred batch init
+ * that prevent drawing using DRW_shgroup_call_instances_with_attribs.
+ * So we instead create the whole instancing batch here.
+ * Note that we use GPU_PRIM_LINES instead of expected GPU_PRIM_LINE_STRIP
+ * in order to mimic the old stipple pattern. */
+ cache->batch.edit_skin_roots->inst = cache->batch.edit_skin_roots->verts[0];
+ cache->batch.edit_skin_roots->verts[0] = NULL;
+ GPUBatch *circle = DRW_cache_screenspace_circle_get();
+ GPU_batch_vertbuf_add(cache->batch.edit_skin_roots, circle->verts[0]);
+ }
/* Selection */
if (DRW_batch_requested(cache->batch.edit_selection_verts, GPU_PRIM_POINTS)) {