Skip to content

Commit

Permalink
Check if swapchain can be created, e.g. if windows starts minimized
Browse files Browse the repository at this point in the history
  • Loading branch information
Jupeyy committed Jan 25, 2024
1 parent c4d512d commit da3cde3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/engine/client/backend/vulkan/backend_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6571,7 +6571,20 @@ class CCommandProcessorFragment_Vulkan : public CCommandProcessorFragment_GLBase
Primq += 4;
}

if(!PrepareFrame())

VkSurfaceCapabilitiesKHR VKSurfCap;
if(!GetSurfaceProperties(VKSurfCap)) {
*pCommand->m_pInitError = -2;
return false;
}

auto Caps = GetSwapImageSize(VKSurfCap);
// if swapchain cannot be created, start paused
if (Caps.m_SwapImageViewport.width == 0 || Caps.m_SwapImageViewport.height == 0) {
m_RenderingPaused = true;
m_RecreateSwapChain = true;
}
else if(!PrepareFrame())
return false;
if(m_HasError)
{
Expand Down

0 comments on commit da3cde3

Please sign in to comment.