Skip to content

Commit 7e966d4

Browse files
committed
Reset all framebuffers before recreating swapchain
1 parent 17a8ec6 commit 7e966d4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

source/VulkanEngine.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ void VulkanEngine::recreateSwapChain()
374374
logicalDevice->waitIdle();
375375

376376
framebuffer.reset();
377+
offscreenFramebuffer.reset();
377378
swapChain.reset();
378379

379380
swapChain = std::make_shared<SwapChain>(physicalDevice, logicalDevice, window);
@@ -387,8 +388,6 @@ void VulkanEngine::recreateSwapChain()
387388
return;
388389
}
389390

390-
offscreenFramebuffer.reset();
391-
392391
offscreenFramebuffer = std::make_shared<Framebuffer>(physicalDevice, logicalDevice, swapChain, commandPool,
393392
renderPass, false, offscreenViewportExtent);
394393
}

0 commit comments

Comments
 (0)