Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: titatovenaar76--- via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: Ffmpeg Devel <ffmpeg-devel@ffmpeg.org>
Cc: titatovenaar76@tutanota.com
Subject: [FFmpeg-devel] [Vulkan HWAccel] Incorrect default img_flags causes VUID-06811 validation error
Date: Thu, 13 Nov 2025 17:56:05 +0100 (CET)
Message-ID: <Ody8JhK--F-9@tutanota.com> (raw)

Hello, I am using Vulkan hardware accelerated video decoding and I am setting up the AVVulkanFramesContext myself.
However when "VkImageCreateFlags img_flags" is unset, a default set of flags (including VK_IMAGE_CREATE_ALIAS_BIT and others) is applied.
(https://github.com/FFmpeg/FFmpeg/blob/6cdd2cbe323e04cb4bf88bea50c32aad60cba26e/libavutil/hwcontext_vulkan.h#L261C3-L261C23)

The resulting images generate a Vulkan validation error VUID-VkImageCreateInfo-pNext-06811 on my hardware (Nvidia RTX 2070 super)
as it doesn't support this default set of flags for the requested images of format VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
It actually requires img_flags to equal 0. However that is interpreted by ffmpeg as being unset.
Hence the issue

The offending code in ffmpeg seems to be here:
(https://github.com/FFmpeg/FFmpeg/blob/6cdd2cbe323e04cb4bf88bea50c32aad60cba26e/libavutil/hwcontext_vulkan.c#L2937)

     * 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. */
    if (!hwctx->img_flags) {
        int is_lone_dpb = ((hwctx->usage & VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR) ||
                           ((hwctx->usage & VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR) &&
                            !(hwctx->usage & VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR)));
        int sampleable = hwctx->usage & (VK_IMAGE_USAGE_SAMPLED_BIT |
                                         VK_IMAGE_USAGE_STORAGE_BIT);
        hwctx->img_flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
        if (sampleable && !is_lone_dpb) {
            hwctx->img_flags |= VK_IMAGE_CREATE_ALIAS_BIT;
            if ((fmt->vk_planes > 1) && (hwctx->format[0] == fmt->vkf))
                hwctx->img_flags |= VK_IMAGE_CREATE_EXTENDED_USAGE_BIT;
        }
    }

A possible solution would be to modify the logic to differentiate between an intentionally set 0 and an uninitialized state.

-- 
 Secured with Tuta Mail: 
 https://tuta.com/free-email
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-11-13 16:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ody8JhK--F-9@tutanota.com \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=titatovenaar76@tutanota.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git