[FFmpeg-cvslog] vulkan: add .buf_elems to FFVulkanDescriptorSet

Lynne git at videolan.org
Fri Feb 21 04:20:08 EET 2025


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Fri Feb 21 00:46:52 2025 +0000| [f774a9376af2ec46aed5e7ac1c317c1c4a3d7823] | committer: Lynne

vulkan: add .buf_elems to FFVulkanDescriptorSet

This enables users to specify a number that would be appended to
the buf_content string.
Saves users from needing to manually print to a string.

An earlier commit tried doing this via .elems, but it was
faulty, as this also incremented the total number of descriptors
in the descriptor set.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f774a9376af2ec46aed5e7ac1c317c1c4a3d7823
---

 libavutil/vulkan.c | 4 ++--
 libavutil/vulkan.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index c8ec53ea76..31610e2d94 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -2190,9 +2190,9 @@ print:
 
         if (prop->buf_content) {
             GLSLA(" {\n    ");
-            if (desc[i].elems) {
+            if (desc[i].buf_elems) {
                 GLSLA("%s", desc[i].buf_content);
-                GLSLA("[%i];", desc[i].elems);
+                GLSLA("[%i];", desc[i].buf_elems);
             } else {
                 GLSLA("%s", desc[i].buf_content);
             }
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h
index 41f71df376..8690c13b3d 100644
--- a/libavutil/vulkan.h
+++ b/libavutil/vulkan.h
@@ -81,6 +81,7 @@ typedef struct FFVulkanDescriptorSetBinding {
     uint32_t            dimensions;  /* Needed for e.g. sampler%iD */
     uint32_t            elems;       /* 0 - scalar, 1 or more - vector */
     VkShaderStageFlags  stages;
+    uint32_t            buf_elems;   /* Appends [buf_elems] to the contents. Avoids manually printing to a string. */
     VkSampler           samplers[4]; /* Sampler to use for all elems */
 } FFVulkanDescriptorSetBinding;
 



More information about the ffmpeg-cvslog mailing list