mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-27 05:23:51 +00:00
fix(rendering): crash on window resize due to stale swapchain
- Mark swapchain dirty in Application's SDL resize handler (was only done in Window::pollEvents which is never called) - Skip swapchain recreation when window is minimized (0×0 extent violates Vulkan spec and crashes vmaCreateImage) - Guard aspect ratio division by zero when height is 0 Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
This commit is contained in:
parent
759d6046bb
commit
e07983b7f6
2 changed files with 7 additions and 1 deletions
|
|
@ -859,6 +859,8 @@ void Renderer::beginFrame() {
|
|||
|
||||
// Handle swapchain recreation if needed
|
||||
if (vkCtx->isSwapchainDirty()) {
|
||||
// Skip recreation while window is minimized (0×0 extent is a Vulkan spec violation)
|
||||
if (window->getWidth() == 0 || window->getHeight() == 0) return;
|
||||
(void)vkCtx->recreateSwapchain(window->getWidth(), window->getHeight());
|
||||
// Rebuild water resources that reference swapchain extent/views
|
||||
if (waterRenderer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue