diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c index cda6aa7..16d4cbf 100644 --- a/src/gallium/auxiliary/util/u_format.c +++ b/src/gallium/auxiliary/util/u_format.c @@ -40,28 +40,6 @@ #include "pipe/p_defines.h" -boolean util_format_s3tc_enabled = FALSE; - -boolean -util_format_is_float(enum pipe_format format) -{ - const struct util_format_description *desc = util_format_description(format); - int i; - - assert(desc); - if (!desc) { - return FALSE; - } - - i = util_format_get_first_non_void_channel(format); - if (i == -1) { - return FALSE; - } - - return desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT ? TRUE : FALSE; -} - - /** Test if the format contains RGB, but not alpha */ boolean util_format_has_alpha(enum pipe_format format) @@ -205,38 +183,6 @@ util_format_is_intensity(enum pipe_format format) return FALSE; } -boolean -util_format_is_subsampled_422(enum pipe_format format) -{ - const struct util_format_description *desc = - util_format_description(format); - - return desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED && - desc->block.width == 2 && - desc->block.height == 1 && - desc->block.bits == 32; -} - -boolean -util_format_is_supported(enum pipe_format format, unsigned bind) -{ - if (util_format_is_s3tc(format) && !util_format_s3tc_enabled) { - return FALSE; - } - -#ifndef TEXTURE_FLOAT_ENABLED - if ((bind & PIPE_BIND_RENDER_TARGET) && - format != PIPE_FORMAT_R9G9B9E5_FLOAT && - format != PIPE_FORMAT_R11G11B10_FLOAT && - util_format_is_float(format)) { - return FALSE; - } -#endif - - return TRUE; -} - - /** * Calculates the MRD for the depth format. MRD is used in depth bias * for UNORM and unbound depth buffers. When the depth buffer is floating diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 978b920..912ea10 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -318,19 +318,6 @@ util_format_is_compressed(enum pipe_format format) } } -static inline boolean -util_format_is_s3tc(enum pipe_format format) -{ - const struct util_format_description *desc = util_format_description(format); - - assert(desc); - if (!desc) { - return FALSE; - } - - return desc->layout == UTIL_FORMAT_LAYOUT_S3TC ? TRUE : FALSE; -} - static inline boolean util_format_is_srgb(enum pipe_format format) { @@ -435,55 +422,6 @@ util_format_get_mask(enum pipe_format format) } } -/** - * Give the RGBA colormask of the channels that can be represented in this - * format. - * - * That is, the channels whose values are preserved. - */ -static inline unsigned -util_format_colormask(const struct util_format_description *desc) -{ - unsigned colormask; - unsigned chan; - - switch (desc->colorspace) { - case UTIL_FORMAT_COLORSPACE_RGB: - case UTIL_FORMAT_COLORSPACE_SRGB: - case UTIL_FORMAT_COLORSPACE_YUV: - colormask = 0; - for (chan = 0; chan < 4; ++chan) { - if (desc->swizzle[chan] < 4) { - colormask |= (1 << chan); - } - } - return colormask; - case UTIL_FORMAT_COLORSPACE_ZS: - return 0; - default: - assert(0); - return 0; - } -} - - -/** - * Checks if color mask covers every channel for the specified format - * - * @param desc a format description to check colormask with - * @param colormask a bit mask for channels, matches format of PIPE_MASK_RGBA - */ -static inline boolean -util_format_colormask_full(const struct util_format_description *desc, unsigned colormask) -{ - return (~colormask & util_format_colormask(desc)) == 0; -} - - -boolean -util_format_is_float(enum pipe_format format); - - boolean util_format_has_alpha(enum pipe_format format); @@ -501,9 +439,6 @@ util_format_is_luminance_alpha(enum pipe_format format); boolean util_format_is_intensity(enum pipe_format format); -boolean -util_format_is_subsampled_422(enum pipe_format format); - boolean util_format_is_pure_integer(enum pipe_format format); @@ -525,13 +460,6 @@ boolean util_is_format_compatible(const struct util_format_description *src_desc, const struct util_format_description *dst_desc); -/** - * Whether the format is supported by Gallium for the given bindings. - * This covers S3TC textures and floating-point render targets. - */ -boolean -util_format_is_supported(enum pipe_format format, unsigned bind); - /** * Whether this format is a rgab8 variant. * diff --git a/src/gallium/auxiliary/util/u_format_s3tc.h b/src/gallium/auxiliary/util/u_format_s3tc.h index 33531a7..da6c139 100644 --- a/src/gallium/auxiliary/util/u_format_s3tc.h +++ b/src/gallium/auxiliary/util/u_format_s3tc.h @@ -40,11 +40,4 @@ enum util_format_dxtn { UTIL_FORMAT_DXT5_RGBA = 0x83F3 }; - -extern boolean util_format_s3tc_enabled; - - -void -util_format_s3tc_init(void); - #endif