mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 09:58:05 +02:00
util/format: Add util_format_is_unorm16()
Detects 16 bpc unorm formats. Used by following RGB[A]16 UNORM display enablement commits. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38588>
This commit is contained in:
parent
2c9775b339
commit
1fe73481ba
1 changed files with 11 additions and 0 deletions
|
|
@ -1347,6 +1347,17 @@ util_format_is_unorm8(const struct util_format_description *desc)
|
|||
return desc->is_unorm && desc->is_array && desc->channel[c].size == 8;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
util_format_is_unorm16(const struct util_format_description *desc)
|
||||
{
|
||||
int c = util_format_get_first_non_void_channel(desc->format);
|
||||
|
||||
if (c == -1)
|
||||
return false;
|
||||
|
||||
return desc->is_unorm && desc->is_array && desc->channel[c].size == 16;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
util_format_is_int64(const struct util_format_description *desc)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue