anv/formats: Allow sampling on depth-only formats on gen7
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 4 Aug 2017 02:58:24 +0000 (19:58 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 7 Aug 2017 15:27:09 +0000 (08:27 -0700)
We can't sample from depth-stencil formats but on gen7 but we can sample
from depth-only formats.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102024
Reviewed-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Cc: mesa-stable@lists.freedesktop.org
src/intel/vulkan/anv_formats.c

index c656d7e982867ae3cdcc9362ca2d073271482fda..98085085231855b97d66693ddc51e56e96b372f5 100644 (file)
@@ -395,7 +395,8 @@ anv_physical_device_get_format_properties(struct anv_physical_device *physical_d
       /* Nothing to do here */
    } else if (vk_format_is_depth_or_stencil(format)) {
       tiled |= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT;
-      if (physical_device->info.gen >= 8)
+      if (vk_format_aspects(format) == VK_IMAGE_ASPECT_DEPTH_BIT ||
+          physical_device->info.gen >= 8)
          tiled |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
 
       tiled |= VK_FORMAT_FEATURE_BLIT_SRC_BIT |