From d396544fe1326e1be87cf75d043be3ce9f0e8e41 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jun 2025 13:56:00 -0400 Subject: [PATCH] nvk: Allow sparse binding of YCbCr images We support sparse binding, just not sparse residency. While we're here, we change the check to plane_count > 1, which is the real requirement. Part-of: --- src/nouveau/vulkan/nvk_image.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nouveau/vulkan/nvk_image.c b/src/nouveau/vulkan/nvk_image.c index 8088aaa9758..22745a45427 100644 --- a/src/nouveau/vulkan/nvk_image.c +++ b/src/nouveau/vulkan/nvk_image.c @@ -592,9 +592,12 @@ nvk_GetPhysicalDeviceImageFormatProperties2( (pImageFormatInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT)) return VK_ERROR_FORMAT_NOT_SUPPORTED; + /* We don't support sparse residency for multi-plane images. While we + * could probably support sparse for VK_FORMAT_B8G8R8G8_422_UNORM, we + * disable it because the standard block sizes are funky. + */ if (ycbcr_info && - ((pImageFormatInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) || - (pImageFormatInfo->flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT))) + (pImageFormatInfo->flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT)) return VK_ERROR_FORMAT_NOT_SUPPORTED; if ((pImageFormatInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) &&