The query size is calculated in QueryPool::get_query_pool_results_internal like so:
if (in_should_return_uint64)
{
flags |= VK_QUERY_RESULT_64_BIT;
result_query_size = sizeof(uint64_t);
}
else
{
result_query_size = sizeof(uint32_t);
}
While this is fine for occlusion and timestamp queries, this is incorrect for pipeline statistics queries if more than one statistics-flag was set for the query pool. According to the specification, the size of the data for a statistics query is calculated like this:
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.
(+ one integer for the availability if the flag was set.)
I've created a pull request for a fix here: #149