mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
turnip: add format_is_uint/format_is_sint
Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
This commit is contained in:
parent
12ede7565f
commit
eb67d9f0f3
1 changed files with 22 additions and 0 deletions
|
|
@ -448,6 +448,28 @@ vk_format_is_int(VkFormat format)
|
|||
return channel >= 0 && desc->channel[channel].pure_integer;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue