#if GEN_GEN >= 7 && GEN_GEN < 12
db.StencilWriteEnable = true;
#endif
-#if GEN_GEN >= 8 || GEN_IS_HASWELL
+#if GEN_GEN >= 12
+ sb.StencilWriteEnable = true;
+ sb.SurfaceType = SURFTYPE_2D;
+ sb.Width = info->stencil_surf->logical_level0_px.width - 1;
+ sb.Height = info->stencil_surf->logical_level0_px.height - 1;
+ sb.Depth = sb.RenderTargetViewExtent = info->view->array_len - 1;
+ sb.SurfLOD = info->view->base_level;
+ sb.MinimumArrayElement = info->view->base_array_layer;
+#elif GEN_GEN >= 8 || GEN_IS_HASWELL
sb.StencilBufferEnable = true;
#endif
sb.SurfaceBaseAddress = info->stencil_address;
#if GEN_GEN >= 8
sb.SurfaceQPitch =
isl_surf_get_array_pitch_el_rows(info->stencil_surf) >> 2;
+#endif
+ } else {
+#if GEN_GEN >= 12
+ sb.SurfaceType = SURFTYPE_NULL;
+
+ /* The docs seem to indicate that if surf-type is null, then we may need
+ * to match the depth-buffer value for `Depth`. It may be a
+ * documentation bug, since the other fields don't require this.
+ *
+ * TODO: Confirm documentation and remove seeting of `Depth` if not
+ * required.
+ */
+ sb.Depth = db.Depth;
#endif
}