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:

committed by
Marge Bot

parent
7114490115
commit
204ea77b06
@@ -85,10 +85,6 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateRenderPass2(
|
|||||||
att->load_op = pCreateInfo->pAttachments[i].loadOp;
|
att->load_op = pCreateInfo->pAttachments[i].loadOp;
|
||||||
att->stencil_load_op = pCreateInfo->pAttachments[i].stencilLoadOp;
|
att->stencil_load_op = pCreateInfo->pAttachments[i].stencilLoadOp;
|
||||||
att->attachment = i;
|
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;
|
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++) {
|
for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {
|
||||||
CHECK_UNUSED_ATTACHMENT(pColorAttachments, color_attachments, 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++;
|
subpass_attachment_idx++;
|
||||||
|
|
||||||
CHECK_UNUSED_ATTACHMENT(pDepthStencilAttachment, depth_stencil_attachment, 0);
|
CHECK_UNUSED_ATTACHMENT(pDepthStencilAttachment, depth_stencil_attachment, 0);
|
||||||
|
subpass->has_zs_attachment = !!(*subpass->depth_stencil_attachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
const VkSubpassDescriptionDepthStencilResolve *ds_resolve =
|
const VkSubpassDescriptionDepthStencilResolve *ds_resolve =
|
||||||
|
@@ -369,7 +369,7 @@ deep_copy_graphics_create_info(void *mem_ctx,
|
|||||||
|
|
||||||
/* pDepthStencilState */
|
/* pDepthStencilState */
|
||||||
if (src->pDepthStencilState && !rasterization_disabled &&
|
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,
|
LVP_PIPELINE_DUP(dst->pDepthStencilState,
|
||||||
src->pDepthStencilState,
|
src->pDepthStencilState,
|
||||||
VkPipelineDepthStencilStateCreateInfo,
|
VkPipelineDepthStencilStateCreateInfo,
|
||||||
@@ -379,7 +379,7 @@ deep_copy_graphics_create_info(void *mem_ctx,
|
|||||||
|
|
||||||
/* pColorBlendState */
|
/* pColorBlendState */
|
||||||
if (src->pColorBlendState && !rasterization_disabled &&
|
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;
|
VkPipelineColorBlendStateCreateInfo* cb_state;
|
||||||
|
|
||||||
cb_state = ralloc(mem_ctx, VkPipelineColorBlendStateCreateInfo);
|
cb_state = ralloc(mem_ctx, VkPipelineColorBlendStateCreateInfo);
|
||||||
|
@@ -284,6 +284,8 @@ struct lvp_subpass {
|
|||||||
|
|
||||||
/** Subpass has at least one color resolve attachment */
|
/** Subpass has at least one color resolve attachment */
|
||||||
bool has_color_resolve;
|
bool has_color_resolve;
|
||||||
|
bool has_color_attachment;
|
||||||
|
bool has_zs_attachment;
|
||||||
|
|
||||||
uint32_t view_mask;
|
uint32_t view_mask;
|
||||||
};
|
};
|
||||||
@@ -294,8 +296,6 @@ struct lvp_render_pass {
|
|||||||
uint32_t subpass_count;
|
uint32_t subpass_count;
|
||||||
struct lvp_subpass_attachment * subpass_attachments;
|
struct lvp_subpass_attachment * subpass_attachments;
|
||||||
struct lvp_render_pass_attachment * attachments;
|
struct lvp_render_pass_attachment * attachments;
|
||||||
bool has_color_attachment;
|
|
||||||
bool has_zs_attachment;
|
|
||||||
struct lvp_subpass subpasses[0];
|
struct lvp_subpass subpasses[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user