Skip to content

Commit 3a3347a

Browse files
committed
VulkanWindow: if glfwGetFramebufferSize returns 0x0 due to the application being minimized on Windows, don't try to recreate the framebuffer with a bogus size. See #893.
1 parent c1042d3 commit 3a3347a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ngscopeclient/VulkanWindow.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,16 @@ bool VulkanWindow::UpdateFramebuffer()
315315
//If size doesn't match up, early out. We're probably in the middle of a resize.
316316
//(This will be corrected next frame, so no worries)
317317
auto caps = g_vkComputePhysicalDevice->getSurfaceCapabilitiesKHR(**m_surface);
318+
int oldWidth = m_width;
319+
int oldHeight = m_height;
318320
glfwGetFramebufferSize(m_window, &m_width, &m_height);
321+
if( (m_width == 0) || (m_height == 0) )
322+
{
323+
LogTrace("Invalid size 0x0 reported (window minimized?)\n");
324+
m_width = oldWidth;
325+
m_height = oldHeight;
326+
return false;
327+
}
319328
LogTrace("Max image extent: %d x %d\n", caps.maxImageExtent.width, caps.maxImageExtent.height);
320329
LogTrace("Current dims: %d x %d\n", m_width, m_height);
321330
if( (caps.maxImageExtent.width < (unsigned int)m_width) ||

0 commit comments

Comments
 (0)