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;