mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-19 13:18:32 +00:00
c/util: Make COMP_VULKAN_FORMATS differentiate between depth-stencil, depth and stencil formats
This commit is contained in:
parent
5aa7ef25b8
commit
dea7bc847e
|
@ -374,7 +374,7 @@ comp_vulkan_formats_check(struct vk_bundle *vk, struct comp_vulkan_formats *form
|
|||
#define CHECK_DS(FORMAT) \
|
||||
formats->has_##FORMAT = is_format_supported(vk, VK_FORMAT_##FORMAT, XRT_SWAPCHAIN_USAGE_DEPTH_STENCIL);
|
||||
|
||||
COMP_VULKAN_FORMATS(CHECK_COLOR, CHECK_DS)
|
||||
COMP_VULKAN_FORMATS(CHECK_COLOR, CHECK_DS, CHECK_DS, CHECK_DS)
|
||||
|
||||
#undef CHECK_COLOR
|
||||
#undef CHECK_DS
|
||||
|
@ -390,7 +390,7 @@ comp_vulkan_formats_copy_to_info(const struct comp_vulkan_formats *formats, stru
|
|||
info->formats[format_count++] = VK_FORMAT_##FORMAT; \
|
||||
}
|
||||
|
||||
COMP_VULKAN_FORMATS(ADD_IF_SUPPORTED, ADD_IF_SUPPORTED)
|
||||
COMP_VULKAN_FORMATS(ADD_IF_SUPPORTED, ADD_IF_SUPPORTED, ADD_IF_SUPPORTED, ADD_IF_SUPPORTED)
|
||||
|
||||
#undef ADD_IF_SUPPORTED
|
||||
|
||||
|
@ -404,9 +404,9 @@ comp_vulkan_formats_log(enum u_logging_level log_level, const struct comp_vulkan
|
|||
#define PRINT_NAME(FORMAT) "\n\tVK_FORMAT_" #FORMAT ": %s"
|
||||
#define PRINT_BOOLEAN(FORMAT) , formats->has_##FORMAT ? "true" : "false"
|
||||
|
||||
U_LOG_IFL_I(log_level, "Supported formats:" //
|
||||
COMP_VULKAN_FORMATS(PRINT_NAME, PRINT_NAME) //
|
||||
COMP_VULKAN_FORMATS(PRINT_BOOLEAN, PRINT_BOOLEAN) //
|
||||
U_LOG_IFL_I(log_level, "Supported formats:" //
|
||||
COMP_VULKAN_FORMATS(PRINT_NAME, PRINT_NAME, PRINT_NAME, PRINT_NAME) //
|
||||
COMP_VULKAN_FORMATS(PRINT_BOOLEAN, PRINT_BOOLEAN, PRINT_BOOLEAN, PRINT_BOOLEAN) //
|
||||
);
|
||||
|
||||
#undef PRINT_NAME
|
||||
|
|
|
@ -115,7 +115,7 @@ comp_vulkan_init_bundle(struct vk_bundle *vk,
|
|||
|
||||
* @ingroup comp_util
|
||||
*/
|
||||
#define COMP_VULKAN_FORMATS(THING_COLOR, THING_DS) \
|
||||
#define COMP_VULKAN_FORMATS(THING_COLOR, THING_DS, THING_D, THING_S) \
|
||||
/* color formats */ \
|
||||
THING_COLOR(R16G16B16A16_UNORM) /* OGL VK */ \
|
||||
THING_COLOR(R16G16B16A16_SFLOAT) /* OGL VK */ \
|
||||
|
@ -130,14 +130,14 @@ comp_vulkan_init_bundle(struct vk_bundle *vk,
|
|||
THING_COLOR(B8G8R8_UNORM) /* VK - Uncommon. Bad color precision. */ \
|
||||
THING_COLOR(R5G6B5_UNORM_PACK16) /* OLG VK - Bad color precision. */ \
|
||||
/* depth formats */ \
|
||||
THING_DS(D32_SFLOAT) /* OGL VK */ \
|
||||
THING_DS(D16_UNORM) /* OGL VK */ \
|
||||
THING_DS(X8_D24_UNORM_PACK32) /* OGL VK */ \
|
||||
THING_D(D32_SFLOAT) /* OGL VK */ \
|
||||
THING_D(D16_UNORM) /* OGL VK */ \
|
||||
THING_D(X8_D24_UNORM_PACK32) /* OGL VK */ \
|
||||
/* depth stencil formats */ \
|
||||
THING_DS(D24_UNORM_S8_UINT) /* OGL VK */ \
|
||||
THING_DS(D32_SFLOAT_S8_UINT) /* OGL VK */ \
|
||||
/* stencil format */ \
|
||||
THING_DS(S8_UINT)
|
||||
THING_S(S8_UINT)
|
||||
|
||||
/*!
|
||||
* Struct with supported format, these are not only check for optimal flags
|
||||
|
@ -146,7 +146,7 @@ comp_vulkan_init_bundle(struct vk_bundle *vk,
|
|||
struct comp_vulkan_formats
|
||||
{
|
||||
#define FIELD(IDENT) bool has_##IDENT;
|
||||
COMP_VULKAN_FORMATS(FIELD, FIELD)
|
||||
COMP_VULKAN_FORMATS(FIELD, FIELD, FIELD, FIELD)
|
||||
#undef FIELD
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue