From 584cb7a16f4c1ec1b20760247069c3634232bc8a Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 14 Jul 2015 09:44:58 -0700 Subject: [PATCH] vk/0.132: Add vkDestroyQueryPool() --- include/vulkan/vulkan.h | 5 +++++ src/vulkan/query.c | 19 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 72d20dbeb52..a2ebe4b106e 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -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, diff --git a/src/vulkan/query.c b/src/vulkan/query.c index 2c68e30eeee..3a1f594816d 100644 --- a/src/vulkan/query.c +++ b/src/vulkan/query.c @@ -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, -- 2.30.2