mirror of https://github.com/RPCS3/rpcs3.git
vk: don't die on VK_SUBOPTIMAL_KHR in AcquireNextImage, and recreate swapchain
vkAcquireNextImageKHR can also return VK_SUBOPTIMAL_KHR and is non-fatal. However, it's a good idea to still recreate the swap chain later to maintain optimal presentation paths after temporary occlusion.
This commit is contained in:
parent
42ff93d30c
commit
56011cbddd
|
@ -2230,6 +2230,7 @@ void VKGSRender::present(frame_context_t *ctx)
|
||||||
case VK_SUCCESS:
|
case VK_SUCCESS:
|
||||||
break;
|
break;
|
||||||
case VK_SUBOPTIMAL_KHR:
|
case VK_SUBOPTIMAL_KHR:
|
||||||
|
should_reinitialize_swapchain = true;
|
||||||
break;
|
break;
|
||||||
case VK_ERROR_OUT_OF_DATE_KHR:
|
case VK_ERROR_OUT_OF_DATE_KHR:
|
||||||
swapchain_unavailable = true;
|
swapchain_unavailable = true;
|
||||||
|
@ -3110,6 +3111,7 @@ void VKGSRender::reinitialize_swapchain()
|
||||||
open_command_buffer();
|
open_command_buffer();
|
||||||
|
|
||||||
swapchain_unavailable = false;
|
swapchain_unavailable = false;
|
||||||
|
should_reinitialize_swapchain = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VKGSRender::flip(int buffer, bool emu_flip)
|
void VKGSRender::flip(int buffer, bool emu_flip)
|
||||||
|
@ -3124,7 +3126,7 @@ void VKGSRender::flip(int buffer, bool emu_flip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (swapchain_unavailable)
|
if (swapchain_unavailable || should_reinitialize_swapchain)
|
||||||
{
|
{
|
||||||
reinitialize_swapchain();
|
reinitialize_swapchain();
|
||||||
}
|
}
|
||||||
|
@ -3249,6 +3251,9 @@ void VKGSRender::flip(int buffer, bool emu_flip)
|
||||||
check_present_status();
|
check_present_status();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
case VK_SUBOPTIMAL_KHR:
|
||||||
|
should_reinitialize_swapchain = true;
|
||||||
|
break;
|
||||||
case VK_ERROR_OUT_OF_DATE_KHR:
|
case VK_ERROR_OUT_OF_DATE_KHR:
|
||||||
LOG_WARNING(RSX, "vkAcquireNextImageKHR failed with VK_ERROR_OUT_OF_DATE_KHR. Flip request ignored until surface is recreated.");
|
LOG_WARNING(RSX, "vkAcquireNextImageKHR failed with VK_ERROR_OUT_OF_DATE_KHR. Flip request ignored until surface is recreated.");
|
||||||
swapchain_unavailable = true;
|
swapchain_unavailable = true;
|
||||||
|
|
|
@ -359,6 +359,7 @@ private:
|
||||||
|
|
||||||
sizeu m_swapchain_dims{};
|
sizeu m_swapchain_dims{};
|
||||||
bool swapchain_unavailable = false;
|
bool swapchain_unavailable = false;
|
||||||
|
bool should_reinitialize_swapchain = false;
|
||||||
|
|
||||||
u64 m_last_heap_sync_time = 0;
|
u64 m_last_heap_sync_time = 0;
|
||||||
u32 m_texbuffer_view_size = 0;
|
u32 m_texbuffer_view_size = 0;
|
||||||
|
|
Loading…
Reference in New Issue