From dda149c053291bef3a2792ebba1a4b774ae76850 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:11:50 -0600 Subject: [PATCH] nvk: Better advertise image format features We now advertise the top-level features and we don't falsely claim write-without-format support per-format. In theory, NV hardware should be able to do shaderStorageImageReadWithoutFormat but codegen doesn't know how yet. Part-of: --- src/nouveau/vulkan/nvk_image.c | 1 - src/nouveau/vulkan/nvk_physical_device.c | 2 ++ src/nouveau/vulkan/nvk_shader.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nouveau/vulkan/nvk_image.c b/src/nouveau/vulkan/nvk_image.c index 4873d984cb9..869d18c0965 100644 --- a/src/nouveau/vulkan/nvk_image.c +++ b/src/nouveau/vulkan/nvk_image.c @@ -36,7 +36,6 @@ nvk_get_image_format_features(struct nvk_physical_device *pdevice, if (nvk_is_storage_image_format(vk_format)) { features |= VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT | - VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT | VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT; } diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index 9bfb1a5588c..7825031a7c1 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -32,6 +32,8 @@ nvk_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, pFeatures->features = (VkPhysicalDeviceFeatures) { .robustBufferAccess = true, /* More features */ + .shaderStorageImageExtendedFormats = true, + .shaderStorageImageWriteWithoutFormat = true, }; VkPhysicalDeviceVulkan11Features core_1_1 = { diff --git a/src/nouveau/vulkan/nvk_shader.c b/src/nouveau/vulkan/nvk_shader.c index 8706a356646..7569342a5a9 100644 --- a/src/nouveau/vulkan/nvk_shader.c +++ b/src/nouveau/vulkan/nvk_shader.c @@ -89,6 +89,7 @@ nvk_shader_compile_to_nir(struct nvk_device *device, const struct spirv_to_nir_options spirv_options = { .caps = { + .image_write_without_format = true, }, .ssbo_addr_format = nir_address_format_64bit_global_32bit_offset, .ubo_addr_format = nir_address_format_64bit_global_32bit_offset,