diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-05-17 16:31:37 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-05-17 17:14:15 +0300 |
commit | 0609b4bb491eae28b7aff411f54d732b458d6ae9 (patch) | |
tree | ecf7b06626f11ae73a0223723e62e5f998222000 /source/blender/draw/intern | |
parent | dbc439e41a1aaa17e237ccf058c75ea8975bc79b (diff) |
Fix T98052: Eevee / Workbench background render crash with GPU subdivision
The problem is that depsgraph evaluation happens before the OpenGL context
is initialized, and so modifier evaluation happens without GPU subdivision.
Later the BKE_subsurf_modifier_can_do_gpu_subdiv test in the draw code gives
a different result.
This just checks if the mesh has information for GPU subdivision in the draw
code, and if so uses it. This is only set if the test for supported GPU
subdivision passes in the modifier evaluation.
Additionally it may be good to perform OpenGL context initialization earlier
so background render can take advantage of GPU subdivision, but this is more
complicated.
Differential Revision: https://developer.blender.org/D14969
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c index 7dc0244275d..dac4b7488be 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.c +++ b/source/blender/draw/intern/draw_cache_impl_mesh.c @@ -1822,9 +1822,7 @@ void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, do_uvcage = !editmesh_eval_final->runtime.is_original; } - const int required_mode = BKE_subsurf_modifier_eval_required_mode(DRW_state_is_scene_render(), - is_editmode); - const bool do_subdivision = BKE_subsurf_modifier_can_do_gpu_subdiv(scene, ob, me, required_mode); + const bool do_subdivision = BKE_subsurf_modifier_has_gpu_subdiv(me); MeshBufferList *mbuflist = &cache->final.buff; |