radv: Deal with unused attachments in mip flush

Fixes: 4cce4d22a7 ("radv: Fix a hang on CB change by adding flushes.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7813>
This commit is contained in:
Bas Nieuwenhuizen
2020-11-27 15:07:17 +01:00
committed by Marge Bot
parent 160a0f2551
commit aed8d30b50

View File

@@ -2258,6 +2258,9 @@ radv_emit_fb_mip_change_flush(struct radv_cmd_buffer *cmd_buffer)
for (int i = 0; i < subpass->color_count; ++i) { for (int i = 0; i < subpass->color_count; ++i) {
int idx = subpass->color_attachments[i].attachment; int idx = subpass->color_attachments[i].attachment;
if (idx == VK_ATTACHMENT_UNUSED)
continue;
struct radv_image_view *iview = cmd_buffer->state.attachments[idx].iview; struct radv_image_view *iview = cmd_buffer->state.attachments[idx].iview;
if ((radv_image_has_CB_metadata(iview->image) || if ((radv_image_has_CB_metadata(iview->image) ||