From 887041c7630e72c85d31712f3377d801239f22e4 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 4 Mar 2019 20:01:44 -0600 Subject: [PATCH] anv: Implement VK_EXT_host_query_reset Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Eric Engestrom Reviewed-by: Lionel Landwerlin --- src/intel/vulkan/anv_device.c | 7 +++++++ src/intel/vulkan/anv_extensions.py | 1 + src/intel/vulkan/genX_query.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 83fa3936c19..a6ecc657f4b 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -971,6 +971,13 @@ void anv_GetPhysicalDeviceFeatures2( break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT: { + VkPhysicalDeviceHostQueryResetFeaturesEXT *features = + (VkPhysicalDeviceHostQueryResetFeaturesEXT *)ext; + features->hostQueryReset = true; + break; + } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT: { VkPhysicalDeviceInlineUniformBlockFeaturesEXT *features = (VkPhysicalDeviceInlineUniformBlockFeaturesEXT *)ext; diff --git a/src/intel/vulkan/anv_extensions.py b/src/intel/vulkan/anv_extensions.py index 6fff293dee4..e4404c59f34 100644 --- a/src/intel/vulkan/anv_extensions.py +++ b/src/intel/vulkan/anv_extensions.py @@ -126,6 +126,7 @@ EXTENSIONS = [ Extension('VK_EXT_external_memory_host', 1, True), Extension('VK_EXT_global_priority', 1, 'device->has_context_priority'), + Extension('VK_EXT_host_query_reset', 1, True), Extension('VK_EXT_inline_uniform_block', 1, True), Extension('VK_EXT_pci_bus_info', 2, True), Extension('VK_EXT_post_depth_coverage', 1, 'device->info.gen >= 9'), diff --git a/src/intel/vulkan/genX_query.c b/src/intel/vulkan/genX_query.c index 794d92dc6c9..5d7b5fb458e 100644 --- a/src/intel/vulkan/genX_query.c +++ b/src/intel/vulkan/genX_query.c @@ -402,6 +402,20 @@ void genX(CmdResetQueryPool)( } } +void genX(ResetQueryPoolEXT)( + VkDevice _device, + VkQueryPool queryPool, + uint32_t firstQuery, + uint32_t queryCount) +{ + ANV_FROM_HANDLE(anv_query_pool, pool, queryPool); + + for (uint32_t i = 0; i < queryCount; i++) { + uint64_t *slot = pool->bo.map + (firstQuery + i) * pool->stride; + *slot = 0; + } +} + static const uint32_t vk_pipeline_stat_to_reg[] = { GENX(IA_VERTICES_COUNT_num), GENX(IA_PRIMITIVES_COUNT_num), -- 2.30.2