This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit d00b41926a9f3448b5dab89d7074ad7f9ad9f82d
Author:     Lynne <[email protected]>
AuthorDate: Tue Sep 22 13:30:06 2026 +0900
Commit:     Lynne <[email protected]>
CommitDate: Wed Sep 23 00:30:52 2026 +0900

    ffv1enc_vulkan: order inter frames on the GPU
    
    Inter frames carry the slice state from one frame to the next in a
    single buffer, but the execution contexts rotate across the compute
    queues of the device, and nothing ordered one frame's reads and writes
    against the previous frame's. Two frames submitted back to back, as
    after a flush, corrupted each other on RADV.
    
    Wait on the previous frame's execution before an inter frame.
---
 libavcodec/ffv1enc_vulkan.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/ffv1enc_vulkan.c b/libavcodec/ffv1enc_vulkan.c
index 4897f3b236..14f7d2e5dc 100644
--- a/libavcodec/ffv1enc_vulkan.c
+++ b/libavcodec/ffv1enc_vulkan.c
@@ -83,6 +83,8 @@ typedef struct VulkanEncodeFFv1Context {
     /* Slice data buffer pool */
     AVRefStructPool *slice_data_pool;
     FFVkBuffer *keyframe_slice_data_ref;
+    VkSemaphore prev_sem;
+    uint64_t prev_sem_val;
 
     /* Remap data pool */
     AVRefStructPool *remap_data_pool;
@@ -476,6 +478,13 @@ static int vulkan_encode_ffv1_submit_frame(AVCodecContext 
*avctx,
                                      VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
                                      VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT));
 
+    /* Inter frames continue the state the previous frame wrote */
+    if (!f->key_frame)
+        ff_vk_exec_add_dep_wait_sem(&fv->s, exec, fv->prev_sem, 
fv->prev_sem_val,
+                                    VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT);
+    fv->prev_sem     = exec->sem;
+    fv->prev_sem_val = exec->sem_value;
+
     if (fv->optimize_rct || f->remap_mode) {
         /* Prepare the frame for reading */
         ff_vk_frame_barrier(&fv->s, exec, src, img_bar, &nb_img_bar,

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to