From daa0d8668b68b7ea0a732bbfd517769d50a40e3b Mon Sep 17 00:00:00 2001 From: Sagar Ghuge Date: Mon, 25 Jan 2021 13:23:32 -0800 Subject: [PATCH] anv: Skip CCS ambiguate which preceed fast-clears We can skip CCS ambiguate if followed by a fast clear within render pass. v2: (Jason) - Check array layer as well since we only fast clear first layer and first LOD. - Don't drop fast clear check while doing resolve operation. Fixes: d5849bc840e "anv: Skip HiZ and CCS ambiguates which preceed fast-clears" Signed-off-by: Sagar Ghuge Reviewed-by: Jason Ekstrand Part-of: (cherry picked from commit 001722b3a301312d2ec16c939376098dc11fab98) --- .pick_status.json | 2 +- src/intel/vulkan/genX_cmd_buffer.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index dec1b35ba02..7c5caa9a461 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -256,7 +256,7 @@ "description": "anv: Skip CCS ambiguate which preceed fast-clears", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "d5849bc840e5167b5b735d9e3f1ec1e8e1197c98" }, diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 85341ab940e..e3eb376fa5a 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1233,6 +1233,17 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer, uint32_t level_layer_count = MIN2(layer_count, aux_layers - base_layer); + /* If will_full_fast_clear is set, the caller promises to + * fast-clear the largest portion of the specified range as it can. + * For color images, that means only the first LOD and array slice. + */ + if (level == 0 && base_layer == 0 && will_full_fast_clear) { + base_layer++; + level_layer_count--; + if (level_layer_count == 0) + continue; + } + anv_image_ccs_op(cmd_buffer, image, image->planes[plane].surface.isl.format, ISL_SWIZZLE_IDENTITY, @@ -1252,6 +1263,12 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer, "define an MCS buffer."); } + /* If will_full_fast_clear is set, the caller promises to fast-clear + * the largest portion of the specified range as it can. + */ + if (will_full_fast_clear) + return; + assert(base_level == 0 && level_count == 1); anv_image_mcs_op(cmd_buffer, image, image->planes[plane].surface.isl.format,