From 75da8229f97b33fe1d31c355b0c76341163da98c Mon Sep 17 00:00:00 2001 From: Zan Dobersek Date: Thu, 23 Oct 2025 13:33:40 +0200 Subject: [PATCH] tu: don't advertise sample location support for VK_SAMPLE_COUNT_1_BIT Hardware doesn't support programmable sample locations with 1x MSAA, so VK_SAMPLE_COUNT_1_BIT shouldn't be included in the VkPhysicalDeviceSampleLocationsPropertiesEXT::sampleLocationSampleCounts bitmask. With this sample count MSAA will also be disabled through relevant control registers, effectively forcing all samples to the center position. Fixes failures in VK_SAMPLE_COUNT_1_BIT tests under dEQP-VK.pipeline.*.*.sample_locations_ext.verify_interpolation. Signed-off-by: Zan Dobersek Part-of: --- src/freedreno/vulkan/tu_device.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc index 347f630509f..9fd8bd9ebc8 100644 --- a/src/freedreno/vulkan/tu_device.cc +++ b/src/freedreno/vulkan/tu_device.cc @@ -867,6 +867,8 @@ tu_get_physical_device_properties_1_1(struct tu_physical_device *pdevice, static const size_t max_descriptor_set_size = MAX_SET_SIZE / (4 * A6XX_TEX_CONST_DWORDS); static const VkSampleCountFlags sample_counts = VK_SAMPLE_COUNT_1_BIT | VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT; +static const VkSampleCountFlags sample_location_counts = + VK_SAMPLE_COUNT_2_BIT | VK_SAMPLE_COUNT_4_BIT; static void tu_get_physical_device_properties_1_2(struct tu_physical_device *pdevice, @@ -1241,7 +1243,7 @@ tu_get_properties(struct tu_physical_device *pdevice, /* VK_EXT_sample_locations */ props->sampleLocationSampleCounts = - pdevice->vk.supported_extensions.EXT_sample_locations ? sample_counts : 0; + pdevice->vk.supported_extensions.EXT_sample_locations ? sample_location_counts : 0; props->maxSampleLocationGridSize = (VkExtent2D) { 1 , 1 }; props->sampleLocationCoordinateRange[0] = SAMPLE_LOCATION_MIN; props->sampleLocationCoordinateRange[1] = SAMPLE_LOCATION_MAX; @@ -4094,7 +4096,7 @@ tu_GetPhysicalDeviceMultisamplePropertiesEXT( { VK_FROM_HANDLE(tu_physical_device, pdevice, physicalDevice); - if (samples <= VK_SAMPLE_COUNT_4_BIT && pdevice->vk.supported_extensions.EXT_sample_locations) + if (pdevice->vk.supported_extensions.EXT_sample_locations && (samples & sample_location_counts)) pMultisampleProperties->maxSampleLocationGridSize = (VkExtent2D){ 1, 1 }; else pMultisampleProperties->maxSampleLocationGridSize = (VkExtent2D){ 0, 0 };