From: José Fonseca Date: Fri, 18 Jul 2008 13:22:22 +0000 (+0900) Subject: gallium: Add a pf_is_ycbcr utility function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=583b9ccbd5961678fa7e594c3117d7c895ef6b41;p=mesa.git gallium: Add a pf_is_ycbcr utility function. --- diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index fefb8fdf1b7..947c4455835 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -522,15 +522,13 @@ pf_get_nblocks(const struct pipe_format_block *block, unsigned width, unsigned h static INLINE boolean pf_is_compressed( enum pipe_format format ) { - switch (format) { - case PIPE_FORMAT_DXT1_RGB: - case PIPE_FORMAT_DXT1_RGBA: - case PIPE_FORMAT_DXT3_RGBA: - case PIPE_FORMAT_DXT5_RGBA: - return TRUE; - default: - return FALSE; - } + return pf_layout(format) == PIPE_FORMAT_LAYOUT_DXT ? TRUE : FALSE; +} + +static INLINE boolean +pf_is_ycbcr( enum pipe_format format ) +{ + return pf_layout(format) == PIPE_FORMAT_LAYOUT_YCBCR ? TRUE : FALSE; } #ifdef __cplusplus