mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-17 16:30:30 +02:00
Vulkan: Smoothly recreate the swapchain using oldSwapchain on "resize" on Windows
This commit is contained in:
1 parent
84aeec7148
commit
6338832015
5 files changed
+27
-6
No files matched your search
@@ -120,13 +120,16 @@ void AndroidVulkanContext::Shutdown() {
|
||||
|
||||
void AndroidVulkanContext::Resize() {
|
||||
INFO_LOG(Log::G3D, "AndroidVulkanContext::Resize begin (oldsize: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
VulkanContext::CreateInfo info{};
|
||||
InitVulkanCreateInfoFromConfig(&info);
|
||||
|
||||
draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
|
||||
g_Vulkan->DestroySwapchain();
|
||||
|
||||
// TODO: We should only destroy the surface here if the window changed. We can track this inside g_Vulkan.
|
||||
|
||||
g_Vulkan->DestroySurface();
|
||||
|
||||
VulkanContext::CreateInfo info{};
|
||||
InitVulkanCreateInfoFromConfig(&info);
|
||||
g_Vulkan->UpdateCreateInfo(info);
|
||||
|
||||
g_Vulkan->ReinitSurface();
|
||||
|
||||
Reference in new issue
Block a user