Skip to content
Snippets Groups Projects
Commit 73a9f31b authored by Nanley Chery's avatar Nanley Chery Committed by Dylan Baker
Browse files

intel/blorp: Disable depth testing for slow depth clears


We'll start doing slow depth clears more often on HIZ_CCS buffers in a
future commit. Reduce the performance impact by making them use less
bandwidth.

From the Depth Test section of the BSpec:

   This function is enabled by the Depth Test Enable state variable. If
   enabled, the pixel's ("source") depth value is first computed. After
   computation the pixel's depth value is clamped to the range defined
   by Minimum Depth and Maximum Depth in the selected CC_VIEWPORT state.
   Then the current ("destination") depth buffer value for this pixel is
   read.

and from the Depth Buffer Updates section of the BSpec:

   If depth testing is disabled or the depth test passed, the incoming
   pixel's depth value is written to the Depth Buffer.

Taken together, it's clear that depth testing isn't necessary to perform
a depth buffer clear. Mark Janes and I analyzed this patch with
frameretrace and a depthrange piglit test. I disabled HiZ to ensure we'd
get slow depth clears. We've observed the bandwidth consumption by the
depth buffer access to be cut ~50% on BDW and SKL during depth clears.
On a more graphically intensive workload, the Shadowmapping Sascha
benchmark, I took the average of 3 runs on a BDW with a display
resolution of about 1920x1200 (minus some desktop environment
decorations). I measured a 22.61% FPS improvement when HiZ is disabled.

v2. The BSpec doesn't mandate this behavior, update comment accordingly.
    (Ken)

Fixes: bc4bb5a7 ("intel/blorp: Emit more complete DEPTH_STENCIL state")
Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d5fb9ccc)
parent d8847c2f
No related branches found
No related tags found
No related merge requests found
...@@ -1111,11 +1111,6 @@ blorp_emit_depth_stencil_state(struct blorp_batch *batch, ...@@ -1111,11 +1111,6 @@ blorp_emit_depth_stencil_state(struct blorp_batch *batch,
ds.DepthBufferWriteEnable = true; ds.DepthBufferWriteEnable = true;
switch (params->hiz_op) { switch (params->hiz_op) {
case ISL_AUX_OP_NONE:
ds.DepthTestEnable = true;
ds.DepthTestFunction = COMPAREFUNCTION_ALWAYS;
break;
/* See the following sections of the Sandy Bridge PRM, Volume 2, Part1: /* See the following sections of the Sandy Bridge PRM, Volume 2, Part1:
* - 7.5.3.1 Depth Buffer Clear * - 7.5.3.1 Depth Buffer Clear
* - 7.5.3.2 Depth Buffer Resolve * - 7.5.3.2 Depth Buffer Resolve
...@@ -1126,6 +1121,7 @@ blorp_emit_depth_stencil_state(struct blorp_batch *batch, ...@@ -1126,6 +1121,7 @@ blorp_emit_depth_stencil_state(struct blorp_batch *batch,
ds.DepthTestFunction = COMPAREFUNCTION_NEVER; ds.DepthTestFunction = COMPAREFUNCTION_NEVER;
break; break;
case ISL_AUX_OP_NONE:
case ISL_AUX_OP_FAST_CLEAR: case ISL_AUX_OP_FAST_CLEAR:
case ISL_AUX_OP_AMBIGUATE: case ISL_AUX_OP_AMBIGUATE:
ds.DepthTestEnable = false; ds.DepthTestEnable = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment