From ec6da922df66b1c415c45dc5ca2f083afed013c3 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 9 Apr 2021 13:58:15 +0200 Subject: [PATCH] radv: expose R8_UINT as the only supported format for VRS attachments Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_formats.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c index 5770e2789bb..a1202249cf4 100644 --- a/src/amd/vulkan/radv_formats.c +++ b/src/amd/vulkan/radv_formats.c @@ -785,6 +785,17 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical if (vk_format_is_compressed(format)) linear = 0; + /* From the Vulkan spec 1.2.163: + * + * "VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR must be supported for the + * following formats if the attachmentFragmentShadingRate feature is supported:" + * + * - VK_FORMAT_R8_UINT + */ + if (format == VK_FORMAT_R8_UINT) { + tiled |= VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR; + } + out_properties->linearTilingFeatures = linear; out_properties->optimalTilingFeatures = tiled; out_properties->bufferFeatures = buffer;