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:
authorClément Foucault <foucault.clem@gmail.com>2019-05-09 12:35:45 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-09 12:35:52 +0300
commit895c41ec5d0f4574bedf800bf8bb6183169043f4 (patch)
treeb0e8009ff126b2262ae6f13c9be2ae981b277461 /source/blender/draw/intern/draw_armature.c
parent5ab57f7ba41dff3d4554d1cb47db2b2868efe710 (diff)
Fix Crash with armature using custom shapes
Diffstat (limited to 'source/blender/draw/intern/draw_armature.c')
-rw-r--r--source/blender/draw/intern/draw_armature.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_armature.c b/source/blender/draw/intern/draw_armature.c
index 9b52f282944..a94d47496e0 100644
--- a/source/blender/draw/intern/draw_armature.c
+++ b/source/blender/draw/intern/draw_armature.c
@@ -336,6 +336,7 @@ static void drw_shgroup_bone_envelope(const float (*bone_mat)[4],
/* Custom (geometry) */
+extern void drw_batch_cache_validate(Object *custom);
extern void drw_batch_cache_generate_requested(Object *custom);
static void drw_shgroup_bone_custom_solid(const float (*bone_mat)[4],
@@ -345,6 +346,10 @@ static void drw_shgroup_bone_custom_solid(const float (*bone_mat)[4],
const eGPUShaderConfig sh_cfg,
Object *custom)
{
+ /* TODO(fclem) arg... less than ideal but we never iter on this object
+ * to assure batch cache is valid. */
+ drw_batch_cache_validate(custom);
+
struct GPUBatch *surf = DRW_cache_object_surface_get(custom);
struct GPUBatch *edges = DRW_cache_object_edge_detection_get(custom, NULL);
struct GPUBatch *ledges = DRW_cache_object_loose_edges_get(custom);
@@ -408,6 +413,10 @@ static void drw_shgroup_bone_custom_wire(const float (*bone_mat)[4],
const float color[4],
Object *custom)
{
+ /* TODO(fclem) arg... less than ideal but we never iter on this object
+ * to assure batch cache is valid. */
+ drw_batch_cache_validate(custom);
+
struct GPUBatch *geom = DRW_cache_object_all_edges_get(custom);
if (geom) {