vk/meta: Pass depth/stencil attachments only when a clear is requested

If we pass both, and only one of them is cleared, the other aspect might
be disturbed if the format contains both aspects.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32379>
This commit is contained in:
Boris Brezillon 2024-11-27 17:28:22 +01:00 committed by Marge Bot
parent 63b99fde38
commit ccced641b5

View file

@ -494,12 +494,12 @@ clear_image_level_layers(struct vk_command_buffer *cmd,
VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
}
if (image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT) {
if (aspects & VK_IMAGE_ASPECT_DEPTH_BIT) {
vk_render.pDepthAttachment = &vk_att;
meta_render.depth_attachment_format = format;
}
if (image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
vk_render.pStencilAttachment = &vk_att;
meta_render.stencil_attachment_format = format;
}