Fix crash when minimizing in windows
This commit is contained in:
parent
d69f83c7cc
commit
e5318d8ea9
@ -1703,8 +1703,8 @@ bool GEVulkanDriver::endScene()
|
||||
return false;
|
||||
}
|
||||
|
||||
VkFence fence = m_vk->in_flight_fences[m_current_frame];
|
||||
if (vkWaitForFences(m_vk->device, 1, &fence, VK_TRUE, 2000000000) ==
|
||||
if (m_vk->in_flight_fences.empty() || vkWaitForFences(m_vk->device, 1,
|
||||
&m_vk->in_flight_fences[m_current_frame], VK_TRUE, 2000000000) ==
|
||||
VK_TIMEOUT)
|
||||
{
|
||||
// Attempt to restore after out focus in gnome fullscreen
|
||||
@ -1712,10 +1712,20 @@ bool GEVulkanDriver::endScene()
|
||||
GEVulkan2dRenderer::clear();
|
||||
handleDeletedTextures();
|
||||
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;
|
||||
}
|
||||
|
||||
VkFence fence = m_vk->in_flight_fences[m_current_frame];
|
||||
vkResetFences(m_vk->device, 1, &fence);
|
||||
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);
|
||||
screen_orientation_changed = m_screen_orientation != new_orientation;
|
||||
#endif
|
||||
if (m_actual_screen_size != m_video_driver->getCurrentRenderTargetSize() ||
|
||||
current_screen_size != m_video_driver->getCurrentRenderTargetSize() ||
|
||||
const core::dimension2du& new_size = m_video_driver->getCurrentRenderTargetSize();
|
||||
if (m_actual_screen_size != new_size ||
|
||||
current_screen_size != new_size ||
|
||||
screen_orientation_changed)
|
||||
{
|
||||
// Don't update when dialog is opened
|
||||
if (dialog_exists)
|
||||
// Don't update when dialog is opened or minimized
|
||||
if (dialog_exists || new_size.getArea() == 0)
|
||||
return;
|
||||
|
||||
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_height = m_actual_screen_size.Height;
|
||||
UserConfigParams::m_real_width = (unsigned)((float)m_actual_screen_size.Width / m_device->getNativeScaleX());
|
||||
|
Loading…
Reference in New Issue
Block a user