mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-20 16:30:50 +02:00
pvr: Refactor subpass ds and sample count setup
Now we first check the sample count from the ds attachment as well as setting it up. Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25584>
This commit is contained in:
parent
e07cff4ac5
commit
41a9af4819
1 changed files with 19 additions and 20 deletions
|
|
@ -520,10 +520,8 @@ VkResult pvr_CreateRenderPass2(VkDevice _device,
|
|||
for (uint32_t i = 0; i < pass->subpass_count; i++) {
|
||||
const VkSubpassDescription2 *desc = &pCreateInfo->pSubpasses[i];
|
||||
struct pvr_render_subpass *subpass = &pass->subpasses[i];
|
||||
bool has_used_color_attachment = false;
|
||||
|
||||
subpass->pipeline_bind_point = desc->pipelineBindPoint;
|
||||
subpass->sample_count = 1;
|
||||
|
||||
/* From the Vulkan spec. 1.3.265
|
||||
* VUID-VkSubpassDescription2-multisampledRenderToSingleSampled-06872:
|
||||
|
|
@ -535,6 +533,18 @@ VkResult pvr_CreateRenderPass2(VkDevice _device,
|
|||
* not VK_ATTACHMENT_UNUSED must have the same sample count"
|
||||
*
|
||||
*/
|
||||
subpass->sample_count = VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM;
|
||||
|
||||
if (desc->pDepthStencilAttachment) {
|
||||
uint32_t index = desc->pDepthStencilAttachment->attachment;
|
||||
|
||||
if (index != VK_ATTACHMENT_UNUSED)
|
||||
subpass->sample_count = pass->attachments[index].sample_count;
|
||||
|
||||
subpass->depth_stencil_attachment = index;
|
||||
} else {
|
||||
subpass->depth_stencil_attachment = VK_ATTACHMENT_UNUSED;
|
||||
}
|
||||
|
||||
subpass->color_count = desc->colorAttachmentCount;
|
||||
if (subpass->color_count > 0) {
|
||||
|
|
@ -542,26 +552,22 @@ VkResult pvr_CreateRenderPass2(VkDevice _device,
|
|||
subpass_attachments += subpass->color_count;
|
||||
|
||||
for (uint32_t j = 0; j < subpass->color_count; j++) {
|
||||
uint32_t index;
|
||||
|
||||
subpass->color_attachments[j] =
|
||||
desc->pColorAttachments[j].attachment;
|
||||
|
||||
if (subpass->color_attachments[j] == VK_ATTACHMENT_UNUSED)
|
||||
continue;
|
||||
|
||||
index = subpass->color_attachments[j];
|
||||
subpass->sample_count = pass->attachments[index].sample_count;
|
||||
has_used_color_attachment = true;
|
||||
if (subpass->sample_count == VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM) {
|
||||
uint32_t index;
|
||||
index = subpass->color_attachments[j];
|
||||
subpass->sample_count = pass->attachments[index].sample_count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!has_used_color_attachment && desc->pDepthStencilAttachment &&
|
||||
desc->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
|
||||
uint32_t index;
|
||||
index = desc->pDepthStencilAttachment->attachment;
|
||||
subpass->sample_count = pass->attachments[index].sample_count;
|
||||
}
|
||||
if (subpass->sample_count == VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM)
|
||||
subpass->sample_count = VK_SAMPLE_COUNT_1_BIT;
|
||||
|
||||
if (desc->pResolveAttachments) {
|
||||
subpass->resolve_attachments = subpass_attachments;
|
||||
|
|
@ -584,13 +590,6 @@ VkResult pvr_CreateRenderPass2(VkDevice _device,
|
|||
}
|
||||
}
|
||||
|
||||
if (desc->pDepthStencilAttachment) {
|
||||
subpass->depth_stencil_attachment =
|
||||
desc->pDepthStencilAttachment->attachment;
|
||||
} else {
|
||||
subpass->depth_stencil_attachment = VK_ATTACHMENT_UNUSED;
|
||||
}
|
||||
|
||||
/* Give the dependencies a slice of the subpass_attachments array. */
|
||||
subpass->dep_list = dep_list;
|
||||
dep_list += subpass->dep_count;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue