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 AD60E47097 for ; Wed, 25 Oct 2023 23:02:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 999C968CAF3; Thu, 26 Oct 2023 02:02:33 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 30CAD68C965 for ; Thu, 26 Oct 2023 02:02:27 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id CC3851060307 for ; Wed, 25 Oct 2023 23:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1698274946; 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:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=JVTp9mFPcU5XH8AZ8A9fr/ZbkTW27C7afdstWFakvvo=; b=w1N2UQpW/w9zQPs7XCByU15IgbYKPxQ+KcgbD0LeSFLiTWuVWek/luhrmF4qy+Hw Ep56SwAucM7eCfVxo2aL1aPsgHMLpEHcQ2BysMPdqcyR61hdUiQ2pPc8rs/4Sk0cm3k 9VPhm84Ny/sZDTDixwSzHRbvWUDTezZ6OHVToKHVId1MvTqcLxOCXmsp7wSEfpjmq0W uAF0DEYExQB8/cREHUn6fbAlZg6+Sqz0drz1WMKL3OTHWgb4C5p2sfXonJOQLSNCfnk qIYb4YZRCSvzFFuRP1bZv9rSn5FW0UDCxdLmbb9jIdXkmgO6yAzmE8CiUarMFOed9IT 3cDua8njQw== Date: Thu, 26 Oct 2023 01:02:26 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_113667_1342427752.1698274946463" Subject: [FFmpeg-devel] [PATCH] vulkan: return VK_NOT_READY when no queries are available 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_113667_1342427752.1698274946463 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Fixes a validation issue. The issue is that the function gets called before we've sumitted a frame for decoding to that context. However, we cannot run queries before they've been reset, which happens at submission time. As we'd need to otherwise run a command queue at init-time, just check if submissions have happened. Patch attached. ------=_Part_113667_1342427752.1698274946463 Content-Type: text/x-diff; charset=us-ascii; name=0001-vulkan-return-VK_NOT_READY-when-no-queries-are-avail.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-vulkan-return-VK_NOT_READY-when-no-queries-are-avail.patch >From 833a1c249f5e41305fe8ea68f5e2453a5505817d Mon Sep 17 00:00:00 2001 From: Lynne Date: Wed, 25 Oct 2023 22:58:20 +0000 Subject: [PATCH] vulkan: return VK_NOT_READY when no queries are available Fixes a validation issue. The issue is that the function gets called before we've sumitted a frame for decoding to that context. However, we cannot run queries before they've been reset, which happens at submission time. As we'd need to otherwise run a command queue at init-time, just check if submissions have happened. --- libavutil/vulkan.c | 5 +++++ libavutil/vulkan.h | 1 + 2 files changed, 6 insertions(+) diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index dec8ccad64..5674ec2943 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -456,6 +456,9 @@ VkResult ff_vk_exec_get_query(FFVulkanContext *s, FFVkExecContext *e, int64_t res = 0; VkQueryResultFlags qf = 0; + if (!e->has_query) + return VK_NOT_READY; + qf |= pool->query_64bit ? VK_QUERY_RESULT_64_BIT : 0x0; qf |= pool->query_statuses ? @@ -779,6 +782,8 @@ int ff_vk_exec_submit(FFVulkanContext *s, FFVkExecContext *e) } } + e->has_query = 1; + return 0; } diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h index 25c5ad4b74..3069dd27c2 100644 --- a/libavutil/vulkan.h +++ b/libavutil/vulkan.h @@ -168,6 +168,7 @@ typedef struct FFVkExecContext { void *query_data; int query_idx; + int has_query; /* Buffer dependencies */ AVBufferRef **buf_deps; -- 2.40.1 ------=_Part_113667_1342427752.1698274946463 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_113667_1342427752.1698274946463--