diff options
-rw-r--r-- | src/freedreno/vulkan/vk_format.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/freedreno/vulkan/vk_format.h b/src/freedreno/vulkan/vk_format.h index 4e13bc9c02d..bbf7a5d81b9 100644 --- a/src/freedreno/vulkan/vk_format.h +++ b/src/freedreno/vulkan/vk_format.h @@ -449,6 +449,28 @@ vk_format_is_int(VkFormat format) } static inline bool +vk_format_is_uint(VkFormat format) +{ + const struct vk_format_description *desc = vk_format_description(format); + int channel = vk_format_get_first_non_void_channel(format); + + return channel >= 0 && + desc->channel[channel].pure_integer && + desc->channel[channel].type != VK_FORMAT_TYPE_SIGNED; +} + +static inline bool +vk_format_is_sint(VkFormat format) +{ + const struct vk_format_description *desc = vk_format_description(format); + int channel = vk_format_get_first_non_void_channel(format); + + return channel >= 0 && + desc->channel[channel].pure_integer && + desc->channel[channel].type == VK_FORMAT_TYPE_SIGNED; +} + +static inline bool vk_format_is_srgb(VkFormat format) { const struct vk_format_description *desc = vk_format_description(format); |