[Mesa-dev] [PATCH 2/2] anv/blorp: consider multiview and view masks for tracking pending clear aspects

Iago Toral Quiroga itoral at igalia.com
Fri Jan 5 09:28:28 UTC 2018


When multiview is active a subpass clear may only clear a subset of the
attachment layers. Other subpasses in the same render pass may also
clear too and we want to honor those clears. This means that when multiview
is active we cannot mark an attachment as already cleared after a subpass
clear operation, unless we know that all subpasses share the same view mask,
in which case only one clear is really required.

Fixes work-in-progress CTS tests:
dEQP-VK.multiview.readback_implicit_clear.*
---
 src/intel/vulkan/anv_blorp.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
index 18fa4a4ae5..4575476240 100644
--- a/src/intel/vulkan/anv_blorp.c
+++ b/src/intel/vulkan/anv_blorp.c
@@ -1249,7 +1249,20 @@ anv_cmd_buffer_clear_subpass(struct anv_cmd_buffer *cmd_buffer)
          }
       }
 
-      att_state->pending_clear_aspects = 0;
+      if (!cmd_state->subpass->view_mask) {
+         att_state->pending_clear_aspects = 0;
+      } else {
+         bool all_subpasses_use_same_view_mask = true;
+         for (uint32_t i = 0; i < cmd_state->pass->subpass_count; i++) {
+            if (cmd_state->pass->subpasses[i].view_mask !=
+                cmd_state->subpass->view_mask) {
+               all_subpasses_use_same_view_mask = false;
+               break;
+            }
+         }
+         if (all_subpasses_use_same_view_mask)
+            att_state->pending_clear_aspects = 0;
+      }
    }
 
    const uint32_t ds = cmd_state->subpass->depth_stencil_attachment.attachment;
-- 
2.11.0



More information about the mesa-dev mailing list