summaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl_surface_state.c
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2016-12-05 15:24:28 -0800
committerNanley Chery <[email protected]>2017-01-12 20:52:20 -0800
commitbcf880a9c89622bc7ab48da652eae4549207e6e8 (patch)
treec9e367adaf0d8d775c62912751cf0f38d2b21e61 /src/intel/isl/isl_surface_state.c
parent58af6156360a309578241acba949e540acf72cb1 (diff)
isl/surface_state: Handle ISL_AUX_USAGE_HIZ
v2: Remove redundant x/y offset asserts (Jason Ekstrand) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/isl/isl_surface_state.c')
-rw-r--r--src/intel/isl/isl_surface_state.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index b9093cc9513..b7354781cf0 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -520,6 +520,26 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
s.AuxiliarySurfaceQPitch =
isl_surf_get_array_pitch_sa_rows(info->aux_surf) >> 2;
s.AuxiliarySurfaceBaseAddress = info->aux_address;
+
+ if (info->aux_usage == ISL_AUX_USAGE_HIZ) {
+ /* The number of samples must be 1 */
+ assert(info->surf->samples == 1);
+
+ /* The dimension must not be 3D */
+ assert(info->surf->dim != ISL_SURF_DIM_3D);
+
+ /* The format must be one of the following: */
+ switch (info->view->format) {
+ case ISL_FORMAT_R32_FLOAT:
+ case ISL_FORMAT_R24_UNORM_X8_TYPELESS:
+ case ISL_FORMAT_R16_UNORM:
+ break;
+ default:
+ assert(!"Incompatible HiZ Sampling format");
+ break;
+ }
+ }
+
s.AuxiliarySurfaceMode = isl_to_gen_aux_mode[info->aux_usage];
#else
assert(info->aux_usage == ISL_AUX_USAGE_MCS ||
@@ -548,6 +568,15 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
s.SamplerL2BypassModeDisable = true;
break;
default:
+ /* From the SKL PRM, Programming Note under Sampler Output Channel
+ * Mapping:
+ *
+ * If a surface has an associated HiZ Auxilliary surface, the
+ * Sampler L2 Bypass Mode Disable field in the RENDER_SURFACE_STATE
+ * must be set.
+ */
+ if (GEN_GEN >= 9 && info->aux_usage == ISL_AUX_USAGE_HIZ)
+ s.SamplerL2BypassModeDisable = true;
break;
}
}