From 8a5135e6b376947ccbb018472fdcd1cbe49ef16e Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Fri, 10 Jan 2020 11:52:03 +0100 Subject: [PATCH] v3dv: fix tile buffer loading So we do what we actually state in the comment. Particularly, the load operation only affects the first subpass that uses the attachment, after that we always want to load, but we were only doing that for attachments marked as CLEAR. Part-of: --- src/broadcom/vulkan/v3dv_cmd_buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index 75977333389..c96fc04e829 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -698,10 +698,10 @@ emit_loads(struct v3dv_cmd_buffer *cmd_buffer, * After that, we always want to load so we don't lose any rendering done * by a previous subpass to the same attachment. */ + assert(state->job->first_subpass >= attachment_state->first_subpass); bool needs_load = - attachment->desc.loadOp == VK_ATTACHMENT_LOAD_OP_LOAD || - (attachment->desc.loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR && - state->job->first_subpass > attachment_state->first_subpass); + state->job->first_subpass > attachment_state->first_subpass || + attachment->desc.loadOp == VK_ATTACHMENT_LOAD_OP_LOAD; if (needs_load) { struct v3dv_image_view *iview = framebuffer->attachments[attachment_idx];