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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-01-20 17:27:38 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-01-20 17:28:08 +0300
commit9315215b2068b1d92d7e218ca53934aab85d68d7 (patch)
tree036e2348f97ea2f6eee9f061ca690a27e643d4f4
parent264fe10ddde9f69efb2bc5288c8bb5689373aa57 (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.c2
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;
}