From 7a955d1501bc776e35f6747cb92095bb4674fe94 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 4 May 2021 11:58:43 -0400 Subject: [PATCH] lavapipe: flag renderpasses as having color/zs attachments it's useful to track this info for reuse Reviewed-by: Dave Airlie Part-of: --- src/gallium/frontends/lavapipe/lvp_pass.c | 4 ++++ src/gallium/frontends/lavapipe/lvp_private.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/gallium/frontends/lavapipe/lvp_pass.c b/src/gallium/frontends/lavapipe/lvp_pass.c index e1bf4587983..9638c30d583 100644 --- a/src/gallium/frontends/lavapipe/lvp_pass.c +++ b/src/gallium/frontends/lavapipe/lvp_pass.c @@ -185,6 +185,10 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateRenderPass2( att->stencil_load_op = pCreateInfo->pAttachments[i].stencilLoadOp; att->final_layout = pCreateInfo->pAttachments[i].finalLayout; att->first_subpass_idx = UINT32_MAX; + + bool is_zs = util_format_is_depth_or_stencil(vk_format_to_pipe(att->format)); + pass->has_zs_attachment |= is_zs; + pass->has_color_attachment |= !is_zs; } uint32_t subpass_attachment_count = 0; for (uint32_t i = 0; i < pCreateInfo->subpassCount; i++) { diff --git a/src/gallium/frontends/lavapipe/lvp_private.h b/src/gallium/frontends/lavapipe/lvp_private.h index 6c2c5c8c33e..40b4d6b76b2 100644 --- a/src/gallium/frontends/lavapipe/lvp_private.h +++ b/src/gallium/frontends/lavapipe/lvp_private.h @@ -303,6 +303,8 @@ struct lvp_render_pass { uint32_t subpass_count; struct lvp_subpass_attachment * subpass_attachments; struct lvp_render_pass_attachment * attachments; + bool has_color_attachment; + bool has_zs_attachment; struct lvp_subpass subpasses[0]; };