mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Exit gracefully on VK_ERROR_DEVICE_LOST instead of spinning forever
When the GPU device is lost (unrecoverable Vulkan error), the app now closes cleanly instead of looping with a black screen. Also adds vk_context.hpp include for the isDeviceLost() check.
This commit is contained in:
parent
b948720ec3
commit
4cd1abd5a6
1 changed files with 7 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "core/logger.hpp"
|
||||
#include "core/memory_monitor.hpp"
|
||||
#include "rendering/renderer.hpp"
|
||||
#include "rendering/vk_context.hpp"
|
||||
#include "audio/npc_voice_manager.hpp"
|
||||
#include "rendering/camera.hpp"
|
||||
#include "rendering/camera_controller.hpp"
|
||||
|
|
@ -416,6 +417,12 @@ void Application::run() {
|
|||
LOG_ERROR("Exception during swapBuffers: ", e.what());
|
||||
throw;
|
||||
}
|
||||
|
||||
// Exit gracefully on GPU device lost (unrecoverable)
|
||||
if (renderer && renderer->getVkContext() && renderer->getVkContext()->isDeviceLost()) {
|
||||
LOG_ERROR("GPU device lost — exiting application");
|
||||
window->setShouldClose(true);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_INFO("Main loop ended");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue