From ec3f3457fdfdf49b64e57c1e6c8cefd0603bc309 Mon Sep 17 00:00:00 2001 From: Lynne Date: Fri, 18 Apr 2025 16:27:19 +0200 Subject: [PATCH] vulkan_decode: add STORAGE flag to output images In filtering, and SDR encoding, we use storage images. This fixes using Vulkan filters on Intel. Tested not to break anything on the three major vendors. --- libavcodec/vulkan_decode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c index 93aa0ce5b3..f1313c8409 100644 --- a/libavcodec/vulkan_decode.c +++ b/libavcodec/vulkan_decode.c @@ -1070,7 +1070,8 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) hwfc->format[0] = vkfmt; hwfc->tiling = VK_IMAGE_TILING_OPTIMAL; - hwfc->usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | + hwfc->usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | + VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; if (prof) { @@ -1084,8 +1085,6 @@ int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx) if (ctx->s.extensions & (FF_VK_EXT_VIDEO_ENCODE_QUEUE | FF_VK_EXT_VIDEO_MAINTENANCE_1)) hwfc->usage |= VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR; - } else if (DECODER_IS_SDR(avctx->codec_id)) { - hwfc->usage |= VK_IMAGE_USAGE_STORAGE_BIT; } return err;