mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
vulkan: add helper for color/depth-stencil capable formats
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Acked-by: Ivan Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31983>
This commit is contained in:
parent
e18431273a
commit
294aa72449
1 changed files with 39 additions and 0 deletions
|
|
@ -112,6 +112,45 @@ vk_format_stencil_only(VkFormat format)
|
|||
return VK_FORMAT_S8_UINT;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
vk_format_is_color_depth_stencil_capable(VkFormat format)
|
||||
{
|
||||
/* Defines in the Vulkan Spec for VK_KHR_maintenance8 : "Compatible Formats
|
||||
* for Depth-Stencil to/from Color Copies"
|
||||
*/
|
||||
switch (format) {
|
||||
case VK_FORMAT_D32_SFLOAT:
|
||||
case VK_FORMAT_D32_SFLOAT_S8_UINT:
|
||||
case VK_FORMAT_R32_SFLOAT:
|
||||
case VK_FORMAT_R32_SINT:
|
||||
case VK_FORMAT_R32_UINT:
|
||||
return true;
|
||||
|
||||
case VK_FORMAT_X8_D24_UNORM_PACK32:
|
||||
case VK_FORMAT_D24_UNORM_S8_UINT:
|
||||
return true;
|
||||
|
||||
case VK_FORMAT_D16_UNORM:
|
||||
case VK_FORMAT_D16_UNORM_S8_UINT:
|
||||
case VK_FORMAT_R16_SFLOAT:
|
||||
case VK_FORMAT_R16_UNORM:
|
||||
case VK_FORMAT_R16_SNORM:
|
||||
case VK_FORMAT_R16_UINT:
|
||||
case VK_FORMAT_R16_SINT:
|
||||
return true;
|
||||
|
||||
case VK_FORMAT_S8_UINT:
|
||||
case VK_FORMAT_R8_UINT:
|
||||
case VK_FORMAT_R8_SINT:
|
||||
case VK_FORMAT_R8_UNORM:
|
||||
case VK_FORMAT_R8_SNORM:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void vk_component_mapping_to_pipe_swizzle(VkComponentMapping mapping,
|
||||
unsigned char out_swizzle[4]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue