From 58240683933c84de69dccabb4a2c4ce364ba3f7a Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Fri, 11 Nov 2022 08:25:33 -0800 Subject: [PATCH] venus: handle VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT This change adds some docs for the query size, and has been tested with dEQP-VK.transform_feedback.primitives_generated_query.* on supported implementations. Fixes: 8f7b5bf34b4 ("venus: add VK_EXT_primitives_generated_query support") Signed-off-by: Yiwei Zhang Reviewed-by: Juston Li Part-of: (cherry picked from commit f7d7e558c958d4057cf88dfa37f80d150d62d87f) --- .pick_status.json | 2 +- src/virtio/vulkan/vn_query_pool.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 0a680d6..0edff27 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2119,7 +2119,7 @@ "description": "venus: handle VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "8f7b5bf34b4207bac6417902ff715e5643d45389" }, diff --git a/src/virtio/vulkan/vn_query_pool.c b/src/virtio/vulkan/vn_query_pool.c index f1cf8e7..bf41c45 100644 --- a/src/virtio/vulkan/vn_query_pool.c +++ b/src/virtio/vulkan/vn_query_pool.c @@ -39,18 +39,47 @@ vn_CreateQueryPool(VkDevice device, switch (pCreateInfo->queryType) { case VK_QUERY_TYPE_OCCLUSION: + /* + * Occlusion queries write one integer value - the number of samples + * passed. + */ pool->result_array_size = 1; break; case VK_QUERY_TYPE_PIPELINE_STATISTICS: + /* + * Pipeline statistics queries write one integer value for each bit that + * is enabled in the pipelineStatistics when the pool is created, and + * the statistics values are written in bit order starting from the + * least significant bit. + */ pool->result_array_size = util_bitcount(pCreateInfo->pipelineStatistics); break; case VK_QUERY_TYPE_TIMESTAMP: + /* Timestamp queries write one integer value. */ pool->result_array_size = 1; break; case VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT: + /* + * Transform feedback queries write two integers; the first integer is + * the number of primitives successfully written to the corresponding + * transform feedback buffer and the second is the number of primitives + * output to the vertex stream, regardless of whether they were + * successfully captured or not. + */ pool->result_array_size = 2; break; + case VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT: + /* + * Primitives generated queries write one integer value; the number of + * primitives output to the vertex stream, regardless of whether + * transform feedback is active or not, or whether they were + * successfully captured by transform feedback or not. This is identical + * to the second integer of the transform feedback queries if transform + * feedback is active. + */ + pool->result_array_size = 1; + break; default: unreachable("bad query type"); break; -- 2.7.4