a/vk: Even more flag bits string functions

This commit is contained in:
Jakob Bornecrantz 2023-08-25 17:01:46 +01:00
parent d905f79025
commit 648a168219
2 changed files with 30 additions and 0 deletions

View file

@ -598,6 +598,27 @@ vk_surface_transform_flag_string(VkSurfaceTransformFlagBitsKHR bits, bool null_o
}
}
#ifdef VK_KHR_display
XRT_CHECK_RESULT const char *
vk_display_plane_alpha_flag_string(VkDisplayPlaneAlphaFlagBitsKHR bits, bool null_on_unknown)
{
switch (bits) {
ENUM_TO_STR(VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR);
ENUM_TO_STR(VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR);
ENUM_TO_STR(VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR);
ENUM_TO_STR(VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR);
default:
if (bits == 0) {
return "DISPLAY PLANE ALPHA: NO BITS SET";
} else if (bits & (bits - 1)) {
return "DISPLAY PLANE ALPHA: MULTIPLE BITS SET";
} else {
return null_on_unknown ? NULL : "DISPLAY PLANE ALPHA: UNKNOWN BIT";
}
}
}
#endif
XRT_CHECK_RESULT const char *
xrt_swapchain_usage_flag_string(enum xrt_swapchain_usage_bits bits, bool null_on_unknown)
{

View file

@ -496,6 +496,15 @@ vk_composite_alpha_flag_string(VkCompositeAlphaFlagBitsKHR bits, bool null_on_un
XRT_CHECK_RESULT const char *
vk_surface_transform_flag_string(VkSurfaceTransformFlagBitsKHR bits, bool null_on_unknown);
#ifdef VK_KHR_display
/*!
* Returns the display plane alpha flag if one valid bit is set,
* if multiple bits are set, will return 'MULTIPLE BIT SET'.
*/
XRT_CHECK_RESULT const char *
vk_display_plane_alpha_flag_string(VkDisplayPlaneAlphaFlagBitsKHR bits, bool null_on_unknown);
#endif
/*!
* Returns xrt swapchain_usage flag if one valid bit is set,
* if multiple bits are set, will return 'MULTIPLE BIT SET'.