diff options
author | Jason Ekstrand <[email protected]> | 2017-06-05 11:52:32 -0700 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-06-14 10:40:22 +0100 |
commit | 3a193c009b0944438d2a965f88e6344e7ac750d8 (patch) | |
tree | d3302f9696d2590ec699d4266a8f0b23b77d2b49 /src/mesa | |
parent | 4889bb6af3869d7363fb1993d3735f086be249dd (diff) |
i965: Perform HiZ flush/stall prior to HiZ resolves
Cc: "17.1" <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
(cherry picked from commit acbd02450bfd53f61bbe468a6f0e8bf5e4507095)
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c index 39d20ac0032..e09a0fcdb53 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.c +++ b/src/mesa/drivers/dri/i965/brw_blorp.c @@ -1070,7 +1070,12 @@ intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt, DBG("%s %s to mt %p level %d layers %d-%d\n", __func__, opname, mt, level, start_layer, start_layer + num_layers - 1); - if (op == BLORP_HIZ_OP_DEPTH_CLEAR) { + /* The following stalls and flushes are only documented to be required for + * HiZ clear operations. However, they also seem to be required for the + * HiZ resolve operation which is basically the same as a fast clear only a + * different value is written into the HiZ surface. + */ + if (op == BLORP_HIZ_OP_DEPTH_CLEAR || op == BLORP_HIZ_OP_HIZ_RESOLVE) { if (brw->gen == 6) { /* From the Sandy Bridge PRM, volume 2 part 1, page 313: * @@ -1121,18 +1126,26 @@ intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt, gen6_blorp_hiz_exec(brw, mt, level, start_layer + a, op); } - if (brw->gen == 6 && op == BLORP_HIZ_OP_DEPTH_CLEAR) { - /* From the Sandy Bridge PRM, volume 2 part 1, page 314: - * - * "DevSNB, DevSNB-B{W/A}]: Depth buffer clear pass must be followed - * by a PIPE_CONTROL command with DEPTH_STALL bit set and Then - * followed by Depth FLUSH' - */ - brw_emit_pipe_control_flush(brw, - PIPE_CONTROL_DEPTH_STALL); - brw_emit_pipe_control_flush(brw, - PIPE_CONTROL_DEPTH_CACHE_FLUSH | - PIPE_CONTROL_CS_STALL); + /* The following stalls and flushes are only documented to be required for + * HiZ clear operations. However, they also seem to be required for the + * HiZ resolve operation which is basically the same as a fast clear only a + * different value is written into the HiZ surface. + */ + if (op == BLORP_HIZ_OP_DEPTH_CLEAR || op == BLORP_HIZ_OP_HIZ_RESOLVE) { + if (brw->gen == 6) { + /* From the Sandy Bridge PRM, volume 2 part 1, page 314: + * + * "DevSNB, DevSNB-B{W/A}]: Depth buffer clear pass must be + * followed by a PIPE_CONTROL command with DEPTH_STALL bit set + * and Then followed by Depth FLUSH' + */ + brw_emit_pipe_control_flush(brw, + PIPE_CONTROL_DEPTH_STALL); + + brw_emit_pipe_control_flush(brw, + PIPE_CONTROL_DEPTH_CACHE_FLUSH | + PIPE_CONTROL_CS_STALL); + } } } |