From ebb191f14576d870bda8b66f6d5cadc67924bf42 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 14 Jul 2015 09:29:35 -0700 Subject: [PATCH] vk/0.132: Add vkDestroyFence() --- include/vulkan/vulkan.h | 5 +++++ src/vulkan/device.c | 19 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index c32e41103ea..476c0523a91 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -2010,6 +2010,7 @@ typedef VkResult (VKAPI *PFN_vkGetObjectMemoryRequirements)(VkDevice device, VkO typedef VkResult (VKAPI *PFN_vkQueueBindSparseBufferMemory)(VkQueue queue, VkBuffer buffer, VkDeviceSize rangeOffset, VkDeviceSize rangeSize, VkDeviceMemory mem, VkDeviceSize memOffset); typedef VkResult (VKAPI *PFN_vkQueueBindSparseImageMemory)(VkQueue queue, VkImage image, const VkImageMemoryBindInfo* pBindInfo, VkDeviceMemory mem, VkDeviceSize memOffset); typedef VkResult (VKAPI *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence); +typedef VkResult (VKAPI *PFN_vkDestroyFence)(VkDevice device, VkFence fence); typedef VkResult (VKAPI *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences); typedef VkResult (VKAPI *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence); typedef VkResult (VKAPI *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout); @@ -2261,6 +2262,10 @@ VkResult VKAPI vkCreateFence( const VkFenceCreateInfo* pCreateInfo, VkFence* pFence); +VkResult VKAPI vkDestroyFence( + VkDevice device, + VkFence fence); + VkResult VKAPI vkResetFences( VkDevice device, uint32_t fenceCount, diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 34574d0f8c1..14221127fc5 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -1353,9 +1353,8 @@ anv_fence_destroy(struct anv_device *device, assert(obj_type == VK_OBJECT_TYPE_FENCE); - anv_gem_munmap(fence->bo.map, fence->bo.size); - anv_gem_close(device, fence->bo.gem_handle); - anv_device_free(device, fence); + anv_DestroyFence(anv_device_to_handle(device), + anv_fence_to_handle(fence)); } VkResult anv_CreateFence( @@ -1423,6 +1422,20 @@ VkResult anv_CreateFence( return result; } +VkResult anv_DestroyFence( + VkDevice _device, + VkFence _fence) +{ + ANV_FROM_HANDLE(anv_device, device, _device); + ANV_FROM_HANDLE(anv_fence, fence, _fence); + + anv_gem_munmap(fence->bo.map, fence->bo.size); + anv_gem_close(device, fence->bo.gem_handle); + anv_device_free(device, fence); + + return VK_SUCCESS; +} + VkResult anv_ResetFences( VkDevice _device, uint32_t fenceCount, -- 2.30.2