Mesa (master): anv: Reject modifiers on depth/stencil formats

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 13 16:01:43 UTC 2020


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

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Wed Feb 12 10:22:39 2020 -0600

anv: Reject modifiers on depth/stencil formats

6790397346cc added code which attempts to reject modifiers on
depth/stencil formats but it was placed after the early return for depth
and stencil aspects.  This commit moves it up so it actually works.

Of course, this doesn't actually matter because the only user of any of
the modifiers stuff is the WSI code and it will never do anything with
depth/stencil.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3794>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3794>

---

 src/intel/vulkan/anv_formats.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index caf409ea9f3..b5962f13d6c 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -459,6 +459,13 @@ anv_get_format_plane(const struct gen_device_info *devinfo, VkFormat vk_format,
    if (aspect & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
       assert(vk_format_aspects(vk_format) &
              (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT));
+
+      /* There's no reason why we strictly can't support depth or stencil with
+       * modifiers but there's also no reason why we should.
+       */
+      if (tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT)
+         return unsupported;
+
       return plane_format;
    }
 
@@ -480,9 +487,6 @@ anv_get_format_plane(const struct gen_device_info *devinfo, VkFormat vk_format,
       if (!util_is_power_of_two_or_zero(isl_layout->bpb))
          return unsupported;
 
-      if (vk_format_is_depth_or_stencil(vk_format))
-         return unsupported;
-
       if (isl_format_is_compressed(plane_format.isl_format))
          return unsupported;
    }



More information about the mesa-commit mailing list