{
for (uint32_t i = 0; i < pass->subpass_count; i++) {
struct radv_subpass *subpass = &pass->subpasses[i];
+ uint32_t color_sample_count = 1, depth_sample_count = 1;
/* We don't allow depth_stencil_attachment to be non-NULL and
* be VK_ATTACHMENT_UNUSED. This way something can just check
pass_att->last_subpass_idx = i;
}
+
+ for (uint32_t j = 0; j < subpass->color_count; j++) {
+ struct radv_subpass_attachment *subpass_att =
+ &subpass->color_attachments[j];
+ if (subpass_att->attachment == VK_ATTACHMENT_UNUSED)
+ continue;
+
+ struct radv_render_pass_attachment *pass_att =
+ &pass->attachments[subpass_att->attachment];
+
+ color_sample_count = pass_att->samples;
+ }
+
+ if (subpass->depth_stencil_attachment) {
+ const uint32_t a =
+ subpass->depth_stencil_attachment->attachment;
+ struct radv_render_pass_attachment *pass_att =
+ &pass->attachments[a];
+ depth_sample_count = pass_att->samples;
+ }
+
+ subpass->max_sample_count = MAX2(color_sample_count,
+ depth_sample_count);
+
+ /* We have to handle resolve attachments specially */
+ subpass->has_resolve = false;
+ if (subpass->resolve_attachments) {
+ for (uint32_t j = 0; j < subpass->color_count; j++) {
+ struct radv_subpass_attachment *resolve_att =
+ &subpass->resolve_attachments[j];
+
+ if (resolve_att->attachment == VK_ATTACHMENT_UNUSED)
+ continue;
+
+ subpass->has_resolve = true;
+ }
+ }
}
}
p = pass->subpass_attachments;
for (uint32_t i = 0; i < pCreateInfo->subpassCount; i++) {
const VkSubpassDescription *desc = &pCreateInfo->pSubpasses[i];
- uint32_t color_sample_count = 1, depth_sample_count = 1;
struct radv_subpass *subpass = &pass->subpasses[i];
subpass->input_count = desc->inputAttachmentCount;
.attachment = desc->pColorAttachments[j].attachment,
.layout = desc->pColorAttachments[j].layout,
};
- if (desc->pColorAttachments[j].attachment != VK_ATTACHMENT_UNUSED) {
- color_sample_count = pCreateInfo->pAttachments[desc->pColorAttachments[j].attachment].samples;
- }
}
}
- subpass->has_resolve = false;
if (desc->pResolveAttachments) {
subpass->resolve_attachments = p;
p += desc->colorAttachmentCount;
.attachment = desc->pResolveAttachments[j].attachment,
.layout = desc->pResolveAttachments[j].layout,
};
- if (a != VK_ATTACHMENT_UNUSED) {
- subpass->has_resolve = true;
- }
}
}
.attachment = desc->pDepthStencilAttachment->attachment,
.layout = desc->pDepthStencilAttachment->layout,
};
- if (desc->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
- depth_sample_count = pCreateInfo->pAttachments[desc->pDepthStencilAttachment->attachment].samples;
- }
}
-
- subpass->max_sample_count = MAX2(color_sample_count,
- depth_sample_count);
}
for (unsigned i = 0; i < pCreateInfo->dependencyCount; ++i) {
p = pass->subpass_attachments;
for (uint32_t i = 0; i < pCreateInfo->subpassCount; i++) {
const VkSubpassDescription2KHR *desc = &pCreateInfo->pSubpasses[i];
- uint32_t color_sample_count = 1, depth_sample_count = 1;
struct radv_subpass *subpass = &pass->subpasses[i];
subpass->input_count = desc->inputAttachmentCount;
.attachment = desc->pColorAttachments[j].attachment,
.layout = desc->pColorAttachments[j].layout,
};
- if (desc->pColorAttachments[j].attachment != VK_ATTACHMENT_UNUSED) {
- color_sample_count = pCreateInfo->pAttachments[desc->pColorAttachments[j].attachment].samples;
- }
}
}
- subpass->has_resolve = false;
if (desc->pResolveAttachments) {
subpass->resolve_attachments = p;
p += desc->colorAttachmentCount;
.attachment = desc->pResolveAttachments[j].attachment,
.layout = desc->pResolveAttachments[j].layout,
};
- if (a != VK_ATTACHMENT_UNUSED) {
- subpass->has_resolve = true;
- }
}
}
.attachment = desc->pDepthStencilAttachment->attachment,
.layout = desc->pDepthStencilAttachment->layout,
};
- if (desc->pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
- depth_sample_count = pCreateInfo->pAttachments[desc->pDepthStencilAttachment->attachment].samples;
- }
}
-
- subpass->max_sample_count = MAX2(color_sample_count,
- depth_sample_count);
}
for (unsigned i = 0; i < pCreateInfo->dependencyCount; ++i) {