This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit a2475d16edde35aa93ea306311887ac648890851 Author: averne <[email protected]> AuthorDate: Sun Dec 14 23:01:45 2025 +0100 Commit: Lynne <[email protected]> CommitDate: Mon Dec 15 12:29:00 2025 +0000 lavc/vulkan/common: allow configurable bitstream caching in shared memory --- libavcodec/vulkan/common.comp | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/libavcodec/vulkan/common.comp b/libavcodec/vulkan/common.comp index d50e629f06..77839d6758 100644 --- a/libavcodec/vulkan/common.comp +++ b/libavcodec/vulkan/common.comp @@ -229,13 +229,15 @@ struct GetBitContext { gb.bits_valid += 32; \ } #else /* GET_BITS_SMEM */ -shared u32vec4 gb_storage[gl_WorkGroupSize.x*gl_WorkGroupSize.y*gl_WorkGroupSize.z]; - -#define FILL_SMEM() \ - { \ - u32vec4buf ptr = u32vec4buf(gb.buf); \ - gb_storage[gl_LocalInvocationIndex] = ptr[0].v; \ - gb.cur_smem_pos = 0; \ +shared u32vec4 gb_storage[gl_WorkGroupSize.x*gl_WorkGroupSize.y*gl_WorkGroupSize.z*GET_BITS_SMEM]; + +#define FILL_SMEM() \ + { \ + u32vec4buf ptr = u32vec4buf(gb.buf); \ + [[unroll]] \ + for (uint i = 0; i < GET_BITS_SMEM; ++i) \ + gb_storage[gl_LocalInvocationIndex * GET_BITS_SMEM + i] = ptr[i].v; \ + gb.cur_smem_pos = 0; \ } #define LOAD64() \ @@ -251,15 +253,16 @@ shared u32vec4 gb_storage[gl_WorkGroupSize.x*gl_WorkGroupSize.y*gl_WorkGroupSize FILL_SMEM(); \ } -#define RELOAD32() \ - { \ - if (gb.cur_smem_pos >= 4) \ - FILL_SMEM(); \ - uint v = gb_storage[gl_LocalInvocationIndex][gb.cur_smem_pos]; \ - gb.buf += 4; \ - gb.bits = uint64_t(reverse4(v)) << (32 - gb.bits_valid) | gb.bits; \ - gb.bits_valid += 32; \ - gb.cur_smem_pos += 1; \ +#define RELOAD32() \ + { \ + if (gb.cur_smem_pos >= 4*GET_BITS_SMEM) \ + FILL_SMEM(); \ + u32vec4 vec = gb_storage[gl_LocalInvocationIndex * GET_BITS_SMEM + (gb.cur_smem_pos >> 2)]; \ + uint v = vec[gb.cur_smem_pos & 3]; \ + gb.buf += 4; \ + gb.bits = uint64_t(reverse4(v)) << (32 - gb.bits_valid) | gb.bits; \ + gb.bits_valid += 32; \ + gb.cur_smem_pos += 1; \ } #endif /* GET_BITS_SMEM */ _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
