From 5980cd5768467cf19bead7fa362d76586a9117a9 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 7 Apr 2021 16:48:59 +0200 Subject: [PATCH] radv: do not allow MSAA with fragment shading rate attachments The Vulkan spec requires the implementation to only supports VK_SAMPLE_COUNT_1_BIT with fragment shading rate attachments. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_formats.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c index a1202249cf4..de046a842a8 100644 --- a/src/amd/vulkan/radv_formats.c +++ b/src/amd/vulkan/radv_formats.c @@ -1366,7 +1366,8 @@ radv_get_image_format_properties(struct radv_physical_device *physical_device, if (tiling == VK_IMAGE_TILING_OPTIMAL && info->type == VK_IMAGE_TYPE_2D && (format_feature_flags & (VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)) && - !(info->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT)) { + !(info->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) && + !(info->usage & VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR)) { sampleCounts |= VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT | VK_SAMPLE_COUNT_8_BIT; }