Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan suboptimal swapchain fixes #6355

Merged
merged 1 commit into from Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion rpcs3/Emu/RSX/VK/VKGSRender.cpp
Expand Up @@ -2230,6 +2230,7 @@ void VKGSRender::present(frame_context_t *ctx)
case VK_SUCCESS:
break;
case VK_SUBOPTIMAL_KHR:
should_reinitialize_swapchain = true;
break;
case VK_ERROR_OUT_OF_DATE_KHR:
swapchain_unavailable = true;
Expand Down Expand Up @@ -3110,6 +3111,7 @@ void VKGSRender::reinitialize_swapchain()
open_command_buffer();

swapchain_unavailable = false;
should_reinitialize_swapchain = false;
}

void VKGSRender::flip(int buffer, bool emu_flip)
Expand All @@ -3124,7 +3126,7 @@ void VKGSRender::flip(int buffer, bool emu_flip)
}
}

if (swapchain_unavailable)
if (swapchain_unavailable || should_reinitialize_swapchain)
{
reinitialize_swapchain();
}
Expand Down Expand Up @@ -3249,6 +3251,9 @@ void VKGSRender::flip(int buffer, bool emu_flip)
check_present_status();
continue;
}
case VK_SUBOPTIMAL_KHR:
should_reinitialize_swapchain = true;
break;
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.");
swapchain_unavailable = true;
Expand Down
1 change: 1 addition & 0 deletions rpcs3/Emu/RSX/VK/VKGSRender.h
Expand Up @@ -359,6 +359,7 @@ class VKGSRender : public GSRender, public ::rsx::reports::ZCULL_control

sizeu m_swapchain_dims{};
bool swapchain_unavailable = false;
bool should_reinitialize_swapchain = false;

u64 m_last_heap_sync_time = 0;
u32 m_texbuffer_view_size = 0;
Expand Down