summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/gen8_cmd_buffer.c
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2017-01-07 18:18:43 -0800
committerNanley Chery <[email protected]>2017-01-12 20:52:19 -0800
commit64fb5b0d51751f452b7bf4c5fff06b5549eed4a8 (patch)
tree1d5a232867e5b267a3912ad28ee6fb9483a5b063 /src/intel/vulkan/gen8_cmd_buffer.c
parent168985fca1b59d345471277d5c8ce4a82cdc74f4 (diff)
anv: Enable HiZ support for multiple subpasses
We'll be using layout transitions later on in the series which can occur within and between subpasses. Turn this on now to simplify the change later. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/gen8_cmd_buffer.c')
-rw-r--r--src/intel/vulkan/gen8_cmd_buffer.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/intel/vulkan/gen8_cmd_buffer.c b/src/intel/vulkan/gen8_cmd_buffer.c
index 892a035304e..81d77271308 100644
--- a/src/intel/vulkan/gen8_cmd_buffer.c
+++ b/src/intel/vulkan/gen8_cmd_buffer.c
@@ -340,10 +340,6 @@ genX(cmd_buffer_emit_hz_op)(struct anv_cmd_buffer *cmd_buffer,
if (iview == NULL || iview->image->aux_usage != ISL_AUX_USAGE_HIZ)
return;
- /* FINISHME: Implement multi-subpass HiZ */
- if (cmd_buffer->state.pass->subpass_count > 1)
- return;
-
const uint32_t ds = cmd_state->subpass->depth_stencil_attachment;
/* Section 7.4. of the Vulkan 1.0.27 spec states:
@@ -366,6 +362,8 @@ genX(cmd_buffer_emit_hz_op)(struct anv_cmd_buffer *cmd_buffer,
/* This variable corresponds to the Pixel Dim column in the table below */
struct isl_extent2d px_dim;
+ const uint32_t subpass_idx = cmd_state->subpass - cmd_state->pass->subpasses;
+
/* Validate that we can perform the HZ operation and that it's necessary. */
switch (op) {
case BLORP_HIZ_OP_DEPTH_CLEAR:
@@ -446,7 +444,8 @@ genX(cmd_buffer_emit_hz_op)(struct anv_cmd_buffer *cmd_buffer,
break;
case BLORP_HIZ_OP_DEPTH_RESOLVE:
if (cmd_buffer->state.pass->attachments[ds].store_op !=
- VK_ATTACHMENT_STORE_OP_STORE)
+ VK_ATTACHMENT_STORE_OP_STORE &&
+ subpass_idx == cmd_state->pass->subpass_count - 1)
return;
break;
case BLORP_HIZ_OP_HIZ_RESOLVE:
@@ -461,7 +460,7 @@ genX(cmd_buffer_emit_hz_op)(struct anv_cmd_buffer *cmd_buffer,
*/
if (full_surface_op &&
cmd_buffer->state.pass->attachments[ds].load_op !=
- VK_ATTACHMENT_LOAD_OP_LOAD)
+ VK_ATTACHMENT_LOAD_OP_LOAD && subpass_idx == 0)
return;
break;
case BLORP_HIZ_OP_NONE: