From 41bd5f7cd721b11051fb555201e5c50210d4cf88 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 23 Feb 2021 15:52:49 -0500 Subject: [PATCH] lavapipe: fix color-only renderpass clears not all attachments must be cleared Reviewed-by: Dave Airlie Part-of: --- src/gallium/frontends/lavapipe/lvp_execute.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index bedabb8bfd6..5e8683b50e0 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -1276,12 +1276,10 @@ static void render_subpass_clear_fast(struct rendering_state *state) state->pending_clear_aspects[a] = 0; } - if (subpass->depth_stencil_attachment) { + if (subpass->depth_stencil_attachment && + attachment_needs_clear(state, subpass->depth_stencil_attachment->attachment)) { uint32_t ds = subpass->depth_stencil_attachment->attachment; - if (!attachment_needs_clear(state, ds)) - return; - struct lvp_render_pass_attachment *att = &state->pass->attachments[ds]; struct lvp_image_view *imgv = state->vk_framebuffer->attachments[ds]; const struct util_format_description *desc = util_format_description(imgv->surface->format);