From 9315215b2068b1d92d7e218ca53934aab85d68d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Thu, 20 Jan 2022 15:27:38 +0100 Subject: Fix T94726: crash with GPU subdivision on a custom bone shape Custom bones are drawn by instancing the GPUBatch of the base object. To access the mesh and its GPUBatch, `BKE_object_get_evaluated_mesh` was used. However, since GPU subdivision support, this will return a subdivision wrapper which will never be drawn, and thus will have an invalid batch, which caused the crash. `BKE_object_get_evaluated_mesh_no_subsurf` should be used instead, to return the mesh that will be drawn, and have the subdivision evaluated on the GPU. Note that the rest of the draw code is already using this function. --- source/blender/draw/engines/overlay/overlay_armature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c index 6fdf410440d..668a1255843 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.c +++ b/source/blender/draw/engines/overlay/overlay_armature.c @@ -660,7 +660,7 @@ static void drw_shgroup_bone_custom_solid(ArmatureDrawContext *ctx, * by #data_eval. This is bad since it gives preference to an object's evaluated mesh over any * other data type, but supporting all evaluated geometry components would require a much larger * refactor of this area. */ - Mesh *mesh = BKE_object_get_evaluated_mesh(custom); + Mesh *mesh = BKE_object_get_evaluated_mesh_no_subsurf(custom); if (mesh == NULL) { return; } -- cgit v1.2.3