diff --git a/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp b/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp index 64c8de26..8822111b 100644 --- a/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp @@ -330,7 +330,25 @@ namespace MobileGL::MG_Backend::DirectVulkan { PopulateFormatCapabilitiesImpl(physicalDevice, getFormatProperties, capabilities, cache); } +#if MOBILEGL_BUILD_DISAGGREGATED + BackendObject_DirectVulkan::~BackendObject_DirectVulkan() { + // P12 review fix: A SERVER SESSION THAT ENDS WITHOUT A CLEAN TEARDOWN LEAVES NO RENDERER ON + // THE WINDOW. The renderer - swapchain and VkSurfaceKHR on the window - is a process global + // that only ReleaseEGLResources / a released surface drops, and a client that went away + // without eglTerminate (a crash, a kill, a dropped connection) sends neither. Under a + // transport this object is the server's and its destruction is the session's end (ServerLoop's + // apply thread, after the final drain, before the display lease ends), so the renderer goes + // here: nothing of the ended session keeps presenting into, or holding a surface on, the + // server's window once its lease is over. Monolith keeps its renderer. + if (MG_Config::Transport != MG_Config::TransportMode::Monolith && pVulkanRenderer != nullptr) { + BumpRendererGeneration(); + pVulkanRenderer.reset(); + ClearProgramResourceCaches(); + } + } +#else BackendObject_DirectVulkan::~BackendObject_DirectVulkan() = default; +#endif BackendObject_DirectVulkan::BackendObject_DirectVulkan() : m_rendererInfo{GetRendererIdentity()} {}