anv/cmd_buffer: Manage Anv state around HZ op emission
authorNanley Chery <nanley.g.chery@intel.com>
Wed, 28 Sep 2016 22:51:35 +0000 (15:51 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Fri, 18 Nov 2016 20:12:50 +0000 (12:12 -0800)
Move the assignment to a less surprising location.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/gen8_cmd_buffer.c

index 0b1d5bfe7cd7965eaa134c0143732f688b4791c4..c04dc248434c4fcf0ebab849aed7a461d2f2ff1f 100644 (file)
@@ -455,9 +455,6 @@ genX(cmd_buffer_emit_hz_op)(struct anv_cmd_buffer *cmd_buffer,
          hzp.FullSurfaceDepthandStencilClear = full_surface_op;
          hzp.StencilClearValue =
             cmd_state->attachments[ds].clear_value.depthStencil.stencil & 0xff;
-
-         /* Mark aspects as cleared */
-         cmd_state->attachments[ds].pending_clear_aspects = 0;
          break;
       case BLORP_HIZ_OP_DEPTH_RESOLVE:
          hzp.DepthBufferResolveEnable = true;
@@ -506,11 +503,16 @@ genX(cmd_buffer_emit_hz_op)(struct anv_cmd_buffer *cmd_buffer,
 
    anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_WM_HZ_OP), hzp);
 
-   if (!full_surface_op && op == BLORP_HIZ_OP_DEPTH_CLEAR) {
-      anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL), pc) {
-         pc.DepthStallEnable = true;
-         pc.DepthCacheFlushEnable = true;
+   if (op == BLORP_HIZ_OP_DEPTH_CLEAR) {
+      if (!full_surface_op) {
+         anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL), pc) {
+            pc.DepthStallEnable = true;
+            pc.DepthCacheFlushEnable = true;
+         }
       }
+
+      /* Mark aspects as cleared */
+      cmd_state->attachments[ds].pending_clear_aspects = 0;
    }
 }