* [FFmpeg-devel] [PATCH] vulkan: return VK_NOT_READY when no queries are available
@ 2023-10-25 23:02 Lynne
0 siblings, 0 replies; only message in thread
From: Lynne @ 2023-10-25 23:02 UTC (permalink / raw)
To: Ffmpeg Devel
[-- Attachment #1: Type: text/plain, Size: 340 bytes --]
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.
[-- Attachment #2: 0001-vulkan-return-VK_NOT_READY-when-no-queries-are-avail.patch --]
[-- Type: text/x-diff, Size: 1554 bytes --]
From 833a1c249f5e41305fe8ea68f5e2453a5505817d Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
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
[-- Attachment #3: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-10-25 23:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25 23:02 [FFmpeg-devel] [PATCH] vulkan: return VK_NOT_READY when no queries are available Lynne
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