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: 8f7b5bf34b ("venus: add VK_EXT_primitives_generated_query support")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19684>
This commit is contained in:
Yiwei Zhang
2022-11-11 08:25:33 -08:00
committed by Marge Bot
parent 8a5de0b6cf
commit f7d7e558c9

View File

@@ -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;