Fix crash when minimizing in windows
This commit is contained in:
parent
d69f83c7cc
commit
e5318d8ea9
@ -1703,8 +1703,8 @@ bool GEVulkanDriver::endScene()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkFence fence = m_vk->in_flight_fences[m_current_frame];
|
if (m_vk->in_flight_fences.empty() || vkWaitForFences(m_vk->device, 1,
|
||||||
if (vkWaitForFences(m_vk->device, 1, &fence, VK_TRUE, 2000000000) ==
|
&m_vk->in_flight_fences[m_current_frame], VK_TRUE, 2000000000) ==
|
||||||
VK_TIMEOUT)
|
VK_TIMEOUT)
|
||||||
{
|
{
|
||||||
// Attempt to restore after out focus in gnome fullscreen
|
// Attempt to restore after out focus in gnome fullscreen
|
||||||
@ -1712,10 +1712,20 @@ bool GEVulkanDriver::endScene()
|
|||||||
GEVulkan2dRenderer::clear();
|
GEVulkan2dRenderer::clear();
|
||||||
handleDeletedTextures();
|
handleDeletedTextures();
|
||||||
destroySwapChainRelated(false/*handle_surface*/);
|
destroySwapChainRelated(false/*handle_surface*/);
|
||||||
createSwapChainRelated(false/*handle_surface*/);
|
try
|
||||||
|
{
|
||||||
|
createSwapChainRelated(false/*handle_surface*/);
|
||||||
|
}
|
||||||
|
catch (std::exception& e)
|
||||||
|
{
|
||||||
|
// When minimized in Windows swapchain depth buffer will fail to
|
||||||
|
// create
|
||||||
|
destroySwapChainRelated(false/*handle_surface*/);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VkFence fence = m_vk->in_flight_fences[m_current_frame];
|
||||||
vkResetFences(m_vk->device, 1, &fence);
|
vkResetFences(m_vk->device, 1, &fence);
|
||||||
vkResetCommandPool(m_vk->device, m_vk->command_pools[m_current_frame], 0);
|
vkResetCommandPool(m_vk->device, m_vk->command_pools[m_current_frame], 0);
|
||||||
|
|
||||||
|
@ -2086,16 +2086,17 @@ void IrrDriver::handleWindowResize()
|
|||||||
new_orientation = (int)SDL_GetDisplayOrientation(0);
|
new_orientation = (int)SDL_GetDisplayOrientation(0);
|
||||||
screen_orientation_changed = m_screen_orientation != new_orientation;
|
screen_orientation_changed = m_screen_orientation != new_orientation;
|
||||||
#endif
|
#endif
|
||||||
if (m_actual_screen_size != m_video_driver->getCurrentRenderTargetSize() ||
|
const core::dimension2du& new_size = m_video_driver->getCurrentRenderTargetSize();
|
||||||
current_screen_size != m_video_driver->getCurrentRenderTargetSize() ||
|
if (m_actual_screen_size != new_size ||
|
||||||
|
current_screen_size != new_size ||
|
||||||
screen_orientation_changed)
|
screen_orientation_changed)
|
||||||
{
|
{
|
||||||
// Don't update when dialog is opened
|
// Don't update when dialog is opened or minimized
|
||||||
if (dialog_exists)
|
if (dialog_exists || new_size.getArea() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_screen_orientation = new_orientation;
|
m_screen_orientation = new_orientation;
|
||||||
m_actual_screen_size = m_video_driver->getCurrentRenderTargetSize();
|
m_actual_screen_size = new_size;
|
||||||
UserConfigParams::m_width = m_actual_screen_size.Width;
|
UserConfigParams::m_width = m_actual_screen_size.Width;
|
||||||
UserConfigParams::m_height = m_actual_screen_size.Height;
|
UserConfigParams::m_height = m_actual_screen_size.Height;
|
||||||
UserConfigParams::m_real_width = (unsigned)((float)m_actual_screen_size.Width / m_device->getNativeScaleX());
|
UserConfigParams::m_real_width = (unsigned)((float)m_actual_screen_size.Width / m_device->getNativeScaleX());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user