venus: further sanitize image props for rgba10x6

ycbcr sampler conversion requires VK_SAMPLE_COUNT_1_BIT. This is needed
before we support VK_EXT_rgba10x6_formats.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33389>
This commit is contained in:
Yiwei Zhang 2025-02-04 19:43:40 +00:00 committed by Marge Bot
parent f9fc7392fa
commit 5d440a7d97

View file

@ -2310,6 +2310,17 @@ vn_image_store_format_in_cache(
simple_mtx_unlock(&cache->mutex);
}
static inline void
vn_sanitize_image_format_properties(
const VkPhysicalDeviceImageFormatInfo2 *info,
VkImageFormatProperties2 *props)
{
/* TODO drop this after supporting VK_EXT_rgba10x6_formats */
if (info->format == VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16) {
props->imageFormatProperties.sampleCounts = VK_SAMPLE_COUNT_1_BIT;
}
}
VkResult
vn_GetPhysicalDeviceImageFormatProperties2(
VkPhysicalDevice physicalDevice,
@ -2449,6 +2460,11 @@ vn_GetPhysicalDeviceImageFormatProperties2(
result = vn_call_vkGetPhysicalDeviceImageFormatProperties2(
ring, physicalDevice, pImageFormatInfo, pImageFormatProperties);
if (result == VK_SUCCESS) {
vn_sanitize_image_format_properties(pImageFormatInfo,
pImageFormatProperties);
}
/* If cacheable, cache successful and unsupported results. */
if (cacheable &&
(result == VK_SUCCESS || result == VK_ERROR_FORMAT_NOT_SUPPORTED ||