[FFmpeg-devel] [PATCH] vulkan: use correct signed image type for storage images

Lynne dev at lynne.ee
Thu Oct 10 06:26:49 EEST 2024


Using signed or unsigned integer formats/layouts requires that
"uimage" or "iimage" are used.
---
 libavutil/vulkan.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 7dbd3fa573..856567795b 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -2018,8 +2018,21 @@ print:
         if (prop->mem_quali && desc[i].mem_quali)
             GLSLA(" %s", desc[i].mem_quali);
 
-        if (prop->type)
-            GLSLA(" %s", prop->type);
+        if (prop->type) {
+            GLSLA(" ");
+            if (desc[i].type == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE) {
+                if (desc[i].mem_layout) {
+                    int len = strlen(desc[i].mem_layout);
+                    if (desc[i].mem_layout[len - 1] == 'i' &&
+                        desc[i].mem_layout[len - 2] == 'u') {
+                        GLSLA("u");
+                    } else if (desc[i].mem_layout[len - 1] == 'i') {
+                        GLSLA("i");
+                    }
+                }
+            }
+            GLSLA("%s", prop->type);
+        }
 
         if (prop->dim_needed)
             GLSLA("%iD", desc[i].dimensions);
-- 
2.45.2.753.g447d99e1c3b


More information about the ffmpeg-devel mailing list