gallium: Remove s3tc enablement leftovers

This part has been removed from Mesa since commit 3a8a5e77e8f992aaa3539e060885138c2fcddad1
as the patent expired in 2017.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Corentin Noël 3 years ago committed by Gert Wollny
parent b904137c84
commit eae4e44566
  1. 54
      src/gallium/auxiliary/util/u_format.c
  2. 72
      src/gallium/auxiliary/util/u_format.h
  3. 7
      src/gallium/auxiliary/util/u_format_s3tc.h

@ -40,28 +40,6 @@
#include "pipe/p_defines.h" #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 */ /** Test if the format contains RGB, but not alpha */
boolean boolean
util_format_has_alpha(enum pipe_format format) util_format_has_alpha(enum pipe_format format)
@ -205,38 +183,6 @@ util_format_is_intensity(enum pipe_format format)
return FALSE; 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 * 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 * for UNORM and unbound depth buffers. When the depth buffer is floating

@ -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 static inline boolean
util_format_is_srgb(enum pipe_format format) 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 boolean
util_format_has_alpha(enum pipe_format format); util_format_has_alpha(enum pipe_format format);
@ -501,9 +439,6 @@ util_format_is_luminance_alpha(enum pipe_format format);
boolean boolean
util_format_is_intensity(enum pipe_format format); util_format_is_intensity(enum pipe_format format);
boolean
util_format_is_subsampled_422(enum pipe_format format);
boolean boolean
util_format_is_pure_integer(enum pipe_format format); 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, util_is_format_compatible(const struct util_format_description *src_desc,
const struct util_format_description *dst_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. * Whether this format is a rgab8 variant.
* *

@ -40,11 +40,4 @@ enum util_format_dxtn {
UTIL_FORMAT_DXT5_RGBA = 0x83F3 UTIL_FORMAT_DXT5_RGBA = 0x83F3
}; };
extern boolean util_format_s3tc_enabled;
void
util_format_s3tc_init(void);
#endif #endif

Loading…
Cancel
Save