From: Hyunjun Ko Date: Tue, 1 Sep 2020 05:16:02 +0000 (+0000) Subject: turnip: Implement VK_EXT_host_query_reset X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=075e40ea983fddabbb45ee5d511e66536f3c9c11;p=mesa.git turnip: Implement VK_EXT_host_query_reset Signed-off-by: Hyunjun Ko Part-of: --- diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index 3d68a702047..3a7b458ea4f 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -482,7 +482,7 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, features->uniformBufferStandardLayout = false; features->shaderSubgroupExtendedTypes = false; features->separateDepthStencilLayouts = false; - features->hostQueryReset = false; + features->hostQueryReset = true; features->timelineSemaphore = false; features->bufferDeviceAddress = false; features->bufferDeviceAddressCaptureReplay = false; @@ -612,6 +612,12 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, features->customBorderColorWithoutFormat = true; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT: { + VkPhysicalDeviceHostQueryResetFeaturesEXT *features = + (VkPhysicalDeviceHostQueryResetFeaturesEXT *)ext; + features->hostQueryReset = true; + break; + } default: break; } diff --git a/src/freedreno/vulkan/tu_extensions.py b/src/freedreno/vulkan/tu_extensions.py index b51b5aa329d..16722a3c48b 100644 --- a/src/freedreno/vulkan/tu_extensions.py +++ b/src/freedreno/vulkan/tu_extensions.py @@ -93,6 +93,7 @@ EXTENSIONS = [ Extension('VK_EXT_conditional_rendering', 1, True), Extension('VK_EXT_custom_border_color', 12, True), Extension('VK_KHR_multiview', 1, True), + Extension('VK_EXT_host_query_reset', 1, True), ] MAX_API_VERSION = VkVersion(MAX_API_VERSION) diff --git a/src/freedreno/vulkan/tu_query.c b/src/freedreno/vulkan/tu_query.c index ea4fb29e590..2bdc4d3dd30 100644 --- a/src/freedreno/vulkan/tu_query.c +++ b/src/freedreno/vulkan/tu_query.c @@ -599,6 +599,25 @@ tu_CmdResetQueryPool(VkCommandBuffer commandBuffer, tu_bo_list_add(&cmdbuf->bo_list, &pool->bo, MSM_SUBMIT_BO_WRITE); } +void +tu_ResetQueryPool(VkDevice device, + VkQueryPool queryPool, + uint32_t firstQuery, + uint32_t queryCount) +{ + TU_FROM_HANDLE(tu_query_pool, pool, queryPool); + + for (uint32_t i = 0; i < queryCount; i++) { + struct query_slot *slot = slot_address(pool, i + firstQuery); + slot->available = 0; + + for (uint32_t k = 0; k < get_result_count(pool); k++) { + uint64_t *res = query_result_addr(pool, i + firstQuery, k); + *res = 0; + } + } +} + static void emit_begin_occlusion_query(struct tu_cmd_buffer *cmdbuf, struct tu_query_pool *pool,