summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-02-18 15:21:04 -0800
committerJason Ekstrand <[email protected]>2017-02-21 12:26:35 -0800
commit40087bcb517bda60e666428a7a8f85dfdcbd9a56 (patch)
treed8c268e7768588b9c63dfcd9861cf296e4636e26
parentdc9abd0e6b448292c025ed1024fcaa8ef1a4edaa (diff)
anv/query: Perform CmdResetQueryPool on the GPU
This fixes a some rendering corruption in The Talos Principle Reviewed-by: Lionel Landwerlin <[email protected]> Cc: "13.0 17.0" <[email protected]>
-rw-r--r--src/intel/vulkan/anv_query.c22
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c30
2 files changed, 30 insertions, 22 deletions
diff --git a/src/intel/vulkan/anv_query.c b/src/intel/vulkan/anv_query.c
index da0deb86950..6fe94b0a4c2 100644
--- a/src/intel/vulkan/anv_query.c
+++ b/src/intel/vulkan/anv_query.c
@@ -169,25 +169,3 @@ VkResult anv_GetQueryPoolResults(
return VK_SUCCESS;
}
-
-void anv_CmdResetQueryPool(
- VkCommandBuffer commandBuffer,
- VkQueryPool queryPool,
- uint32_t firstQuery,
- uint32_t queryCount)
-{
- ANV_FROM_HANDLE(anv_query_pool, pool, queryPool);
-
- for (uint32_t i = 0; i < queryCount; i++) {
- switch (pool->type) {
- case VK_QUERY_TYPE_OCCLUSION:
- case VK_QUERY_TYPE_TIMESTAMP: {
- struct anv_query_pool_slot *slot = pool->bo.map;
- slot[firstQuery + i].available = 0;
- break;
- }
- default:
- assert(!"Invalid query type");
- }
- }
-}
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 40a72f4d141..12ff410d654 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -2510,6 +2510,36 @@ emit_query_availability(struct anv_cmd_buffer *cmd_buffer,
}
}
+void genX(CmdResetQueryPool)(
+ VkCommandBuffer commandBuffer,
+ VkQueryPool queryPool,
+ uint32_t firstQuery,
+ uint32_t queryCount)
+{
+ ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, commandBuffer);
+ ANV_FROM_HANDLE(anv_query_pool, pool, queryPool);
+
+ for (uint32_t i = 0; i < queryCount; i++) {
+ switch (pool->type) {
+ case VK_QUERY_TYPE_OCCLUSION:
+ case VK_QUERY_TYPE_TIMESTAMP: {
+ anv_batch_emit(&cmd_buffer->batch, GENX(MI_STORE_DATA_IMM), sdm) {
+ sdm.Address = (struct anv_address) {
+ .bo = &pool->bo,
+ .offset = (firstQuery + i) * sizeof(struct anv_query_pool_slot) +
+ offsetof(struct anv_query_pool_slot, available),
+ };
+ sdm.DataDWord0 = 0;
+ sdm.DataDWord1 = 0;
+ }
+ break;
+ }
+ default:
+ assert(!"Invalid query type");
+ }
+ }
+}
+
void genX(CmdBeginQuery)(
VkCommandBuffer commandBuffer,
VkQueryPool queryPool,