summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-10-07 19:14:47 -0700
committerJason Ekstrand <[email protected]>2016-10-14 15:39:41 -0700
commitc9eaf12de20ac4143fe79d42018bdbb5a391356f (patch)
tree5602e41da0176e016beffabc959b521eb3964d6d /src/intel/vulkan
parent58f2315c3819bbd6bab9ee62b0743309feac42cb (diff)
anv/hiz: Perform HiZ resolves for all partial renders
If we don't, we can end up with corruption in the portion of the depth buffer that lies outside the render area when we do a HiZ resolve at the end. The only reason we weren't seeing this before was that all of the meta-based clears such as VkCmdClearDepthStencilImage were internally using HiZ so the HiZ buffer never truly got out-of-sync. If the CTS ever tested a depth upload (which doesn't care about HiZ) and then a partial render we would have seen problems. Soon, we will be using blorp to do depth clears and it won't bother with HiZ so we would get CTS regressions without this. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/gen8_cmd_buffer.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/intel/vulkan/gen8_cmd_buffer.c b/src/intel/vulkan/gen8_cmd_buffer.c
index e6a3c3dd171..44ffcbff12a 100644
--- a/src/intel/vulkan/gen8_cmd_buffer.c
+++ b/src/intel/vulkan/gen8_cmd_buffer.c
@@ -513,7 +513,17 @@ genX(cmd_buffer_emit_hz_op)(struct anv_cmd_buffer *cmd_buffer,
return;
break;
case BLORP_HIZ_OP_HIZ_RESOLVE:
- if (cmd_buffer->state.pass->attachments[ds].load_op !=
+ /* If the render area covers the entire surface *and* load_op is either
+ * CLEAR or DONT_CARE then the previous contents of the depth buffer
+ * will be entirely discarded. In this case, we can skip the HiZ
+ * resolve.
+ *
+ * If the render area is not the full surface, we need to do
+ * the resolve because otherwise data outside the render area may get
+ * garbled by the resolve at the end of the render pass.
+ */
+ if (full_surface_op &&
+ cmd_buffer->state.pass->attachments[ds].load_op !=
VK_ATTACHMENT_LOAD_OP_LOAD)
return;
break;