[FFmpeg-devel] [PATCH] avutil/hwcontext_vulkan: always enable extra usage flags (PR #20295)
Niklas Haas
code at ffmpeg.org
Thu Aug 21 00:01:33 EEST 2025
PR #20295 opened by Niklas Haas (haasn)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20295
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20295.patch
Otherwise, this may break vulkan encoding or subsequent hwupload/hwdownload
if the upstream filter did not specifically advertise this.
From 7096e82417d12da01b7d9fd8f62447e974ac8ade Mon Sep 17 00:00:00 2001
From: Niklas Haas <git at haasn.dev>
Date: Wed, 20 Aug 2025 16:56:22 +0200
Subject: [PATCH] avutil/hwcontext_vulkan: always enable extra usage flags
Otherwise, this may break vulkan encoding or subsequent hwupload/hwdownload
if the upstream filter did not specifically advertise this.
---
libavutil/hwcontext_vulkan.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index e066fa8d18..13c385d674 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -2914,17 +2914,17 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
VK_IMAGE_USAGE_STORAGE_BIT |
VK_IMAGE_USAGE_SAMPLED_BIT);
-
- if ((p->vkctx.extensions & FF_VK_EXT_HOST_IMAGE_COPY) && !p->disable_host_transfer)
- hwctx->usage |= supported_usage & VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT;
-
- /* Enables encoding of images, if supported by format and extensions */
- if ((supported_usage & VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR) &&
- (p->vkctx.extensions & (FF_VK_EXT_VIDEO_ENCODE_QUEUE |
- FF_VK_EXT_VIDEO_MAINTENANCE_1)))
- hwctx->usage |= VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR;
}
+ if ((p->vkctx.extensions & FF_VK_EXT_HOST_IMAGE_COPY) && !p->disable_host_transfer)
+ hwctx->usage |= supported_usage & VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT;
+
+ /* Enables encoding of images, if supported by format and extensions */
+ if ((supported_usage & VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR) &&
+ (p->vkctx.extensions & (FF_VK_EXT_VIDEO_ENCODE_QUEUE |
+ FF_VK_EXT_VIDEO_MAINTENANCE_1)))
+ hwctx->usage |= VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR;
+
/* Image creation flags.
* Only fill them in automatically if the image is not going to be used as
* a DPB-only image, and we have SAMPLED/STORAGE bits set. */
--
2.49.1
More information about the ffmpeg-devel
mailing list