summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_query.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2018-11-17 18:39:24 +0100
committerBas Nieuwenhuizen <[email protected]>2019-03-18 14:48:41 +0000
commitd1aa37dfff2f7d81fc256c1717d9e5ba8dbc2e78 (patch)
tree26fc29fd26302b74cf08cf24ec266a5c740872c2 /src/amd/vulkan/radv_query.c
parent887041c7630e72c85d31712f3377d801239f22e4 (diff)
radv: Implement VK_EXT_host_query_reset.
Reviewed-by: Samuel Pitoiset <[email protected]> Acked-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_query.c')
-rw-r--r--src/amd/vulkan/radv_query.c22
1 files changed, 22 insertions, 0 deletions
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) {