nvk: Disable shaderStorageImageReadWithoutFormat pre-Maxwell.
authorEmma Anholt <emma@anholt.net>
Tue, 18 Jul 2023 18:37:14 +0000 (11:37 -0700)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Aug 2023 21:32:07 +0000 (21:32 +0000)
On Kepler and earlier, image loads must get lowered based on the declared
format, since we don't have a SULDP op.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

src/nouveau/vulkan/nvk_image.c
src/nouveau/vulkan/nvk_physical_device.c

index e218def..91523ce 100644 (file)
@@ -8,6 +8,7 @@
 #include "nil_format.h"
 #include "vulkan/util/vk_format.h"
 
+#include "clb097.h"
 #include "clb197.h"
 
 VkFormatFeatureFlags2
@@ -62,8 +63,9 @@ nvk_get_image_format_features(struct nvk_physical_device *pdev,
 
    if (nil_format_supports_storage(&pdev->info, p_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;
+      if (pdev->info.cls_eng3d >= MAXWELL_A)
+         features |= VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT;
    }
 
    if (p_format == PIPE_FORMAT_R32_UINT || p_format == PIPE_FORMAT_R32_SINT)
index 5d4f7c8..efe43bb 100644 (file)
@@ -22,6 +22,7 @@
 #include "cla097.h"
 #include "cla0c0.h"
 #include "cla1c0.h"
+#include "clb097.h"
 #include "clb0c0.h"
 #include "clb197.h"
 #include "clb1c0.h"
@@ -438,7 +439,7 @@ nvk_get_device_features(const struct nv_device_info *info,
       .shaderImageGatherExtended = true,
       .shaderStorageImageExtendedFormats = true,
       /* TODO: shaderStorageImageMultisample */
-      .shaderStorageImageReadWithoutFormat = true,
+      .shaderStorageImageReadWithoutFormat = info->cls_eng3d >= MAXWELL_A,
       .shaderStorageImageWriteWithoutFormat = true,
       .shaderUniformBufferArrayDynamicIndexing = true,
       .shaderSampledImageArrayDynamicIndexing = true,