diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-01-20 17:27:38 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-01-20 17:28:08 +0300 |
commit | 9315215b2068b1d92d7e218ca53934aab85d68d7 (patch) | |
tree | 036e2348f97ea2f6eee9f061ca690a27e643d4f4 | |
parent | 264fe10ddde9f69efb2bc5288c8bb5689373aa57 (diff) |
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.
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_armature.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |