This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 3f9e04b489 vulkan: fix encode feedback query handling
3f9e04b489 is described below
commit 3f9e04b48958ca9cd75ce9f36feb30cd6d861add
Author: Stéphane Cerveau <[email protected]>
AuthorDate: Tue Mar 24 15:41:30 2026 +0100
Commit: Lynne <[email protected]>
CommitDate: Tue Apr 14 21:31:45 2026 +0000
vulkan: fix encode feedback query handling
Check that the driver supports both BUFFER_OFFSET and BYTES_WRITTEN
encode feedback flags before creating the query pool, failing with
EINVAL if either is missing.
Set these flags explicitly instead of masking off HAS_OVERRIDES with a
bitwise NOT, which could pass unrecognized bits from newer drivers to
vkCreateQueryPool causing validation errors and
crashes.
---
libavcodec/vulkan_encode.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/libavcodec/vulkan_encode.c b/libavcodec/vulkan_encode.c
index a440646e4f..b6f0b26f6b 100644
--- a/libavcodec/vulkan_encode.c
+++ b/libavcodec/vulkan_encode.c
@@ -751,6 +751,8 @@ av_cold int ff_vulkan_encode_init(AVCodecContext *avctx,
FFVulkanEncodeContext *
VkVideoFormatPropertiesKHR *ret_info;
uint32_t nb_out_fmts = 0;
+ const uint32_t feedback_flags =
VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR |
+
VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR;
VkPhysicalDeviceVideoEncodeQualityLevelInfoKHR quality_info;
@@ -770,6 +772,14 @@ av_cold int ff_vulkan_encode_init(AVCodecContext *avctx,
FFVulkanEncodeContext *
return AVERROR(EINVAL);
}
+ if ((ctx->enc_caps.supportedEncodeFeedbackFlags & feedback_flags) !=
+ feedback_flags) {
+ av_log (avctx, AV_LOG_ERROR,
+ "Driver does not support required encode feedback flags "
+ "(BUFFER_OFFSET and BYTES_WRITTEN).\n");
+ return AVERROR(ENOTSUP);
+ }
+
ctx->base.op = &vulkan_base_encode_ops;
ctx->codec = codec;
@@ -879,8 +889,7 @@ av_cold int ff_vulkan_encode_init(AVCodecContext *avctx,
FFVulkanEncodeContext *
query_create = (VkQueryPoolVideoEncodeFeedbackCreateInfoKHR) {
.sType =
VK_STRUCTURE_TYPE_QUERY_POOL_VIDEO_ENCODE_FEEDBACK_CREATE_INFO_KHR,
.pNext = &ctx->profile,
- .encodeFeedbackFlags = ctx->enc_caps.supportedEncodeFeedbackFlags &
-
(~VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_HAS_OVERRIDES_BIT_KHR),
+ .encodeFeedbackFlags = feedback_flags,
};
err = ff_vk_exec_pool_init(s, ctx->qf_enc, &ctx->enc_pool,
base_ctx->async_depth,
1, VK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR, 0,
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]