aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-12-01 12:02:04 -0800
committerIan Romanick <[email protected]>2013-01-23 23:38:04 -0500
commita021881ccdaf1d81fb7c8bef4b58b4c037dc4f44 (patch)
treed4a9d8d0df948ca77926dcb876d01834f43300ac /src/mesa
parent8059c2ea9011110df3632e28a4311de9373b9b4e (diff)
mesa: Use a single flag for the S3TC extensions that don't require on-line compression
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Lee Salzman <[email protected]>
Diffstat (limited to 'src/mesa')
-rwxr-xr-xsrc/mesa/drivers/dri/intel/intel_extensions.c1
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_context.c2
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_context.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.c3
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_context.c3
-rw-r--r--src/mesa/drivers/x11/xm_api.c2
-rw-r--r--src/mesa/main/extensions.c4
-rw-r--r--src/mesa/main/glformats.c3
-rw-r--r--src/mesa/main/mtypes.h1
-rw-r--r--src/mesa/main/texcompress.c4
-rw-r--r--src/mesa/main/texformat.c7
-rw-r--r--src/mesa/main/teximage.c3
-rw-r--r--src/mesa/state_tracker/st_extensions.c4
13 files changed, 22 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
index e237e022f26..78b928db53d 100755
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -180,7 +180,6 @@ intelInitExtensions(struct gl_context *ctx)
if (intel->ctx.Mesa_DXTn) {
ctx->Extensions.ANGLE_texture_compression_dxt = true;
ctx->Extensions.EXT_texture_compression_s3tc = true;
- ctx->Extensions.S3_s3tc = true;
}
else if (driQueryOptionb(&intel->optionCache, "force_s3tc_enable")) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c
index 97fc84d0a85..7eda4e0f917 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_context.c
@@ -451,7 +451,7 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
ctx->Extensions.NV_texture_rectangle = true;
if (ctx->Mesa_DXTn) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
- ctx->Extensions.S3_s3tc = true;
+ ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
/* GL constants. */
diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c
index 52013fd2008..68e90d2c67f 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_context.c
@@ -462,7 +462,7 @@ nv20_context_create(struct nouveau_screen *screen, const struct gl_config *visua
ctx->Extensions.NV_texture_rectangle = true;
if (ctx->Mesa_DXTn) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
- ctx->Extensions.S3_s3tc = true;
+ ctx->Extensions.ANGLE_texture_compression_dxt = true;
}
/* GL constants. */
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 1e0239b4e53..ee666831bb8 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -409,10 +409,11 @@ GLboolean r200CreateContext( gl_api api,
}
if (rmesa->radeon.glCtx.Mesa_DXTn) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
- ctx->Extensions.S3_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.ARB_texture_cube_map = true;
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index f81e81f49a6..a2f222819e6 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -361,10 +361,11 @@ r100CreateContext( gl_api api,
if (rmesa->radeon.glCtx.Mesa_DXTn) {
ctx->Extensions.EXT_texture_compression_s3tc = true;
- ctx->Extensions.S3_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.NV_texture_rectangle = true;
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index f0c5957f089..5931f5b4000 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -929,7 +929,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
_mesa_enable_2_1_extensions(mesaCtx);
if (mesaCtx->Mesa_DXTn) {
_mesa_enable_extension(mesaCtx, "GL_EXT_texture_compression_s3tc");
- _mesa_enable_extension(mesaCtx, "GL_S3_s3tc");
+ _mesa_enable_extension(mesaCtx, "GL_ANGLE_texture_compression_dxt");
}
_mesa_enable_extension(mesaCtx, "GL_3DFX_texture_compression_FXT1");
#if ENABLE_EXT_timer_query
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index fd25d31c6af..375978e8270 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -201,7 +201,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_subtexture", o(dummy_true), GLL, 1995 },
{ "GL_EXT_texture3D", o(EXT_texture3D), GLL, 1996 },
{ "GL_EXT_texture_array", o(EXT_texture_array), GL, 2006 },
- { "GL_EXT_texture_compression_dxt1", o(EXT_texture_compression_s3tc), GL | ES1 | ES2, 2004 },
+ { "GL_EXT_texture_compression_dxt1", o(ANGLE_texture_compression_dxt), GL | ES1 | ES2, 2004 },
{ "GL_ANGLE_texture_compression_dxt3", o(ANGLE_texture_compression_dxt), ES2, 2011 },
{ "GL_ANGLE_texture_compression_dxt5", o(ANGLE_texture_compression_dxt), ES2, 2011 },
{ "GL_EXT_texture_compression_latc", o(EXT_texture_compression_latc), GL, 2006 },
@@ -321,7 +321,7 @@ static const struct extension extension_table[] = {
{ "GL_NV_texture_barrier", o(NV_texture_barrier), GL, 2009 },
{ "GL_NV_texture_env_combine4", o(NV_texture_env_combine4), GLL, 1999 },
{ "GL_NV_texture_rectangle", o(NV_texture_rectangle), GLL, 2000 },
- { "GL_S3_s3tc", o(S3_s3tc), GL, 1999 },
+ { "GL_S3_s3tc", o(ANGLE_texture_compression_dxt), GL, 1999 },
{ "GL_SGIS_generate_mipmap", o(dummy_true), GLL, 1997 },
{ "GL_SGIS_texture_border_clamp", o(ARB_texture_border_clamp), GLL, 1997 },
{ "GL_SGIS_texture_edge_clamp", o(dummy_true), GLL, 1997 },
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index e4f784179c2..fc8bc2e3c3c 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -878,7 +878,8 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format)
case GL_RGB4_S3TC:
case GL_RGBA_S3TC:
case GL_RGBA4_S3TC:
- return _mesa_is_desktop_gl(ctx) && ctx->Extensions.S3_s3tc;
+ return _mesa_is_desktop_gl(ctx) &&
+ ctx->Extensions.ANGLE_texture_compression_dxt;
case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index ead75d50eb5..d37e6c4c04d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3130,7 +3130,6 @@ struct gl_extensions
GLboolean NV_texture_env_combine4;
GLboolean NV_texture_rectangle;
GLboolean TDFX_texture_compression_FXT1;
- GLboolean S3_s3tc;
GLboolean OES_EGL_image;
GLboolean OES_draw_texture;
GLboolean OES_depth_texture_cube_map;
diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
index 077a967da7e..734294e4536 100644
--- a/src/mesa/main/texcompress.c
+++ b/src/mesa/main/texcompress.c
@@ -37,6 +37,7 @@
#include "formats.h"
#include "mfeatures.h"
#include "mtypes.h"
+#include "context.h"
#include "texcompress.h"
#include "texcompress_fxt1.h"
#include "texcompress_rgtc.h"
@@ -264,7 +265,8 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
n += 3;
}
}
- if (ctx->Extensions.S3_s3tc) {
+ if (_mesa_is_desktop_gl(ctx)
+ && ctx->Extensions.ANGLE_texture_compression_dxt) {
if (formats) {
formats[n++] = GL_RGB_S3TC;
formats[n++] = GL_RGB4_S3TC;
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 4fb4b70f973..b0ff6ec73c3 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -251,7 +251,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
*/
if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) {
if (ctx->Extensions.EXT_texture_compression_s3tc ||
- ctx->Extensions.S3_s3tc)
+ ctx->Extensions.ANGLE_texture_compression_dxt)
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1);
if (ctx->Extensions.TDFX_texture_compression_FXT1)
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1);
@@ -264,7 +264,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
/* We don't use texture compression for 1D and 1D array textures. */
if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) {
if (ctx->Extensions.EXT_texture_compression_s3tc ||
- ctx->Extensions.S3_s3tc)
+ ctx->Extensions.ANGLE_texture_compression_dxt)
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */
if (ctx->Extensions.TDFX_texture_compression_FXT1)
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1);
@@ -329,7 +329,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
}
}
- if (ctx->Extensions.S3_s3tc) {
+ if (_mesa_is_desktop_gl(ctx)
+ && ctx->Extensions.ANGLE_texture_compression_dxt) {
switch (internalFormat) {
case GL_RGB_S3TC:
case GL_RGB4_S3TC:
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 24a55106147..fdeecf3cfd4 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -215,7 +215,8 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
}
}
- if (ctx->Extensions.S3_s3tc) {
+ if (_mesa_is_desktop_gl(ctx)
+ && ctx->Extensions.ANGLE_texture_compression_dxt) {
switch (internalFormat) {
case GL_RGB_S3TC:
case GL_RGB4_S3TC:
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 17fe16ee36d..18d89815db7 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -454,7 +454,7 @@ void st_init_extensions(struct st_context *st)
PIPE_FORMAT_LATC2_SNORM } },
{ { o(EXT_texture_compression_s3tc),
- o(S3_s3tc) },
+ o(ANGLE_texture_compression_dxt) },
{ PIPE_FORMAT_DXT1_RGB,
PIPE_FORMAT_DXT1_RGBA,
PIPE_FORMAT_DXT3_RGBA,
@@ -611,7 +611,7 @@ void st_init_extensions(struct st_context *st)
if (!ctx->Mesa_DXTn && !st_get_s3tc_override()) {
ctx->Extensions.EXT_texture_compression_s3tc = GL_FALSE;
- ctx->Extensions.S3_s3tc = GL_FALSE;
+ ctx->Extensions.ANGLE_texture_compression_dxt = GL_FALSE;
}
if (screen->get_shader_param(screen, PIPE_SHADER_GEOMETRY,