Mesa (main): radv: expose disjoint image support

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 26 20:13:07 UTC 2022


Module: Mesa
Branch: main
Commit: 1c065650260dadf9c9a981f156459c7f4ce0a007
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1c065650260dadf9c9a981f156459c7f4ce0a007

Author: Benjamin Cheng <ben at bcheng.me>
Date:   Fri May 13 21:24:12 2022 -0400

radv: expose disjoint image support

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16510>

---

 src/amd/vulkan/radv_formats.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
index 05e4c4fabfe..bef8df6d97a 100644
--- a/src/amd/vulkan/radv_formats.c
+++ b/src/amd/vulkan/radv_formats.c
@@ -713,7 +713,8 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
       return;
    }
 
-   if (vk_format_get_plane_count(format) > 1 || desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
+   const bool multiplanar = vk_format_get_plane_count(format) > 1;
+   if (multiplanar || desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
       uint64_t tiling = VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT |
                         VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT |
                         VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT |
@@ -725,6 +726,9 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
          tiling |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT;
       }
 
+      if (multiplanar)
+         tiling |= VK_FORMAT_FEATURE_2_DISJOINT_BIT;
+
       /* Fails for unknown reasons with linear tiling & subsampled formats. */
       out_properties->linearTilingFeatures =
          desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED ? 0 : tiling;
@@ -1208,6 +1212,9 @@ radv_get_modifier_flags(struct radv_physical_device *dev, VkFormat format, uint6
    else
       features = props->optimalTilingFeatures;
 
+   /* Unconditionally disable DISJOINT support for modifiers for now */
+   features &= ~VK_FORMAT_FEATURE_2_DISJOINT_BIT;
+
    if (ac_modifier_has_dcc(modifier)) {
       /* Only disable support for STORAGE_IMAGE on modifiers that
        * do not support DCC image stores.



More information about the mesa-commit mailing list