tu: don't advertise sample location support for VK_SAMPLE_COUNT_1_BIT
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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 <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38026>
This commit is contained in:
Zan Dobersek 2025-10-23 13:33:40 +02:00 committed by Marge Bot
parent 2689056c82
commit 75da8229f9

View file

@ -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 };