break;
}
+ case ISL_TILING_HIZ:
+ /* HiZ buffers are required to have ISL_FORMAT_HIZ which is an 8x4
+ * 128bpb format. The tiling has the same physical dimensions as
+ * Y-tiling but actually has two HiZ columns per Y-tiled column.
+ */
+ assert(bs == 16);
+ logical_el = isl_extent2d(16, 16);
+ phys_B = isl_extent2d(128, 32);
+ break;
+
default:
unreachable("not reached");
} /* end switch */
CHOOSE(ISL_TILING_LINEAR);
}
+ CHOOSE(ISL_TILING_HIZ);
CHOOSE(ISL_TILING_Ys);
CHOOSE(ISL_TILING_Yf);
CHOOSE(ISL_TILING_Y0);
return ISL_ARRAY_PITCH_SPAN_COMPACT;
}
- if (isl_surf_usage_is_depth_or_stencil(info->usage)) {
+ if (isl_surf_usage_is_depth_or_stencil(info->usage) ||
+ (info->usage & ISL_SURF_USAGE_HIZ_BIT)) {
/* From the Ivybridge PRM >> Volume 1 Part 1: Graphics Core >>
* Section 6.18.4.7: Surface Arrays (p112):
*
enum isl_msaa_layout msaa_layout,
struct isl_extent3d *image_align_el)
{
+ if (info->format == ISL_FORMAT_HIZ) {
+ assert(ISL_DEV_GEN(dev) >= 6);
+ /* HiZ surfaces are always aligned to 16x8 pixels in the primary surface
+ * which works out to 2x2 HiZ elments.
+ */
+ *image_align_el = isl_extent3d(2, 2, 1);
+ return;
+ }
+
if (ISL_DEV_GEN(dev) >= 9) {
gen9_choose_image_alignment_el(dev, info, tiling, msaa_layout,
image_align_el);
ISL_FORMAT_ASTC_LDR_2D_12X10_FLT16 = 638,
ISL_FORMAT_ASTC_LDR_2D_12X12_FLT16 = 639,
+ /* The formats that follow are internal to ISL and as such don't have an
+ * explicit number. We'll just let the C compiler assign it for us. Any
+ * actual hardware formats *must* come before these in the list.
+ */
+
+ /* Formats for color compression surfaces */
+ ISL_FORMAT_HIZ,
+
/* Hardware doesn't understand this out-of-band value */
ISL_FORMAT_UNSUPPORTED = UINT16_MAX,
};
ISL_TXC_ETC1,
ISL_TXC_ETC2,
ISL_TXC_ASTC,
+
+ /* Used for auxiliary surface formats */
+ ISL_TXC_HIZ,
};
/**
ISL_TILING_Y0, /**< Legacy Y tiling */
ISL_TILING_Yf, /**< Standard 4K tiling. The 'f' means "four". */
ISL_TILING_Ys, /**< Standard 64K tiling. The 's' means "sixty-four". */
+ ISL_TILING_HIZ, /**< Tiling format for HiZ surfaces */
};
/**
#define ISL_TILING_Y0_BIT (1u << ISL_TILING_Y0)
#define ISL_TILING_Yf_BIT (1u << ISL_TILING_Yf)
#define ISL_TILING_Ys_BIT (1u << ISL_TILING_Ys)
+#define ISL_TILING_HIZ_BIT (1u << ISL_TILING_HIZ)
#define ISL_TILING_ANY_MASK (~0u)
#define ISL_TILING_NON_LINEAR_MASK (~ISL_TILING_LINEAR_BIT)
#define ISL_SURF_USAGE_DISPLAY_FLIP_X_BIT (1u << 10)
#define ISL_SURF_USAGE_DISPLAY_FLIP_Y_BIT (1u << 11)
#define ISL_SURF_USAGE_STORAGE_BIT (1u << 12)
+#define ISL_SURF_USAGE_HIZ_BIT (1u << 13)
/** @} */
/**
case ISL_TXC_ETC2:
case ISL_TXC_ASTC:
return false;
+
+ case ISL_TXC_HIZ:
+ unreachable("Should not be called on an aux surface");
}
unreachable("bad texture compression mode");
ASTC_LDR_2D_10X10_FLT16 , 128, 10, 10, 1, sf16, sf16, sf16, sf16, , , , linear, astc
ASTC_LDR_2D_12X10_FLT16 , 128, 12, 10, 1, sf16, sf16, sf16, sf16, , , , linear, astc
ASTC_LDR_2D_12X12_FLT16 , 128, 12, 12, 1, sf16, sf16, sf16, sf16, , , , linear, astc
+HIZ , 128, 8, 4, 1, , , , , , , , , hiz
enum isl_msaa_layout msaa_layout,
struct isl_extent3d *image_align_el)
{
+ /* Handled by isl_choose_image_alignment_el */
+ assert(info->format != ISL_FORMAT_HIZ);
+
/* Note that the surface's horizontal image alignment is not programmable
* on Sandybridge.
*
* In the table above, MSFMT_MSS refers to ISL_MSAA_LAYOUT_ARRAY, and
* MSFMT_DEPTH_STENCIL refers to ISL_MSAA_LAYOUT_INTERLEAVED.
*/
- if (isl_surf_usage_is_depth_or_stencil(info->usage))
+ if (isl_surf_usage_is_depth_or_stencil(info->usage) ||
+ (info->usage & ISL_SURF_USAGE_HIZ_BIT))
require_interleaved = true;
/* From the Ivybridge PRM, Volume 4 Part 1 p72, SURFACE_STATE, Multisampled
*flags &= ~ISL_TILING_W_BIT;
}
+ /* The HiZ format and tiling always go together */
+ if (info->format == ISL_FORMAT_HIZ) {
+ *flags &= ISL_TILING_HIZ_BIT;
+ } else {
+ *flags &= ~ISL_TILING_HIZ_BIT;
+ }
+
if (info->usage & (ISL_SURF_USAGE_DISPLAY_ROTATE_90_BIT |
ISL_SURF_USAGE_DISPLAY_ROTATE_180_BIT |
ISL_SURF_USAGE_DISPLAY_ROTATE_270_BIT)) {
enum isl_msaa_layout msaa_layout,
struct isl_extent3d *image_align_el)
{
+ /* Handled by isl_choose_image_alignment_el */
+ assert(info->format != ISL_FORMAT_HIZ);
+
/* IVB+ does not support combined depthstencil. */
assert(!isl_surf_usage_is_depth_and_stencil(info->usage));
if (isl_format_is_yuv(info->format))
return false;
- if (isl_surf_usage_is_depth_or_stencil(info->usage))
+ if (isl_surf_usage_is_depth_or_stencil(info->usage) ||
+ (info->usage & ISL_SURF_USAGE_HIZ_BIT))
require_interleaved = true;
if (require_array && require_interleaved)
enum isl_msaa_layout msaa_layout,
struct isl_extent3d *image_align_el)
{
+ /* Handled by isl_choose_image_alignment_el */
+ assert(info->format != ISL_FORMAT_HIZ);
+
assert(!isl_tiling_is_std_y(tiling));
/* The below text from the Broadwell PRM provides some insight into the
enum isl_msaa_layout msaa_layout,
struct isl_extent3d *image_align_el)
{
+ /* Handled by isl_choose_image_alignment_el */
+ assert(info->format != ISL_FORMAT_HIZ);
+
/* This BSpec text provides some insight into the hardware's alignment
* requirements [Skylake BSpec > Memory Views > Common Surface Formats >
* Surface Layout and Tiling > 2D Surfaces]: