vk/0.132: Add vkDestroyFence()
authorChad Versace <chad.versace@intel.com>
Tue, 14 Jul 2015 16:29:35 +0000 (09:29 -0700)
committerChad Versace <chad.versace@intel.com>
Tue, 14 Jul 2015 16:29:35 +0000 (09:29 -0700)
include/vulkan/vulkan.h
src/vulkan/device.c

index c32e41103eaab6be6c80412f0a4945606c953aa6..476c0523a91cc1a858dd409108f635e568fb27c6 100644 (file)
@@ -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,
index 34574d0f8c15678dd37af7191eaa54ad8f961d0c..14221127fc528408f28e2c083cf80a0e140bcc98 100644 (file)
@@ -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,