From 226c152f55cfd388668c13946444ba60f840229c Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:11:55 -0600 Subject: [PATCH] nvk: Advertise depth/stencil support Part-of: --- src/nouveau/vulkan/nvk_image.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/nouveau/vulkan/nvk_image.c b/src/nouveau/vulkan/nvk_image.c index 6ff85bf669a..a487847c84c 100644 --- a/src/nouveau/vulkan/nvk_image.c +++ b/src/nouveau/vulkan/nvk_image.c @@ -44,8 +44,15 @@ nvk_get_image_format_features(struct nvk_physical_device *pdevice, features |= VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT; } - if (vk_format_is_depth_or_stencil(vk_format)) - return 0; /* TODO: Depth/stencil support */ + if (vk_format_is_depth_or_stencil(vk_format)) { + if (vk_format == VK_FORMAT_D32_SFLOAT_S8_UINT) + return 0; /* TODO */ + + if (!nil_format_supports_depth_stencil(pdevice->dev, p_format)) + return 0; + + features |= VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT; + } if (nil_format_supports_storage(pdevice->dev, p_format)) { features |= VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT |