anv/blorp: Disable resolves for transparent black clears
authorNanley Chery <nanley.g.chery@intel.com>
Sat, 21 Jan 2017 21:35:50 +0000 (13:35 -0800)
committerNanley Chery <nanley.g.chery@intel.com>
Fri, 3 Feb 2017 17:23:13 +0000 (09:23 -0800)
Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_blorp.c

index 2cf972bb613f0b3b3e937c4c2a48805d679cbd1f..759d2ae9444bc12e6a59cb3c7b0a6fa1731dedb5 100644 (file)
@@ -1451,9 +1451,15 @@ ccs_resolve_attachment(struct anv_cmd_buffer *cmd_buffer,
          resolve_op = BLORP_FAST_CLEAR_OP_RESOLVE_FULL;
       } else if (att_state->fast_clear) {
          /* We don't know what to do with clear colors outside the render
-          * pass.  We need a partial resolve.
+          * pass.  We need a partial resolve. Only transparent black is
+          * built into the surface state object and thus no resolve is
+          * required for this case.
           */
-         resolve_op = BLORP_FAST_CLEAR_OP_RESOLVE_PARTIAL;
+         if (att_state->clear_value.color.uint32[0] ||
+             att_state->clear_value.color.uint32[1] ||
+             att_state->clear_value.color.uint32[2] ||
+             att_state->clear_value.color.uint32[3])
+            resolve_op = BLORP_FAST_CLEAR_OP_RESOLVE_PARTIAL;
       } else {
          /* The image "natively" supports all the compression we care about
           * and we don't need to resolve at all.  If this is the case, we also