summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_cmd_buffer.c
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2018-02-28 09:44:18 +0100
committerIago Toral Quiroga <[email protected]>2018-04-02 09:53:24 +0200
commit31881079af7cbd3cb0b0395c93802e45569cd9e5 (patch)
tree4456003f4815b9a54b32ff8dc9bdbc2273fc67ca /src/intel/vulkan/genX_cmd_buffer.c
parentf60c5fc17e23ee12b7ae0e0d81a6c606a94faee6 (diff)
anv/cmd_buffer: honor pending clear views for depth/stencil attachments
v2: rebased on top of subpass rework. v3: rebased v4: - rebased - reset pending clear views in one go rather one bit at a time (Caio) Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/genX_cmd_buffer.c')
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 3c55cd964c6..3da6dffa1a9 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -3643,7 +3643,7 @@ cmd_buffer_begin_subpass(struct anv_cmd_buffer *cmd_buffer,
}
} else if (att_state->pending_clear_aspects & (VK_IMAGE_ASPECT_DEPTH_BIT |
VK_IMAGE_ASPECT_STENCIL_BIT)) {
- if (att_state->fast_clear) {
+ if (att_state->fast_clear && !is_multiview) {
/* We currently only support HiZ for single-layer images */
if (att_state->pending_clear_aspects & VK_IMAGE_ASPECT_DEPTH_BIT) {
assert(iview->image->planes[0].aux_usage == ISL_AUX_USAGE_HIZ);
@@ -3658,6 +3658,26 @@ cmd_buffer_begin_subpass(struct anv_cmd_buffer *cmd_buffer,
iview->planes[0].isl.base_array_layer,
fb->layers, render_area,
att_state->clear_value.depthStencil.stencil);
+ } else if (is_multiview) {
+ uint32_t pending_clear_mask =
+ get_multiview_subpass_clear_mask(cmd_state, att_state);
+
+ uint32_t layer_idx;
+ for_each_bit(layer_idx, pending_clear_mask) {
+ uint32_t layer =
+ iview->planes[0].isl.base_array_layer + layer_idx;
+
+ anv_image_clear_depth_stencil(cmd_buffer, image,
+ att_state->pending_clear_aspects,
+ att_state->aux_usage,
+ iview->planes[0].isl.base_level,
+ layer, 1,
+ render_area,
+ att_state->clear_value.depthStencil.depth,
+ att_state->clear_value.depthStencil.stencil);
+ }
+
+ att_state->pending_clear_views &= ~pending_clear_mask;
} else {
anv_image_clear_depth_stencil(cmd_buffer, image,
att_state->pending_clear_aspects,