vulkan: add attachment sample count info AMD support

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18015>
This commit is contained in:
Samuel Pitoiset
2022-08-09 17:05:09 +02:00
parent c6e88d0394
commit f19d81ee42
2 changed files with 17 additions and 0 deletions
+11
View File
@@ -963,6 +963,17 @@ vk_render_pass_state_init(struct vk_render_pass_state *rp,
rp->depth_self_dependency = rsd_info->depthSelfDependency;
rp->stencil_self_dependency = rsd_info->stencilSelfDependency;
}
const VkAttachmentSampleCountInfoAMD *asc_info =
vk_get_pipeline_sample_count_info_amd(info);
if (asc_info != NULL) {
assert(asc_info->colorAttachmentCount == rp->color_attachment_count);
for (uint32_t i = 0; i < asc_info->colorAttachmentCount; i++) {
rp->color_attachment_samples[i] = asc_info->pColorAttachmentSamples[i];
}
rp->depth_stencil_attachment_samples = asc_info->depthStencilAttachmentSamples;
}
}
static void
+6
View File
@@ -504,6 +504,12 @@ struct vk_render_pass_state {
/** VkPipelineRenderingCreateInfo::stencilAttachmentFormat */
VkFormat stencil_attachment_format;
/** VkAttachmentSampleCountInfoAMD::pColorAttachmentSamples */
uint8_t color_attachment_samples[MESA_VK_MAX_COLOR_ATTACHMENTS];
/** VkAttachmentSampleCountInfoAMD::depthStencilAttachmentSamples */
uint8_t depth_stencil_attachment_samples;
};
/** Struct representing all dynamic graphics state