summaryrefslogtreecommitdiffstats
path: root/tools/gfx/vulkan/vk-device-queue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/vulkan/vk-device-queue.cpp')
-rw-r--r--tools/gfx/vulkan/vk-device-queue.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/gfx/vulkan/vk-device-queue.cpp b/tools/gfx/vulkan/vk-device-queue.cpp
index 10a3d0e3b..3b9e6cbcd 100644
--- a/tools/gfx/vulkan/vk-device-queue.cpp
+++ b/tools/gfx/vulkan/vk-device-queue.cpp
@@ -1,4 +1,4 @@
-// vk-device-queue.cpp
+// vk-device-queue.cpp
#include "vk-device-queue.h"
#include <stdlib.h>
@@ -10,17 +10,20 @@ using namespace Slang;
VulkanDeviceQueue::~VulkanDeviceQueue()
{
- for (int i = 0; i < int(EventType::CountOf); ++i)
+ if (m_api)
{
- m_api->vkDestroySemaphore(m_api->m_device, m_semaphores[i], nullptr);
- }
+ for (int i = 0; i < int(EventType::CountOf); ++i)
+ {
+ m_api->vkDestroySemaphore(m_api->m_device, m_semaphores[i], nullptr);
+ }
- for (int i = 0; i < m_numCommandBuffers; i++)
- {
- m_api->vkFreeCommandBuffers(m_api->m_device, m_commandPool, 1, &m_commandBuffers[i]);
- m_api->vkDestroyFence(m_api->m_device, m_fences[i].fence, nullptr);
+ for (int i = 0; i < m_numCommandBuffers; i++)
+ {
+ m_api->vkFreeCommandBuffers(m_api->m_device, m_commandPool, 1, &m_commandBuffers[i]);
+ m_api->vkDestroyFence(m_api->m_device, m_fences[i].fence, nullptr);
+ }
+ m_api->vkDestroyCommandPool(m_api->m_device, m_commandPool, nullptr);
}
- m_api->vkDestroyCommandPool(m_api->m_device, m_commandPool, nullptr);
}
SlangResult VulkanDeviceQueue::init(const VulkanApi& api, VkQueue queue, int queueIndex)