if (format == ISL_FORMAT_UNSUPPORTED)
format = surf->surf->format;
- if (format == ISL_FORMAT_R24_UNORM_X8_TYPELESS) {
- /* Unfortunately, ISL_FORMAT_R24_UNORM_X8_TYPELESS it isn't supported as
- * a render target, which would prevent us from blitting to 24-bit
- * depth. The miptree consists of 32 bits per pixel, arranged as 24-bit
- * depth values interleaved with 8 "don't care" bits. Since depth
- * values don't require any blending, it doesn't matter how we interpret
- * the bit pattern as long as we copy the right amount of data, so just
- * map it as 8-bit BGRA.
- */
- format = ISL_FORMAT_B8G8R8A8_UNORM;
- }
-
info->surf = *surf->surf;
info->addr = surf->addr;
}
}
+ /* ISL_FORMAT_R24_UNORM_X8_TYPELESS it isn't supported as a render target,
+ * which requires shader math to render to it. Blitting Z24X8 to Z24X8
+ * is fairly common though, so we'd like to avoid it. Since we don't need
+ * to blend depth values, we can simply pick a renderable format with the
+ * right number of bits-per-pixel, like 8-bit BGRA.
+ */
+ if (dst_surf->surf->format == ISL_FORMAT_R24_UNORM_X8_TYPELESS &&
+ src_surf->surf->format == ISL_FORMAT_R24_UNORM_X8_TYPELESS) {
+ src_format = dst_format = ISL_FORMAT_B8G8R8A8_UNORM;
+ }
+
brw_blorp_surface_info_init(batch->blorp, ¶ms.src, src_surf, src_level,
src_layer, src_format, false);
brw_blorp_surface_info_init(batch->blorp, ¶ms.dst, dst_surf, dst_level,