lavapipe: flag renderpasses as having color/zs attachments

it's useful to track this info for reuse

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10625>
This commit is contained in:
Mike Blumenkrantz 2021-05-04 11:58:43 -04:00 committed by Marge Bot
parent 49f93a4c5e
commit 7a955d1501
2 changed files with 6 additions and 0 deletions

View File

@ -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++) {

View File

@ -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];
};