From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 37E4A46F89 for ; Tue, 24 Oct 2023 23:42:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1458368CA83; Wed, 25 Oct 2023 02:42:56 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C775568C7CC for ; Wed, 25 Oct 2023 02:42:49 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id 8021110602E4 for ; Tue, 24 Oct 2023 23:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1698190969; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=Dnshp2nxUaBigbPR1DnOCiSIeJ+JE/CYB90tGpcnAz4=; b=gUiWmSVbAiEOv5jIwYvnftFrhxhnCnyf7fACZXq3btz/Ttgipb1cvCN8NkewinR5 lK5Inxo3Bc3WEhXVtH41AHbXvTYFvNHXs6a6+iwtwrwxYG/+65YX10eZj+IKe8K9fAS /IKQN/NiAP515pCML41nWHFFAmrklyolu3XKyBnRnaFB3CgjSi2zTrJT4x1zFWJr/GL wPEk9/MNzZvYsEaBYPOqRcknankCBqqp9gJGlAGpBFzFWipfwqQ545R54sRLM18ANAF R7XGlUsAjx91IdX3WNpfkndrZQBEMdjKSimcWNYxDN53PeY0A75e3juJPNK6A5caeiO lqERVtc2ig== Date: Wed, 25 Oct 2023 01:42:49 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_37728_1532679894.1698190969519" Subject: [FFmpeg-devel] [PATCH 2/2] vulkan_decode: fix another validation issue X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: ------=_Part_37728_1532679894.1698190969519 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Surprising no one, the insane usage rule has a catch. Only happens in the layered_dpb path, which was poorly tested. Fixes: "[AVHWDeviceContext @ 0x557f4b87dc00] Validation Error: [ VUID-VkImageMemoryBarrier2-srcQueueFamilyIndex-07122 ] Object 0: handle = 0xaf31600000000ce, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0xfe471484 | vkCmdPipelineBarrier2(): pDependencyInfo->pImageMemoryBarriers[0].oldLayout (VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR) is not compatible with VkImage 0xaf31600000000ce[] usage flags 0x405. The Vulkan spec states: If srcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR then image must have been created with VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier2-srcQueueFamilyIndex-07122) " Patch attached. ------=_Part_37728_1532679894.1698190969519 Content-Type: text/x-diff; charset=us-ascii; name=0002-vulkan_decode-fix-another-validation-issue.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-vulkan_decode-fix-another-validation-issue.patch >From 8594a95ca1c0819fdf7b04f57542787c5f574223 Mon Sep 17 00:00:00 2001 From: Lynne Date: Wed, 25 Oct 2023 01:32:20 +0200 Subject: [PATCH 2/2] vulkan_decode: fix another validation issue Surprising no one, the insane usage rule has a catch. --- libavcodec/vulkan_decode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c index c01eeb9cdc..7f575d1283 100644 --- a/libavcodec/vulkan_decode.c +++ b/libavcodec/vulkan_decode.c @@ -449,7 +449,8 @@ int ff_vk_decode_frame(AVCodecContext *avctx, .srcAccessMask = VK_ACCESS_2_NONE, .dstAccessMask = VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR, .oldLayout = vkf->layout[0], - .newLayout = vp->dpb_frame ? VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR : + .newLayout = (dec->layered_dpb && vp->dpb_frame) ? + VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR : VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR, /* Spec, 07252 utter madness */ .srcQueueFamilyIndex = vkf->queue_family[0], .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, -- 2.42.0 ------=_Part_37728_1532679894.1698190969519 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". ------=_Part_37728_1532679894.1698190969519--