anv/formats: Disallow 1D compressed textures
authorNanley Chery <nanley.g.chery@intel.com>
Thu, 22 Sep 2016 23:44:19 +0000 (16:44 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Thu, 3 Nov 2016 18:22:58 +0000 (11:22 -0700)
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_formats.c

index f691554..1b8b881 100644 (file)
@@ -507,6 +507,17 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
       break;
    }
 
+   /* Our hardware doesn't support 1D compressed textures.
+    *    From the SKL PRM, RENDER_SURFACE_STATE::SurfaceFormat:
+    *    * This field cannot be a compressed (BC*, DXT*, FXT*, ETC*, EAC*) format
+    *       if the Surface Type is SURFTYPE_1D.
+    *    * This field cannot be ASTC format if the Surface Type is SURFTYPE_1D.
+    */
+   if (type == VK_IMAGE_TYPE_1D &&
+       isl_format_is_compressed(anv_formats[format].isl_format)) {
+       goto unsupported;
+   }
+
    if (tiling == VK_IMAGE_TILING_OPTIMAL &&
        type == VK_IMAGE_TYPE_2D &&
        (format_feature_flags & (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |