vulkan/util: add vk_format_has_float_depth()

A small helper function to check if a format has a floating point depth
value.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31488>
This commit is contained in:
Sid Pranjale
2024-10-18 00:17:11 +05:30
committed by Marge Bot
parent 0f2363993d
commit aa417da964

View File

@@ -93,6 +93,18 @@ vk_format_depth_only(VkFormat format)
} }
} }
static inline bool
vk_format_has_float_depth(VkFormat format)
{
switch (format) {
case VK_FORMAT_D32_SFLOAT:
case VK_FORMAT_D32_SFLOAT_S8_UINT:
return true;
default:
return false;
}
}
static inline VkFormat static inline VkFormat
vk_format_stencil_only(VkFormat format) vk_format_stencil_only(VkFormat format)
{ {