vulkan/query_pool: Store video encode feedback

Drivers need to track which feedback bits were set at creation time to
output the correct things in vkGetQueryPoolResults().

Cc: mesa-stable
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37774>
This commit is contained in:
Benjamin Cheng 2025-10-08 14:28:28 -04:00 committed by Marge Bot
parent f1cbac7a8e
commit c17dfcd745
2 changed files with 15 additions and 0 deletions

View file

@ -27,6 +27,7 @@
#include "vk_command_buffer.h"
#include "vk_common_entrypoints.h"
#include "vk_device.h"
#include "vk_util.h"
void
vk_query_pool_init(struct vk_device *device,
@ -42,6 +43,13 @@ vk_query_pool_init(struct vk_device *device,
query_pool->pipeline_statistics =
pCreateInfo->queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS ?
pCreateInfo->pipelineStatistics : 0;
if (pCreateInfo->queryType == VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR) {
const struct VkQueryPoolVideoEncodeFeedbackCreateInfoKHR *feedback_info =
vk_find_struct_const(pCreateInfo->pNext, QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR);
if (feedback_info)
query_pool->encode_feedback_flags = feedback_info->encodeFeedbackFlags;
}
}
void *

View file

@ -43,6 +43,13 @@ struct vk_query_pool {
* If query_type != VK_QUERY_TYPE_PIPELINE_STATISTICS, this will be zero.
*/
VkQueryPipelineStatisticFlags pipeline_statistics;
/** VkQueryPoolVideoEncodeFeedbackCreateInfoKHR::encodeFeedbackFlags
*
* If query_type != VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR, this will be
* zero.
*/
VkVideoEncodeFeedbackFlagsKHR encode_feedback_flags;
};
void vk_query_pool_init(struct vk_device *device,