summaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-07-08 19:36:33 -0700
committerJason Ekstrand <[email protected]>2016-07-13 11:47:37 -0700
commit33dc8549fb9b227a57a84aac53f17bd099da38f4 (patch)
treedc1e72f24ed24cf3974435ae52360243bb5a53dc /src/intel/isl/isl.c
parentfc3650a0a9eca29a9498f663d489ab729f55f65f (diff)
isl: Add support for HiZ surfaces
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel/isl/isl.c')
-rw-r--r--src/intel/isl/isl.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index aaf4d1c8c77..7df649eff0a 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -167,6 +167,16 @@ isl_tiling_get_info(const struct isl_device *dev,
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 */
@@ -221,6 +231,7 @@ isl_surf_choose_tiling(const struct isl_device *dev,
CHOOSE(ISL_TILING_LINEAR);
}
+ CHOOSE(ISL_TILING_HIZ);
CHOOSE(ISL_TILING_Ys);
CHOOSE(ISL_TILING_Yf);
CHOOSE(ISL_TILING_Y0);
@@ -314,7 +325,8 @@ isl_choose_array_pitch_span(const struct isl_device *dev,
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):
*
@@ -388,6 +400,15 @@ isl_choose_image_alignment_el(const struct isl_device *dev,
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);