[FFmpeg-devel] [PATCH] vulkan: Don't try to early reuse exec context with query

David Rosca nowrep at gmail.com
Fri Nov 15 22:57:02 EET 2024


It needs to first get the query before the context can be used again.
Fixes getting incorrect values from encode query with async_depth > 1.
---
 libavutil/vulkan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 2c71312d78..8485c54db1 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -489,7 +489,8 @@ FFVkExecContext *ff_vk_exec_get(FFVulkanContext *s, FFVkExecPool *pool)
 
     /* Check if last submission has already finished.
      * If so, don't waste resources and reuse the same buffer. */
-    if (vk->GetFenceStatus(s->hwctx->act_dev, e->fence) == VK_SUCCESS)
+    if (!e->query_data &&
+        vk->GetFenceStatus(s->hwctx->act_dev, e->fence) == VK_SUCCESS)
         return e;
 
     pool->idx = (pool->idx + 1) % pool->pool_size;
-- 
2.47.0



More information about the ffmpeg-devel mailing list