From c17dfcd74519dddb4df6316d856ae8331d4a8354 Mon Sep 17 00:00:00 2001 From: Benjamin Cheng Date: Wed, 8 Oct 2025 14:28:28 -0400 Subject: [PATCH] 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 Part-of: --- src/vulkan/runtime/vk_query_pool.c | 8 ++++++++ src/vulkan/runtime/vk_query_pool.h | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/vulkan/runtime/vk_query_pool.c b/src/vulkan/runtime/vk_query_pool.c index 59294f414f3..0be3232aaa6 100644 --- a/src/vulkan/runtime/vk_query_pool.c +++ b/src/vulkan/runtime/vk_query_pool.c @@ -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 * diff --git a/src/vulkan/runtime/vk_query_pool.h b/src/vulkan/runtime/vk_query_pool.h index ee04eee9ff6..70588ec4fdc 100644 --- a/src/vulkan/runtime/vk_query_pool.h +++ b/src/vulkan/runtime/vk_query_pool.h @@ -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,