Fix Stockades crash: suppress area triggers on initial login, handle VK_ERROR_DEVICE_LOST

Root cause: LOGIN_VERIFY_WORLD path did not set areaTriggerCheckTimer_ or
areaTriggerSuppressFirst_, so the Stockades exit portal (AT 503) fired
immediately on login, teleporting the player back to Stormwind and crashing
the GPU during the unexpected map transition.

Fixes:
- Set 5s area trigger cooldown + suppress-first in handleLoginVerifyWorld
  (same as SMSG_NEW_WORLD handler already did for teleports)
- Add deviceLost_ flag to VkContext so beginFrame returns immediately once
  VK_ERROR_DEVICE_LOST is detected, preventing infinite retry loops
- Track device lost from both fence wait and queue submit paths
This commit is contained in:
Kelsi 2026-03-02 08:19:14 -08:00
parent 3c55b09a3f
commit f1caf8c03e
4 changed files with 18 additions and 0 deletions

View file

@ -1297,6 +1297,8 @@ bool VkContext::recreateSwapchain(int width, int height) {
}
VkCommandBuffer VkContext::beginFrame(uint32_t& imageIndex) {
if (deviceLost_) return VK_NULL_HANDLE;
auto& frame = frames[currentFrame];
// Wait for this frame's fence (with timeout to detect GPU hangs)
@ -1309,6 +1311,9 @@ VkCommandBuffer VkContext::beginFrame(uint32_t& imageIndex) {
}
if (fenceResult != VK_SUCCESS) {
LOG_ERROR("beginFrame[", beginFrameCounter, "] fence wait failed: ", (int)fenceResult);
if (fenceResult == VK_ERROR_DEVICE_LOST) {
deviceLost_ = true;
}
return VK_NULL_HANDLE;
}
@ -1363,6 +1368,9 @@ void VkContext::endFrame(VkCommandBuffer cmd, uint32_t imageIndex) {
VkResult submitResult = vkQueueSubmit(graphicsQueue, 1, &submitInfo, frame.inFlightFence);
if (submitResult != VK_SUCCESS) {
LOG_ERROR("endFrame[", endFrameCounter, "] vkQueueSubmit FAILED: ", (int)submitResult);
if (submitResult == VK_ERROR_DEVICE_LOST) {
deviceLost_ = true;
}
}
VkPresentInfoKHR presentInfo{};