File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
include/nbl/video/utilities Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,12 @@ class NBL_API2 IResizableSurface : public ISimpleManagedSurface
6464 inline VkExtent2D getCurrentExtent ()
6565 {
6666 std::unique_lock guard (m_swapchainResourcesMutex);
67- // if got some weird invalid extent, try to recreate and retry once
67+ // because someone might skip an acquire when area==0, handle window closing
68+ if (m_cb->isWindowOpen ())
6869 while (true )
6970 {
7071 auto resources = getSwapchainResources ();
71- if (resources)
72+ if (resources && resources-> getStatus ()==ISwapchainResources::STATUS::USABLE )
7273 {
7374 auto swapchain = resources->getSwapchain ();
7475 if (swapchain)
@@ -78,9 +79,12 @@ class NBL_API2 IResizableSurface : public ISimpleManagedSurface
7879 return {params.width ,params.height };
7980 }
8081 }
82+ // if got some weird invalid extent, try to recreate and retry once
8183 if (!recreateSwapchain ())
8284 break ;
8385 }
86+ else
87+ becomeIrrecoverable ();
8488 return {0 ,0 };
8589 }
8690
You can’t perform that action at this time.
0 commit comments