Mesa (master): tu: Add missing storage image/texel buffer bits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 26 11:33:30 UTC 2020


Module: Mesa
Branch: master
Commit: 3987e25c03d2049b965d6513e4ef6fe7ae93c564
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3987e25c03d2049b965d6513e4ef6fe7ae93c564

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Tue May 19 17:37:26 2020 +0200

tu: Add missing storage image/texel buffer bits

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

---

 src/freedreno/vulkan/tu_formats.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/freedreno/vulkan/tu_formats.c b/src/freedreno/vulkan/tu_formats.c
index 8ecdbdbdc90..a7d2d31bd6d 100644
--- a/src/freedreno/vulkan/tu_formats.c
+++ b/src/freedreno/vulkan/tu_formats.c
@@ -418,6 +418,26 @@ tu_physical_device_get_format_properties(
       optimal |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
                  VK_FORMAT_FEATURE_BLIT_DST_BIT;
 
+      /* IBO's don't have a swap field at all, so swapped formats can't be
+       * supported, even with linear images.
+       *
+       * TODO: See if setting the swap field from the tex descriptor works,
+       * after we enable shaderStorageImageReadWithoutFormat and there are
+       * tests for these formats.
+       */
+      if (native_fmt.swap == WZYX) {
+         optimal |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
+         buffer |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT;
+      }
+
+      /* TODO: The blob also exposes these for R16G16_UINT/R16G16_SINT, but we
+       * don't have any tests for those.
+       */
+      if (format == VK_FORMAT_R32_UINT || format == VK_FORMAT_R32_SINT) {
+         optimal |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT;
+         buffer |= VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT;
+      }
+
       if (vk_format_is_float(format) ||
           vk_format_is_unorm(format) ||
           vk_format_is_snorm(format) ||



More information about the mesa-commit mailing list