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
64
64
inline VkExtent2D getCurrentExtent ()
65
65
{
66
66
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 ())
68
69
while (true )
69
70
{
70
71
auto resources = getSwapchainResources ();
71
- if (resources)
72
+ if (resources && resources-> getStatus ()==ISwapchainResources::STATUS::USABLE )
72
73
{
73
74
auto swapchain = resources->getSwapchain ();
74
75
if (swapchain)
@@ -78,9 +79,12 @@ class NBL_API2 IResizableSurface : public ISimpleManagedSurface
78
79
return {params.width ,params.height };
79
80
}
80
81
}
82
+ // if got some weird invalid extent, try to recreate and retry once
81
83
if (!recreateSwapchain ())
82
84
break ;
83
85
}
86
+ else
87
+ becomeIrrecoverable ();
84
88
return {0 ,0 };
85
89
}
86
90
You can’t perform that action at this time.
0 commit comments