hk: ban sparse host-image-copy

WTF?

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33682>
This commit is contained in:
Alyssa Rosenzweig 2025-01-29 12:09:17 -05:00 committed by Marge Bot
parent 739807944d
commit 3e7297a297

View file

@ -345,6 +345,19 @@ hk_GetPhysicalDeviceImageFormatProperties2(
pdev, plane_format, pImageFormatInfo->tiling);
}
}
/* Sparse + host-image-copy doesn't make sense. Forbid it. */
if (pImageFormatInfo->flags & (VK_IMAGE_CREATE_SPARSE_ALIASED_BIT |
VK_IMAGE_CREATE_SPARSE_BINDING_BIT |
VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT))
features &= ~VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT;
if (pImageFormatInfo->flags & (VK_IMAGE_CREATE_SPARSE_ALIASED_BIT |
VK_IMAGE_CREATE_SPARSE_BINDING_BIT |
VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) &&
(pImageFormatInfo->usage & VK_IMAGE_USAGE_HOST_TRANSFER_BIT))
return VK_ERROR_FORMAT_NOT_SUPPORTED;
if (features == 0)
return VK_ERROR_FORMAT_NOT_SUPPORTED;