v3dv: only clear depth/stencil attachments if any aspect needs clearing
When we can't perform the clears using the TLB and fallback to vkCmdClearAttachments make sure we only emit the clear if any of the depth/stencil aspects actually needs it. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
parent
c4564f62aa
commit
c5d07802dc
|
@ -2046,6 +2046,7 @@ cmd_buffer_emit_subpass_clears(struct v3dv_cmd_buffer *cmd_buffer)
|
||||||
if (att->desc.stencilLoadOp != VK_ATTACHMENT_LOAD_OP_CLEAR)
|
if (att->desc.stencilLoadOp != VK_ATTACHMENT_LOAD_OP_CLEAR)
|
||||||
aspects &= ~VK_IMAGE_ASPECT_STENCIL_BIT;
|
aspects &= ~VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||||
|
|
||||||
|
if (aspects) {
|
||||||
atts[att_count].aspectMask = aspects;
|
atts[att_count].aspectMask = aspects;
|
||||||
atts[att_count].colorAttachment = 0; /* Ignored */
|
atts[att_count].colorAttachment = 0; /* Ignored */
|
||||||
atts[att_count].clearValue =
|
atts[att_count].clearValue =
|
||||||
|
@ -2053,6 +2054,7 @@ cmd_buffer_emit_subpass_clears(struct v3dv_cmd_buffer *cmd_buffer)
|
||||||
att_count++;
|
att_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (att_count == 0)
|
if (att_count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue