lavapipe: fix pipeline creation for blend and zs states

these values are read based on the specified subpass containing the
required attachments, not on the overall renderpass

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15282>
This commit is contained in:
Mike Blumenkrantz
2022-02-22 15:25:06 -05:00
committed by Marge Bot
parent 7114490115
commit 204ea77b06
3 changed files with 6 additions and 8 deletions

View File

@@ -85,10 +85,6 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateRenderPass2(
att->load_op = pCreateInfo->pAttachments[i].loadOp;
att->stencil_load_op = pCreateInfo->pAttachments[i].stencilLoadOp;
att->attachment = i;
bool is_zs = util_format_is_depth_or_stencil(lvp_vk_format_to_pipe_format(att->format));
pass->has_zs_attachment |= is_zs;
pass->has_color_attachment |= !is_zs;
}
uint32_t subpass_attachment_idx = 0;
@@ -124,6 +120,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateRenderPass2(
for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {
CHECK_UNUSED_ATTACHMENT(pColorAttachments, color_attachments, j);
subpass->has_color_attachment |= !!subpass->color_attachments[j];
}
}
@@ -143,6 +140,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateRenderPass2(
subpass_attachment_idx++;
CHECK_UNUSED_ATTACHMENT(pDepthStencilAttachment, depth_stencil_attachment, 0);
subpass->has_zs_attachment = !!(*subpass->depth_stencil_attachment);
}
const VkSubpassDescriptionDepthStencilResolve *ds_resolve =

View File

@@ -369,7 +369,7 @@ deep_copy_graphics_create_info(void *mem_ctx,
/* pDepthStencilState */
if (src->pDepthStencilState && !rasterization_disabled &&
(pass ? pass->has_zs_attachment : (rp_info->depthAttachmentFormat || rp_info->stencilAttachmentFormat))) {
(pass ? pass->subpasses[src->subpass].has_zs_attachment : (rp_info->depthAttachmentFormat || rp_info->stencilAttachmentFormat))) {
LVP_PIPELINE_DUP(dst->pDepthStencilState,
src->pDepthStencilState,
VkPipelineDepthStencilStateCreateInfo,
@@ -379,7 +379,7 @@ deep_copy_graphics_create_info(void *mem_ctx,
/* pColorBlendState */
if (src->pColorBlendState && !rasterization_disabled &&
(pass ? pass->has_color_attachment : rp_info->colorAttachmentCount)) {
(pass ? pass->subpasses[src->subpass].has_color_attachment : rp_info->colorAttachmentCount)) {
VkPipelineColorBlendStateCreateInfo* cb_state;
cb_state = ralloc(mem_ctx, VkPipelineColorBlendStateCreateInfo);

View File

@@ -284,6 +284,8 @@ struct lvp_subpass {
/** Subpass has at least one color resolve attachment */
bool has_color_resolve;
bool has_color_attachment;
bool has_zs_attachment;
uint32_t view_mask;
};
@@ -294,8 +296,6 @@ 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];
};