Fix issue with freeing resources
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
#include "Base/UI/IVulkanWindow.hpp"
|
||||
#include "Base/EngineConfiguration.hpp"
|
||||
#include "Scene/DataFormat.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
namespace OpenVulkano::Vulkan
|
||||
{
|
||||
@@ -25,13 +24,17 @@ namespace OpenVulkano::Vulkan
|
||||
CreateSwapChain({window->GetWidth(), window->GetHeight() });
|
||||
|
||||
FrameBuffer::Init(device, vk::Extent3D(size, 1));
|
||||
|
||||
Logger::RENDER->trace("Initialized swapchain");
|
||||
}
|
||||
|
||||
void SwapChain::Close()
|
||||
{
|
||||
FrameBuffer::Close();
|
||||
DestroySwapChain();
|
||||
device = nullptr;
|
||||
FrameBuffer::Close();
|
||||
window = nullptr;
|
||||
Logger::RENDER->trace("Closed swapchain");
|
||||
}
|
||||
|
||||
void SwapChain::Resize(const uint32_t newWidth, const uint32_t newHeight)
|
||||
@@ -40,6 +43,7 @@ namespace OpenVulkano::Vulkan
|
||||
|
||||
CreateSwapChain({ newWidth, newHeight });
|
||||
FrameBuffer::Resize(vk::Extent3D(size, 1));
|
||||
Logger::RENDER->trace("Resized swapchain");
|
||||
}
|
||||
|
||||
uint32_t SwapChain::AcquireNextImage(const vk::Fence& fence)
|
||||
@@ -141,6 +145,7 @@ namespace OpenVulkano::Vulkan
|
||||
for (auto& semaphore : imageAvailableSemaphores)
|
||||
device->device.destroySemaphore(semaphore);
|
||||
imageAvailableSemaphores.clear();
|
||||
Logger::RENDER->trace("Destroyed swapchain");
|
||||
}
|
||||
|
||||
vk::PresentModeKHR SwapChain::ChosePresentMode()
|
||||
|
||||
Reference in New Issue
Block a user