From 85d81dcfd6f9548ce89a9cdcc5e3e7547a1b2736 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 22 Feb 2025 19:55:34 +0000 Subject: [PATCH] hwcontext_vulkan: enable read/write without storage BGR formats in Vulkan cannot be used in storage images, as the pixel labels on storage images are always ordered as RGB, and swizzling is not an option due to old hardware limitations. This means that you must always use an RGB format and manually swizzle when reading or writing to BGR images, or simply not use a format in the shader itself. This adds support for the latter. --- libavutil/hwcontext_vulkan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index ec6459712b..11d9e987b0 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -244,6 +244,8 @@ static void device_features_copy_needed(VulkanDeviceFeatures *dst, VulkanDeviceF COPY_VAL(device.features.shaderInt64); COPY_VAL(device.features.shaderInt16); COPY_VAL(device.features.shaderFloat64); + COPY_VAL(device.features.shaderStorageImageReadWithoutFormat); + COPY_VAL(device.features.shaderStorageImageWriteWithoutFormat); COPY_VAL(vulkan_1_1.samplerYcbcrConversion); COPY_VAL(vulkan_1_1.storagePushConstant16);