From 7a5d80e8017bcca615632d27db78fdd5e91ec1fe Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 24 Mar 2026 13:34:52 -0700 Subject: [PATCH] fix: flush GPU before first render frame after world load Add vkDeviceWaitIdle after world loading completes to ensure all async texture uploads and resource creation are fully flushed before the first render frame. Mitigates intermittent NVIDIA driver crashes at vkCmdBeginRenderPass during initial world entry. --- src/core/application.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/application.cpp b/src/core/application.cpp index db1f99a0..614c5883 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -5311,6 +5311,14 @@ void Application::loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float showProgress("Entering world...", 1.0f); + // Ensure all GPU resources (textures, buffers, pipelines) created during + // world load are fully flushed before the first render frame. Without this, + // vkCmdBeginRenderPass can crash on NVIDIA 590.x when resources from async + // uploads haven't completed their queue operations. + if (renderer && renderer->getVkContext()) { + vkDeviceWaitIdle(renderer->getVkContext()->getDevice()); + } + if (loadingScreenOk) { loadingScreen.shutdown(); }