diff options
Diffstat (limited to 'runtime/src/vulkan_backend.h')
| -rw-r--r-- | runtime/src/vulkan_backend.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/src/vulkan_backend.h b/runtime/src/vulkan_backend.h index e659a762d..748705547 100644 --- a/runtime/src/vulkan_backend.h +++ b/runtime/src/vulkan_backend.h | |||
| @@ -1809,7 +1809,14 @@ public: | |||
| 1809 | type.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; | 1809 | type.semaphoreType = VK_SEMAPHORE_TYPE_TIMELINE; |
| 1810 | VkSemaphoreCreateInfo info{VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, &type}; | 1810 | VkSemaphoreCreateInfo info{VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, &type}; |
| 1811 | ok_ = ok_ && vk.vkCreateSemaphore(context.device(), &info, nullptr, &progress_) == VK_SUCCESS; | 1811 | ok_ = ok_ && vk.vkCreateSemaphore(context.device(), &info, nullptr, &progress_) == VK_SUCCESS; |
| 1812 | context_.holds().attach(this); | 1812 | try { |
| 1813 | context_.holds().attach(this); | ||
| 1814 | } catch (...) { | ||
| 1815 | // A failed registration leaves no queue to run the destructor for these Vulkan handles. | ||
| 1816 | if (progress_) vk.vkDestroySemaphore(context.device(), progress_, nullptr); | ||
| 1817 | if (pool_) vk.vkDestroyCommandPool(context.device(), pool_, nullptr); | ||
| 1818 | throw; | ||
| 1819 | } | ||
| 1813 | } | 1820 | } |
| 1814 | 1821 | ||
| 1815 | ~VulkanQueue() { | 1822 | ~VulkanQueue() { |