Commit c5d50802 authored by Matt Turner's avatar Matt Turner

mesa: Drop Mesa_DXTn from gl_context

Reviewed-by: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
parent 78c6221f
......@@ -100,9 +100,6 @@ intelInitExtensions(struct gl_context *ctx)
ctx->Extensions.ARB_occlusion_query = true;
}
if (intel->ctx.Mesa_DXTn
|| driQueryOptionb(&intel->optionCache, "force_s3tc_enable"))
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
......@@ -301,8 +301,6 @@ intelInitExtensions(struct gl_context *ctx)
if (ctx->API != API_OPENGL_CORE)
ctx->Extensions.ARB_color_buffer_float = true;
if (ctx->Mesa_DXTn || driQueryOptionb(&brw->optionCache, "force_s3tc_enable"))
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
......@@ -451,10 +451,8 @@ nv10_context_create(struct nouveau_screen *screen, gl_api api,
ctx->Extensions.EXT_texture_env_dot3 = true;
ctx->Extensions.NV_fog_distance = true;
ctx->Extensions.NV_texture_rectangle = true;
if (ctx->Mesa_DXTn) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
/* GL constants. */
ctx->Const.MaxTextureLevels = 12;
......
......@@ -462,10 +462,8 @@ nv20_context_create(struct nouveau_screen *screen, gl_api api,
ctx->Extensions.EXT_texture_env_dot3 = true;
ctx->Extensions.NV_fog_distance = true;
ctx->Extensions.NV_texture_rectangle = true;
if (ctx->Mesa_DXTn) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
/* GL constants. */
ctx->Const.MaxTextureCoordUnits = NV20_TEXTURE_UNITS;
......
......@@ -363,14 +363,8 @@ GLboolean r200CreateContext( gl_api api,
others get the bit ordering right but don't actually do YUV-RGB conversion */
ctx->Extensions.MESA_ycbcr_texture = true;
}
if (rmesa->radeon.glCtx.Mesa_DXTn) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
else if (driQueryOptionb (&rmesa->radeon.optionCache, "force_s3tc_enable")) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
#if 0
r200InitDriverFuncs( ctx );
......
......@@ -311,14 +311,8 @@ r100CreateContext( gl_api api,
ctx->Extensions.NV_texture_rectangle = true;
ctx->Extensions.OES_EGL_image = true;
if (rmesa->radeon.glCtx.Mesa_DXTn) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
else if (driQueryOptionb (&rmesa->radeon.optionCache, "force_s3tc_enable")) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
ctx->Extensions.EXT_texture_compression_s3tc = true;
ctx->Extensions.ANGLE_texture_compression_dxt = true;
/* XXX these should really go right after _mesa_init_driver_functions() */
radeon_fbo_init(&rmesa->radeon);
......
......@@ -866,8 +866,6 @@ init_attrib_groups(struct gl_context *ctx)
if (!_mesa_init_texture( ctx ))
return GL_FALSE;
_mesa_init_texture_s3tc( ctx );
/* Miscellaneous */
ctx->NewState = _NEW_ALL;
ctx->NewDriverState = ~0;
......
......@@ -177,10 +177,8 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
ctx->Extensions.OES_standard_derivatives = GL_TRUE;
ctx->Extensions.TDFX_texture_compression_FXT1 = GL_TRUE;
if (ctx->Mesa_DXTn) {
ctx->Extensions.ANGLE_texture_compression_dxt = GL_TRUE;
ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE;
}
ctx->Extensions.ANGLE_texture_compression_dxt = GL_TRUE;
ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE;
}
/**
......
......@@ -4974,9 +4974,6 @@ struct gl_context
*/
GLboolean HasConfig;
/** software compression/decompression supported or not */
GLboolean Mesa_DXTn;
GLboolean TextureFormatSupported[MESA_FORMAT_COUNT];
GLboolean RasterDiscard; /**< GL_RASTERIZER_DISCARD */
......
......@@ -43,13 +43,6 @@
#include "util/format_srgb.h"
void
_mesa_init_texture_s3tc( struct gl_context *ctx )
{
/* called during context initialization */
ctx->Mesa_DXTn = GL_TRUE;
}
/**
* Store user's image in rgb_dxt1 format.
*/
......
......@@ -44,9 +44,6 @@ extern GLboolean
_mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS);
extern void
_mesa_init_texture_s3tc(struct gl_context *ctx);
extern compressed_fetch_func
_mesa_get_dxt_fetch_func(mesa_format format);
......
......@@ -249,9 +249,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
* 1D ARRAY textures in S3TC format.
*/
if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) {
if (ctx->Mesa_DXTn)
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1);
}
RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_UNORM8);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM);
......@@ -260,9 +258,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
case GL_COMPRESSED_RGBA_ARB:
/* We don't use texture compression for 1D and 1D array textures. */
if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) {
if (ctx->Mesa_DXTn)
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */
}
RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
......@@ -502,15 +498,13 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
RETURN_IF_SUPPORTED(MESA_FORMAT_A8R8G8B8_SRGB);
break;
case GL_COMPRESSED_SRGB_EXT:
if (ctx->Mesa_DXTn)
RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1);
RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1);
RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_SRGB8);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB);
RETURN_IF_SUPPORTED(MESA_FORMAT_A8R8G8B8_SRGB);
break;
case GL_COMPRESSED_SRGB_ALPHA_EXT:
if (ctx->Mesa_DXTn)
RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); /* Not srgba_dxt1, see spec */
RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); /* Not srgba_dxt1, see spec */
RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SRGB);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB);
RETURN_IF_SUPPORTED(MESA_FORMAT_A8R8G8B8_SRGB);
......
......@@ -2769,38 +2769,6 @@ _mesa_choose_texture_format(struct gl_context *ctx,
}
}
/* If the application requested compression to an S3TC format but we don't
* have the DXTn library, force a generic compressed format instead.
*/
if (internalFormat != format && format != GL_NONE) {
const GLenum before = internalFormat;
switch (internalFormat) {
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
if (!ctx->Mesa_DXTn)
internalFormat = GL_COMPRESSED_RGB;
break;
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
if (!ctx->Mesa_DXTn)
internalFormat = GL_COMPRESSED_RGBA;
break;
default:
break;
}
if (before != internalFormat) {
_mesa_warning(ctx,
"DXT compression requested (%s), "
"but libtxc_dxtn library not installed. Using %s "
"instead.",
_mesa_enum_to_string(before),
_mesa_enum_to_string(internalFormat));
}
}
/* choose format from scratch */
f = ctx->Driver.ChooseTextureFormat(ctx, target, internalFormat,
format, type);
assert(f != MESA_FORMAT_NONE);
......
......@@ -406,7 +406,7 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
/* GL limits and extensions */
st_init_limits(pipe->screen, &ctx->Const, &ctx->Extensions);
st_init_extensions(pipe->screen, &ctx->Const,
&ctx->Extensions, &st->options, ctx->Mesa_DXTn);
&ctx->Extensions, &st->options, GL_TRUE);
if (st_have_perfmon(st)) {
ctx->Extensions.AMD_performance_monitor = GL_TRUE;
......
......@@ -2280,13 +2280,13 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
}
pFormat = st_choose_format(st, internalFormat, format, type,
pTarget, 0, bindings, ctx->Mesa_DXTn);
pTarget, 0, bindings, GL_TRUE);
if (pFormat == PIPE_FORMAT_NONE && !is_renderbuffer) {
/* try choosing format again, this time without render target bindings */
pFormat = st_choose_format(st, internalFormat, format, type,
pTarget, 0, PIPE_BIND_SAMPLER_VIEW,
ctx->Mesa_DXTn);
GL_TRUE);
}
if (pFormat == PIPE_FORMAT_NONE) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment