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

Git pushed a commit to branch master
in repository ffmpeg.

commit e99556134446a7672915a82c6a6a425eb875f908
Author:     Lynne <[email protected]>
AuthorDate: Wed Sep 9 01:09:50 2026 +0900
Commit:     Lynne <[email protected]>
CommitDate: Sun Sep 20 17:19:16 2026 +0900

    vulkan_prores_raw: pick the bitstream prefetch depth per device
    
    With the packet host-mapped, the decode shader is bound by fetch
    latency over the bus: 5.49 ms per frame for the VLD alone, versus
    0.21 ms from a device-local buffer.
    
    Make GET_BITS_SMEM a specialization constant: 64 lines (1 KB) per
    invocation on discrete GPUs reading host-mapped packets, 4 otherwise.
    Integrated GPUs get slower with every extra line.
    
    5.7K ProRes RAW on an RX 6900 XT: 145 -> 249 fps (non-HQ), 98 -> 154
    fps (HQ), bit-identical output. Intel Iris Xe unchanged.
---
 libavcodec/vulkan/prores_raw_decode.comp.glsl |  4 +++-
 libavcodec/vulkan_prores_raw.c                | 10 +++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vulkan/prores_raw_decode.comp.glsl 
b/libavcodec/vulkan/prores_raw_decode.comp.glsl
index a5b9c7b04c..8dd074d549 100644
--- a/libavcodec/vulkan/prores_raw_decode.comp.glsl
+++ b/libavcodec/vulkan/prores_raw_decode.comp.glsl
@@ -23,7 +23,9 @@
 #pragma shader_stage(compute)
 #extension GL_GOOGLE_include_directive : require
 
-#define GET_BITS_SMEM 4
+/* Bitstream prefetch depth in 16-byte lines, set by the host */
+layout (constant_id = 0) const uint smem_lines = 4;
+#define GET_BITS_SMEM smem_lines
 #include "common.glsl"
 
 struct TileData {
diff --git a/libavcodec/vulkan_prores_raw.c b/libavcodec/vulkan_prores_raw.c
index a19a089947..b93b21ad1e 100644
--- a/libavcodec/vulkan_prores_raw.c
+++ b/libavcodec/vulkan_prores_raw.c
@@ -306,9 +306,17 @@ static int init_decode_shader(AVCodecContext *avctx, 
FFVulkanContext *s,
 {
     int err;
 
+    /* Discrete GPUs read host-mapped packets over the bus; prefetch more
+     * to hide the latency. Integrated GPUs would only lose shared memory. */
+    int deep_prefetch = s->props.properties.deviceType ==
+                        VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU &&
+                        (s->extensions & FF_VK_EXT_EXTERNAL_HOST_MEMORY);
+    SPEC_LIST_CREATE(sl, 1, sizeof(uint32_t))
+    SPEC_LIST_ADD(sl, 0, 32, deep_prefetch ? 64 : 4);
+
     ff_vk_shader_add_push_const(shd, 0, offsetof(DecodePushData, qmat),
                                 VK_SHADER_STAGE_COMPUTE_BIT);
-    ff_vk_shader_load(shd, VK_SHADER_STAGE_COMPUTE_BIT, NULL,
+    ff_vk_shader_load(shd, VK_SHADER_STAGE_COMPUTE_BIT, sl,
                       (uint32_t []) { 1, 4, 1 }, 0);
 
     add_desc(avctx, s, shd);

-- 
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