diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-04-19 16:26:52 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-04-19 16:26:52 +0000 |
| commit | 7bcbc9b17a30c3e704e4bafc06ff4e9123ed92cd (patch) | |
| tree | 69b4491d9c560a2d8e64ab64d5112469ca551c57 /Graphics/GraphicsEngineVulkan | |
| parent | Working on vulkan image layout transitions (diff) | |
| download | DiligentCore-7bcbc9b17a30c3e704e4bafc06ff4e9123ed92cd.tar.gz DiligentCore-7bcbc9b17a30c3e704e4bafc06ff4e9123ed92cd.zip | |
Added CreateSemaphore to VulkanLogicalDevice
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
4 files changed, 15 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanLogicalDevice.h b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanLogicalDevice.h index bafe0bea..1945b11a 100644 --- a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanLogicalDevice.h +++ b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanLogicalDevice.h @@ -78,6 +78,7 @@ namespace VulkanUtilities FramebufferWrapper CreateFramebuffer (const VkFramebufferCreateInfo &FramebufferCI, const char *DebugName = "")const; DescriptorPoolWrapper CreateDescriptorPool(const VkDescriptorPoolCreateInfo &DescrPoolCI, const char *DebugName = "")const; DescriptorSetLayoutWrapper CreateDescriptorSetLayout(const VkDescriptorSetLayoutCreateInfo &LayoutCI, const char *DebugName = "")const; + SemaphoreWrapper CreateSemaphore(const VkSemaphoreCreateInfo &SemaphoreCI, const char *DebugName = "")const; VkCommandBuffer AllocateVkCommandBuffer(const VkCommandBufferAllocateInfo &AllocInfo, const char *DebugName = "")const; @@ -96,6 +97,7 @@ namespace VulkanUtilities void ReleaseVulkanObject(FramebufferWrapper&& Framebuffer)const; void ReleaseVulkanObject(DescriptorPoolWrapper&& DescriptorPool)const; void ReleaseVulkanObject(DescriptorSetLayoutWrapper&& DescriptorSetLayout)const; + void ReleaseVulkanObject(SemaphoreWrapper&& Semaphore)const; VkMemoryRequirements GetBufferMemoryRequirements(VkBuffer vkBuffer)const; VkMemoryRequirements GetImageMemoryRequirements (VkImage vkImage )const; diff --git a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanObjectWrappers.h b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanObjectWrappers.h index 59d757cb..783a1e66 100644 --- a/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanObjectWrappers.h +++ b/Graphics/GraphicsEngineVulkan/include/VulkanUtilities/VulkanObjectWrappers.h @@ -105,4 +105,5 @@ namespace VulkanUtilities using FramebufferWrapper = VulkanObjectWrapper<VkFramebuffer>; using DescriptorPoolWrapper = VulkanObjectWrapper<VkDescriptorPool>; using DescriptorSetLayoutWrapper = VulkanObjectWrapper<VkDescriptorSetLayout>; + using SemaphoreWrapper = VulkanObjectWrapper<VkSemaphore>; } diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp index 43b115c3..0992c17f 100644 --- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp @@ -395,6 +395,7 @@ template void RenderDeviceVkImpl::SafeReleaseVkObject<VkPipelineLayout>(VulkanUt template void RenderDeviceVkImpl::SafeReleaseVkObject<VkFramebuffer> (VulkanUtilities::FramebufferWrapper &&Object); template void RenderDeviceVkImpl::SafeReleaseVkObject<VkDescriptorPool> (VulkanUtilities::DescriptorPoolWrapper &&Object); template void RenderDeviceVkImpl::SafeReleaseVkObject<VkDescriptorSetLayout>(VulkanUtilities::DescriptorSetLayoutWrapper &&Object); +template void RenderDeviceVkImpl::SafeReleaseVkObject<VkSemaphore> (VulkanUtilities::SemaphoreWrapper &&Object); void RenderDeviceVkImpl::DiscardStaleVkObjects(Uint64 CmdListNumber, Uint64 FenceValue) diff --git a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp index 3dff7a73..0b7fb004 100644 --- a/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp +++ b/Graphics/GraphicsEngineVulkan/src/VulkanUtilities/VulkanLogicalDevice.cpp @@ -214,6 +214,11 @@ namespace VulkanUtilities return CreateVulkanObject<VkDescriptorSetLayout>(vkCreateDescriptorSetLayout, LayoutCI, DebugName, "descriptor set layout"); } + SemaphoreWrapper VulkanLogicalDevice::CreateSemaphore(const VkSemaphoreCreateInfo &SemaphoreCI, const char *DebugName)const + { + return CreateVulkanObject<VkSemaphore>(vkCreateSemaphore, SemaphoreCI, DebugName, "semaphore"); + } + VkCommandBuffer VulkanLogicalDevice::AllocateVkCommandBuffer(const VkCommandBufferAllocateInfo &AllocInfo, const char *DebugName)const { if (DebugName == nullptr) @@ -319,6 +324,12 @@ namespace VulkanUtilities DescriptorSetLayout.m_VkObject = VK_NULL_HANDLE; } + void VulkanLogicalDevice::ReleaseVulkanObject(SemaphoreWrapper&& Semaphore)const + { + vkDestroySemaphore(m_VkDevice, Semaphore.m_VkObject, m_VkAllocator); + Semaphore.m_VkObject = VK_NULL_HANDLE; + } + |
