From 684531fd37ca3aa15dfb34f34ada10615ff66864 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 16 Nov 2020 08:55:10 +0100 Subject: [PATCH] radv: add new vk_format_is_*() helpers I think we should make RADV uses util_format everywhere. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/vk_format.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/amd/vulkan/vk_format.h b/src/amd/vulkan/vk_format.h index b46093c56b7..29db70e7261 100644 --- a/src/amd/vulkan/vk_format.h +++ b/src/amd/vulkan/vk_format.h @@ -30,6 +30,7 @@ #include #include #include +#include enum vk_format_layout { /** @@ -436,6 +437,24 @@ vk_format_is_int(VkFormat format) return channel >= 0 && desc->channel[channel].pure_integer; } +static inline bool +vk_format_is_uint(VkFormat format) +{ + return util_format_is_pure_uint(vk_format_to_pipe_format(format)); +} + +static inline bool +vk_format_is_sint(VkFormat format) +{ + return util_format_is_pure_sint(vk_format_to_pipe_format(format)); +} + +static inline bool +vk_format_is_unorm(VkFormat format) +{ + return util_format_is_unorm(vk_format_to_pipe_format(format)); +} + static inline bool vk_format_is_srgb(VkFormat format) {