util/format: add util_format_is_astc_hdr()-helper

This will be used later in the series.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35132>
This commit is contained in:
Erik Faye-Lund 2025-05-23 12:55:46 +02:00 committed by Marge Bot
parent ccc7833f16
commit 6cd898dbc2

View file

@ -559,6 +559,30 @@ util_format_is_etc(enum pipe_format format)
return desc->layout == UTIL_FORMAT_LAYOUT_ETC ? true : false;
}
static inline bool
util_format_is_astc_hdr(enum pipe_format format)
{
switch (format) {
case PIPE_FORMAT_ASTC_4x4_FLOAT:
case PIPE_FORMAT_ASTC_5x4_FLOAT:
case PIPE_FORMAT_ASTC_5x5_FLOAT:
case PIPE_FORMAT_ASTC_6x5_FLOAT:
case PIPE_FORMAT_ASTC_6x6_FLOAT:
case PIPE_FORMAT_ASTC_8x5_FLOAT:
case PIPE_FORMAT_ASTC_8x6_FLOAT:
case PIPE_FORMAT_ASTC_8x8_FLOAT:
case PIPE_FORMAT_ASTC_10x5_FLOAT:
case PIPE_FORMAT_ASTC_10x6_FLOAT:
case PIPE_FORMAT_ASTC_10x8_FLOAT:
case PIPE_FORMAT_ASTC_10x10_FLOAT:
case PIPE_FORMAT_ASTC_12x10_FLOAT:
case PIPE_FORMAT_ASTC_12x12_FLOAT:
return true;
default:
return false;;
}
}
static inline bool
util_format_is_srgb(enum pipe_format format)
{