From 1addd0fdca14b354d85dc6f002813c015c5ef3cb Mon Sep 17 00:00:00 2001 From: Lynne Date: Thu, 10 Oct 2024 05:24:32 +0200 Subject: [PATCH] vulkan: use correct signed image type for storage images 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 ba79387c6f..724d633bf9 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -2005,8 +2005,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);