Module: Mesa Branch: main Commit: f7d7e558c958d4057cf88dfa37f80d150d62d87f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f7d7e558c958d4057cf88dfa37f80d150d62d87f
Author: Yiwei Zhang <[email protected]> Date: Fri Nov 11 08:25:33 2022 -0800 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 <[email protected]> Reviewed-by: Juston Li <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19684> --- src/virtio/vulkan/vn_query_pool.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/virtio/vulkan/vn_query_pool.c b/src/virtio/vulkan/vn_query_pool.c index f1cf8e7db25..bf41c4504cd 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;
