radv: add new vk_format_is_*() helpers

I think we should make RADV uses util_format everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7512>
This commit is contained in:
Samuel Pitoiset 2020-11-16 08:55:10 +01:00 committed by Marge Bot
parent a5227465c1
commit 684531fd37

View file

@ -30,6 +30,7 @@
#include <assert.h>
#include <vulkan/vulkan.h>
#include <util/macros.h>
#include <vulkan/util/vk_format.h>
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)
{