diff options
author | Bas Nieuwenhuizen <[email protected]> | 2018-11-17 18:39:24 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2019-03-18 14:48:41 +0000 |
commit | d1aa37dfff2f7d81fc256c1717d9e5ba8dbc2e78 (patch) | |
tree | 26fc29fd26302b74cf08cf24ec266a5c740872c2 /src | |
parent | 887041c7630e72c85d31712f3377d801239f22e4 (diff) |
radv: Implement VK_EXT_host_query_reset.
Reviewed-by: Samuel Pitoiset <[email protected]>
Acked-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 6 | ||||
-rw-r--r-- | src/amd/vulkan/radv_extensions.py | 1 | ||||
-rw-r--r-- | src/amd/vulkan/radv_query.c | 22 |
3 files changed, 29 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 9570c15af02..dc4346b7498 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -887,6 +887,12 @@ void radv_GetPhysicalDeviceFeatures2( features->depthClipEnable = 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/amd/vulkan/radv_extensions.py b/src/amd/vulkan/radv_extensions.py index 0440a2ec9d9..986ef26876d 100644 --- a/src/amd/vulkan/radv_extensions.py +++ b/src/amd/vulkan/radv_extensions.py @@ -107,6 +107,7 @@ EXTENSIONS = [ Extension('VK_EXT_external_memory_dma_buf', 1, True), Extension('VK_EXT_external_memory_host', 1, 'device->rad_info.has_userptr'), Extension('VK_EXT_global_priority', 1, 'device->rad_info.has_ctx_priority'), + Extension('VK_EXT_host_query_reset', 1, True), Extension('VK_EXT_memory_budget', 1, True), Extension('VK_EXT_memory_priority', 1, True), Extension('VK_EXT_pci_bus_info', 2, True), diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c index cb279172922..e808aa65170 100644 --- a/src/amd/vulkan/radv_query.c +++ b/src/amd/vulkan/radv_query.c @@ -1436,6 +1436,28 @@ void radv_CmdResetQueryPool( } } +void radv_ResetQueryPoolEXT( + VkDevice _device, + VkQueryPool queryPool, + uint32_t firstQuery, + uint32_t queryCount) +{ + RADV_FROM_HANDLE(radv_query_pool, pool, queryPool); + + uint32_t value = pool->type == VK_QUERY_TYPE_TIMESTAMP + ? TIMESTAMP_NOT_READY : 0; + uint32_t *data = (uint32_t*)(pool->ptr + firstQuery * pool->stride); + uint32_t *data_end = (uint32_t*)(pool->ptr + (firstQuery + queryCount) * pool->stride); + + for(uint32_t *p = data; p != data_end; ++p) + *p = value; + + if (pool->type == VK_QUERY_TYPE_PIPELINE_STATISTICS) { + memset(pool->ptr + pool->availability_offset + firstQuery * 4, + 0, queryCount * 4); + } +} + static unsigned event_type_for_stream(unsigned stream) { switch (stream) { |