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

Git pushed a commit to branch master
in repository ffmpeg.

commit b19707103e0364f4755f7af78bf0434a59d7132f
Author:     Lynne <[email protected]>
AuthorDate: Sat Feb 14 16:37:25 2026 +0100
Commit:     Lynne <[email protected]>
CommitDate: Thu Feb 19 19:42:34 2026 +0100

    ffv1enc_vulkan: allocate a device-only output buffer if possible
    
    This avoids needing to map HUGE 4GiB chunks of memory.
---
 libavcodec/ffv1enc_vulkan.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/libavcodec/ffv1enc_vulkan.c b/libavcodec/ffv1enc_vulkan.c
index b779813caf..b836bbf0fa 100644
--- a/libavcodec/ffv1enc_vulkan.c
+++ b/libavcodec/ffv1enc_vulkan.c
@@ -237,16 +237,23 @@ static int vulkan_encode_ffv1_submit_frame(AVCodecContext 
*avctx,
     maxsize = FFMIN(maxsize, fv->s.props_11.maxMemoryAllocationSize);
 
     /* Allocate output buffer */
+    VkMemoryPropertyFlagBits out_buf_flags;
+    if (maxsize < fv->max_heap_size) {
+        out_buf_flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+        /* If we can't map host memory, we can't let the GPU copy its buffer. 
*/
+        if (!fv->s.extensions & FF_VK_EXT_EXTERNAL_HOST_MEMORY)
+            out_buf_flags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+    } else {
+        out_buf_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
+                        fv->s.host_cached_flag;
+    }
+
     RET(ff_vk_get_pooled_buffer(&fv->s, &fv->out_data_pool,
                                 &fd->out_data_ref,
                                 VK_BUFFER_USAGE_TRANSFER_SRC_BIT |
                                 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
                                 VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT,
-                                NULL, maxsize,
-                                VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
-                                (maxsize < fv->max_heap_size ?
-                                 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT :
-                                 fv->s.host_cached_flag)));
+                                NULL, maxsize, out_buf_flags));
     out_data_buf = (FFVkBuffer *)fd->out_data_ref->data;
 
     /* Image views */

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to