Page MenuHome

Fix T98052: Eevee / Workbench background render crash with GPU subdivision
ClosedPublic

Authored by Brecht Van Lommel (brecht) on May 17 2022, 3:37 PM.

Details

Summary

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.

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested review of this revision.May 17 2022, 3:37 PM
Brecht Van Lommel (brecht) created this revision.

BKE_subsurf_modifier_can_do_gpu_subdiv_ex could be renamed to lose the _ex suffix, and its skip_check_is_last parameter can be removed since it is only used in the modifier code now (but checking if it's the last modifier still needs to happen).

This revision is now accepted and ready to land.May 17 2022, 4:07 PM