diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-04-27 11:22:07 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-04-27 11:22:07 +0300 |
commit | 68ca12a7fc0eea117103d894609eb46c169ec88b (patch) | |
tree | 5054737e592d72b31dcc6036d9eed8c57b4c8f58 /source/blender/draw | |
parent | 9a8669ac81b99b2648b12e936bfcbc8a69a0fbbb (diff) |
Fix T96283: last disabled subsurf is used for GPU subdivision
When more than one, consecutive, subdivision modifier is used on a Mesh,
the last subsurf modifier is used for GPU subdivision even though it
might be disabled. This is because retrieving the last subsurf modifier
in the draw code did not check whether the modifier was disabled or not.
To fix this, the session UUID of the modifier which delegated evaluation
to the GPU code is cached and used in the draw to select the right subsurf
modifier.
Differential Revision: https://developer.blender.org/D14488
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_subdivision.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc index c859a72b371..1b84ac9b5a6 100644 --- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc +++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc @@ -1898,7 +1898,8 @@ static bool draw_subdiv_create_requested_buffers(const Scene *scene, const bool /*use_hide*/, OpenSubdiv_EvaluatorCache *evaluator_cache) { - SubsurfModifierData *smd = BKE_object_get_last_subsurf_modifier(ob); + SubsurfModifierData *smd = reinterpret_cast<SubsurfModifierData *>( + BKE_modifiers_findby_session_uuid(ob, &mesh->runtime.subsurf_session_uuid)); BLI_assert(smd); const bool is_final_render = DRW_state_is_scene_render(); |