The sampler can only decode ASTC surfaces that are Y-tiled. ISL has
been asserting this restriction at surface creation time.
However, some drivers want to create a surface that is only used for
copying compressed data. And during the copy, the surface won't have a
compressed format.
To enable this behavior, we choose to move the tiling assertion to the
moment a surface state is created for the sampler.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13881>
*flags &= ~ISL_TILING_W_BIT;
}
- /* From the SKL+ PRMs, RENDER_SURFACE_STATE:TileMode,
- * If Surface Format is ASTC*, this field must be TILEMODE_YMAJOR.
- */
- if (isl_format_get_layout(info->format)->txc == ISL_TXC_ASTC)
- *flags &= ISL_TILING_Y0_BIT;
-
/* MCS buffers are always Y-tiled */
if (isl_format_get_layout(info->format)->txc == ISL_TXC_MCS)
*flags &= ISL_TILING_Y0_BIT;
#if GFX_VER >= 8
assert(GFX_VER < 12 || info->surf->tiling != ISL_TILING_W);
+
+ /* From the SKL+ PRMs, RENDER_SURFACE_STATE:TileMode,
+ *
+ * If Surface Format is ASTC*, this field must be TILEMODE_YMAJOR.
+ */
+ if (isl_format_get_layout(info->view->format)->txc == ISL_TXC_ASTC)
+ assert(info->surf->tiling == ISL_TILING_Y0);
+
s.TileMode = isl_encode_tiling[info->surf->tiling];
#else
s.TiledSurface = info->surf->tiling != ISL_TILING_LINEAR,