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

index 72d20dbeb52b6ab4182973e4cd1ecee572f2b098..a2ebe4b106e55ce7e29535365a15a9717f46d6e9 100644 (file)
@@ -2024,6 +2024,7 @@ typedef VkResult (VKAPI *PFN_vkGetEventStatus)(VkDevice device, VkEvent event);
 typedef VkResult (VKAPI *PFN_vkSetEvent)(VkDevice device, VkEvent event);
 typedef VkResult (VKAPI *PFN_vkResetEvent)(VkDevice device, VkEvent event);
 typedef VkResult (VKAPI *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, VkQueryPool* pQueryPool);
+typedef VkResult (VKAPI *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool);
 typedef VkResult (VKAPI *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags);
 typedef VkResult (VKAPI *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer);
 typedef VkResult (VKAPI *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, VkBufferView* pView);
@@ -2327,6 +2328,10 @@ VkResult VKAPI vkCreateQueryPool(
     const VkQueryPoolCreateInfo*                pCreateInfo,
     VkQueryPool*                                pQueryPool);
 
+VkResult VKAPI vkDestroyQueryPool(
+    VkDevice                                    device,
+    VkQueryPool                                 queryPool);
+
 VkResult VKAPI vkGetQueryPoolResults(
     VkDevice                                    device,
     VkQueryPool                                 queryPool,
index 2c68e30eeee269a82c0d5ec14dc2deb06ab0be0c..3a1f594816d90d013ae07855e34a52376b0f3b52 100644 (file)
@@ -51,9 +51,8 @@ anv_query_pool_destroy(struct anv_device *device,
 
    assert(obj_type == VK_OBJECT_TYPE_QUERY_POOL);
 
-   anv_gem_munmap(pool->bo.map, pool->bo.size);
-   anv_gem_close(device, pool->bo.gem_handle);
-   anv_device_free(device, pool);
+   anv_DestroyQueryPool(anv_device_to_handle(device),
+                        anv_query_pool_to_handle(pool));
 }
 
 VkResult anv_CreateQueryPool(
@@ -102,6 +101,20 @@ VkResult anv_CreateQueryPool(
    return result;
 }
 
+VkResult anv_DestroyQueryPool(
+    VkDevice                                    _device,
+    VkQueryPool                                 _pool)
+{
+   ANV_FROM_HANDLE(anv_device, device, _device);
+   ANV_FROM_HANDLE(anv_query_pool, pool, _pool);
+
+   anv_gem_munmap(pool->bo.map, pool->bo.size);
+   anv_gem_close(device, pool->bo.gem_handle);
+   anv_device_free(device, pool);
+
+   return VK_SUCCESS;
+}
+
 VkResult anv_GetQueryPoolResults(
     VkDevice                                    _device,
     VkQueryPool                                 queryPool,