radv: fix computing the number of color samples if no attachments

When no color attachments, the rasterization samples should be used.

Fixes: 0222dace90 ("radv: Support VK_KHR_dynamic_rendering for pipeline creation.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5830
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14642>
This commit is contained in:
Samuel Pitoiset 2022-01-20 23:49:08 +01:00 committed by Marge Bot
parent 4e4a2d0f97
commit b8c518f0fb

View file

@ -870,7 +870,7 @@ radv_pipeline_color_samples(const VkGraphicsPipelineCreateInfo *pCreateInfo)
vk_find_struct_const(pCreateInfo->pNext, ATTACHMENT_SAMPLE_COUNT_INFO_AMD);
const VkPipelineRenderingCreateInfoKHR *render_create_info =
vk_find_struct_const(pCreateInfo->pNext, PIPELINE_RENDERING_CREATE_INFO_KHR);
if (sample_info && render_create_info) {
if (sample_info && render_create_info && sample_info->colorAttachmentCount > 0) {
unsigned samples = 1;
for (uint32_t i = 0; i < sample_info->colorAttachmentCount; ++i) {
if (render_create_info->pColorAttachmentFormats[i] != VK_FORMAT_UNDEFINED) {