vulkan: Move common format function to vulkan/util/vk_format.h

Moving duplicate vk_format helper functions to common
vulkan/util/vk_format.h and also renaming
vk_format_get_component_size_in_bits to match how amd and
freedreno name the same function. Not moving this function
to common code as freedreno's implementation is a bit different.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15696>
This commit is contained in:
Rajnesh Kanwal
2022-03-30 19:42:20 +01:00
committed by Marge Bot
parent 9f6571e80a
commit d5405c1608
5 changed files with 21 additions and 36 deletions
+12
View File
@@ -170,6 +170,18 @@ vk_format_get_nr_components(VkFormat format)
return util_format_get_nr_components(vk_format_to_pipe_format(format));
}
static inline bool
vk_format_has_alpha(VkFormat format)
{
return util_format_has_alpha(vk_format_to_pipe_format(format));
}
static inline unsigned
vk_format_get_blocksizebits(VkFormat format)
{
return util_format_get_blocksizebits(vk_format_to_pipe_format(format));
}
#ifdef __cplusplus
}
#endif