From 363119641498dac65e813f2057ff9f7424217064 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sun, 28 Jul 2024 11:31:39 -0500 Subject: [PATCH] nvk: Disable sparse D32S8 cubes pre-Turing Part-of: --- src/nouveau/vulkan/nvk_image.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/nouveau/vulkan/nvk_image.c b/src/nouveau/vulkan/nvk_image.c index 7c2182f2dbf..88516f50607 100644 --- a/src/nouveau/vulkan/nvk_image.c +++ b/src/nouveau/vulkan/nvk_image.c @@ -20,6 +20,7 @@ #include "clb097.h" #include "clb197.h" #include "clc097.h" +#include "clc597.h" static VkFormatFeatureFlags2 nvk_get_image_plane_format_features(struct nvk_physical_device *pdev, @@ -354,6 +355,16 @@ nvk_GetPhysicalDeviceImageFormatProperties2( pdev->info.cls_eng3d < MAXWELL_B) return VK_ERROR_FORMAT_NOT_SUPPORTED; + /* Don't allow sparse on D32S8 cube maps. The hardware doesn't seem to + * handle these correctly and hard-faults instead of the expected soft + * fault when there's sparse VA. + */ + if (pImageFormatInfo->format == VK_FORMAT_D32_SFLOAT_S8_UINT && + (pImageFormatInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) && + (pImageFormatInfo->flags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) && + pdev->info.cls_eng3d < TURING_A) + return VK_ERROR_FORMAT_NOT_SUPPORTED; + /* From the Vulkan 1.3.279 spec: * * VUID-VkImageCreateInfo-tiling-04121