mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 13:28:06 +02:00
gallium/aux: add is_unorm() helper
We already had one for is_snorm() but not unorm. Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
85cd4df47f
commit
532f8c0043
2 changed files with 24 additions and 0 deletions
|
|
@ -169,6 +169,27 @@ util_format_is_snorm(enum pipe_format format)
|
|||
desc->channel[i].normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if all non-void channels are normalized unsigned.
|
||||
*/
|
||||
boolean
|
||||
util_format_is_unorm(enum pipe_format format)
|
||||
{
|
||||
const struct util_format_description *desc = util_format_description(format);
|
||||
int i;
|
||||
|
||||
if (desc->is_mixed)
|
||||
return FALSE;
|
||||
|
||||
i = util_format_get_first_non_void_channel(format);
|
||||
if (i == -1)
|
||||
return FALSE;
|
||||
|
||||
return desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED &&
|
||||
!desc->channel[i].pure_integer &&
|
||||
desc->channel[i].normalized;
|
||||
}
|
||||
|
||||
boolean
|
||||
util_format_is_snorm8(enum pipe_format format)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -726,6 +726,9 @@ util_format_is_pure_uint(enum pipe_format format);
|
|||
boolean
|
||||
util_format_is_snorm(enum pipe_format format);
|
||||
|
||||
boolean
|
||||
util_format_is_unorm(enum pipe_format format);
|
||||
|
||||
boolean
|
||||
util_format_is_snorm8(enum pipe_format format);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue