From a566a933ca20eac0032d3e92cffe25e9d477b4e0 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 10 Oct 2025 14:40:06 +0200 Subject: [PATCH] radv: always return optimalDeviceAccess=TRUE for block-compressed formats Required by the spec. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_formats.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c index 247750224df..38f0fdc8d67 100644 --- a/src/amd/vulkan/radv_formats.c +++ b/src/amd/vulkan/radv_formats.c @@ -1309,7 +1309,15 @@ radv_GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, !(instance->debug_flags & RADV_DEBUG_NO_DCC) && (base_info->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT); } - host_perf_props->optimalDeviceAccess = pdev->info.gfx_level >= GFX12 || !might_enable_compression; + /** + * The Vulkan spec says: + * + * "If VkPhysicalDeviceImageFormatInfo2::format is a block-compressed format and + * vkGetPhysicalDeviceImageFormatProperties2 returns VK_SUCCESS, the implementation must + * return VK_TRUE in optimalDeviceAccess." + */ + host_perf_props->optimalDeviceAccess = + vk_format_is_block_compressed(format) || pdev->info.gfx_level >= GFX12 || !might_enable_compression; host_perf_props->identicalMemoryLayout = base_info->tiling == VK_IMAGE_TILING_LINEAR; }