[Mesa-dev] [PATCH] radv: make sure to emit cache flushes before starting a query
Samuel Pitoiset
samuel.pitoiset at gmail.com
Wed Feb 28 17:00:42 UTC 2018
If the query pool has been previously resetted using the compute
shader path.
Fixes: a41e2e9cf5 ("radv: allow to use a compute shader for resetting the query pool")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105292
Cc: "18.0" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/amd/vulkan/radv_private.h | 1 +
src/amd/vulkan/radv_query.c | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index c72df5a737..dd57403894 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1604,6 +1604,7 @@ struct radv_query_pool {
char *ptr;
VkQueryType type;
uint32_t pipeline_stats_mask;
+ bool pending_reset;
};
struct radv_semaphore {
diff --git a/src/amd/vulkan/radv_query.c b/src/amd/vulkan/radv_query.c
index ace745e4e6..d602707f5e 100644
--- a/src/amd/vulkan/radv_query.c
+++ b/src/amd/vulkan/radv_query.c
@@ -771,6 +771,7 @@ VkResult radv_CreateQueryPool(
unreachable("creating unhandled query type");
}
+ pool->pending_reset = false;
pool->type = pCreateInfo->queryType;
pool->pipeline_stats_mask = pCreateInfo->pipelineStatistics;
pool->availability_offset = pool->stride * pCreateInfo->queryCount;
@@ -1070,6 +1071,8 @@ void radv_CmdResetQueryPool(
pool->availability_offset + firstQuery * 4,
queryCount * 4, 0);
}
+
+ pool->pending_reset = true;
}
void radv_CmdBeginQuery(
@@ -1086,6 +1089,14 @@ void radv_CmdBeginQuery(
radv_cs_add_buffer(cmd_buffer->device->ws, cs, pool->bo, 8);
+ if (pool->pending_reset) {
+ /* Make sure to emit the cache flushes if the query pool has
+ * been previously resetted using a compute shader.
+ */
+ si_emit_cache_flush(cmd_buffer);
+ pool->pending_reset = false;
+ }
+
switch (pool->type) {
case VK_QUERY_TYPE_OCCLUSION:
radeon_check_space(cmd_buffer->device->ws, cs, 7);
--
2.16.2
More information about the mesa-dev
mailing list