mesa: Use a single flag for the S3TC extensions that don't require on-line compression
authorIan Romanick <ian.d.romanick@intel.com>
Sat, 1 Dec 2012 20:02:04 +0000 (12:02 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 24 Jan 2013 04:38:04 +0000 (23:38 -0500)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Lee Salzman <lsalzman@gmail.com>
13 files changed:
src/mesa/drivers/dri/intel/intel_extensions.c
src/mesa/drivers/dri/nouveau/nv10_context.c
src/mesa/drivers/dri/nouveau/nv20_context.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/x11/xm_api.c
src/mesa/main/extensions.c
src/mesa/main/glformats.c
src/mesa/main/mtypes.h
src/mesa/main/texcompress.c
src/mesa/main/texformat.c
src/mesa/main/teximage.c
src/mesa/state_tracker/st_extensions.c

index e237e022f269589c96e656c4da5248e740b49fe8..78b928db53df361cd25e402da4a0441b0d4c0d0d 100755 (executable)
@@ -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;
index 97fc84d0a85ea747d44b1adb47425d227ee29683..7eda4e0f9177b66965b6c0b0bfcec0b7b62eba5a 100644 (file)
@@ -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. */
index 52013fd200808c6703e7814ba9c8f67b74b287f4..68e90d2c67f95cd918f81b5a5ca91568881dc2e1 100644 (file)
@@ -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. */
index 1e0239b4e53c2f3e4c055e02a18d45c7cf677f48..ee666831bb8349efce01b94e316dfc68d98c59cb 100644 (file)
@@ -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;
index f81e81f49a6e71951a99909ebd240b9589e971b4..a2f222819e637a05a76badfe2a197565cd2f0269 100644 (file)
@@ -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;
index f0c5957f089bf7ce2649bbaa028dcdd9fd518bb2..5931f5b40001b7a4473918c109a22b65cf237379 100644 (file)
@@ -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
index fd25d31c6af70e5927dfca030c04686a7e3906ae..375978e8270cefee67328315210f533465a4c53a 100644 (file)
@@ -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 },
index e4f784179c28511b6fda4f2dba7fc50151654f5c..fc8bc2e3c3c5e63a9e289ff86e0faa79e981067b 100644 (file)
@@ -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:
index ead75d50eb545dde183204ca46e330381f5943ad..d37e6c4c04d79d865c1aa4121666b6ce0dc58c19 100644 (file)
@@ -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;
index 077a967da7ea1b7e1d76f9620d9e2e171d4bf8a1..734294e4536da7fc84d980587f864b5ec8b7850b 100644 (file)
@@ -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;
index 4fb4b70f973834dfe49385494d989c542381eb76..b0ff6ec73c31efe41be663e6be7bcb9150925304 100644 (file)
@@ -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:
index 24a55106147287de0499e6f97f8e0d2747f7c00e..fdeecf3cfd44b7d321de70cbb1dd7cb3e4f66a17 100644 (file)
@@ -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:
index 17fe16ee36de7f6f82b1247c7af64a17363cdc66..18d89815db73f061b73e048d5784a2573dc62354 100644 (file)
@@ -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,