SDL: Avoid destroying the surface on resize.

This commit is contained in:
Henrik Rydgård 2020-07-18 20:37:55 +02:00
parent 697c3b8b36
commit 49d9caeb0d
2 changed files with 7 additions and 2 deletions

View file

@ -1083,6 +1083,13 @@ void VulkanContext::PerformPendingDeletes() {
}
void VulkanContext::DestroyDevice() {
if (swapchain_) {
ELOG("DestroyDevice: Swapchain should have been destroyed.");
}
if (surface_) {
ELOG("DestroyDevice: Surface should have been destroyed.");
}
ILOG("VulkanContext::DestroyDevice (performing deletes)");
PerformPendingDeletes();

View file

@ -144,9 +144,7 @@ void SDLVulkanGraphicsContext::Shutdown() {
void SDLVulkanGraphicsContext::Resize() {
draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, vulkan_->GetBackbufferWidth(), vulkan_->GetBackbufferHeight());
vulkan_->DestroySwapchain();
vulkan_->DestroySurface();
vulkan_->UpdateFlags(FlagsFromConfig());
vulkan_->ReinitSurface();
vulkan_->InitSwapchain();
draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, vulkan_->GetBackbufferWidth(), vulkan_->GetBackbufferHeight());
}