Delete created semaphores on close

This commit is contained in:
Georg Hagen
2024-07-11 16:56:52 +02:00
parent 888e30193b
commit 1d06e56c9e
2 changed files with 6 additions and 3 deletions

View File

@@ -32,7 +32,9 @@ namespace OpenVulkano::Vulkan
for (int i = 0; i < context.swapChain.GetImageCount(); i++)
{
waitSemaphores.emplace_back();
waitSemaphores[i].renderComplete.push_back(context.device->device.createSemaphore({}));
vk::Semaphore sema = context.device->device.createSemaphore({});
semaphores.push_back(sema);
waitSemaphores[i].renderComplete.push_back(sema);
waitSemaphores[i].renderReady.resize(2);
}
resourceManager.Init(&context, context.swapChain.GetImageCount());
@@ -73,9 +75,9 @@ namespace OpenVulkano::Vulkan
void Renderer::Close()
{
context.device->WaitIdle();
for (int i = 0; i < context.swapChain.GetImageCount(); i++)
for (auto& sema : semaphores)
{
//context.device->device.destroySemaphore(waitSemaphores[i]);
context.device->device.destroySemaphore(sema);
}
uiRenderer.Close();
resourceManager.Close();