summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2017-01-09 04:47:31 -0800
committerNanley Chery <[email protected]>2017-01-12 20:52:19 -0800
commit168985fca1b59d345471277d5c8ce4a82cdc74f4 (patch)
tree4e2b2b8ff51f526c799f62ccc3ee8783e6dca644
parent055ff2ec52143f9d9110a27cea046087de7a0cb5 (diff)
anv: Use ::anv_attachment_state for toggling HiZ per subpass
We're about to enable HiZ support for multiple subpasses. Use this field to keep track of whether or not subpass operations should treat the depth buffer as having an auxiliary HiZ buffer. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index a372e6420fe..47d3322e485 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -459,7 +459,7 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
state->attachments[i].aux_usage,
state->attachments[i].color_rt_state);
} else {
- state->attachments[i].aux_usage = ISL_AUX_USAGE_NONE;
+ state->attachments[i].aux_usage = iview->image->aux_usage;
state->attachments[i].input_aux_usage = ISL_AUX_USAGE_NONE;
}
@@ -2087,7 +2087,9 @@ cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer)
anv_cmd_buffer_get_depth_stencil_view(cmd_buffer);
const struct anv_image *image = iview ? iview->image : NULL;
const bool has_depth = image && (image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT);
- const bool has_hiz = image != NULL && image->aux_usage == ISL_AUX_USAGE_HIZ;
+ const uint32_t ds = cmd_buffer->state.subpass->depth_stencil_attachment;
+ const bool has_hiz = image != NULL &&
+ cmd_buffer->state.attachments[ds].aux_usage == ISL_AUX_USAGE_HIZ;
const bool has_stencil =
image && (image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT);