Make GL_ARB_texture_compression mandatory
authorIan Romanick <idr@freedesktop.org>
Wed, 28 Jan 2009 01:36:03 +0000 (17:36 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 29 Jan 2009 00:28:10 +0000 (16:28 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
22 files changed:
src/mesa/drivers/dri/common/utils.c
src/mesa/drivers/dri/i810/i810context.c
src/mesa/drivers/dri/intel/intel_extensions.c
src/mesa/drivers/dri/mach64/mach64_tex.c
src/mesa/drivers/dri/mga/mga_xmesa.c
src/mesa/drivers/dri/r128/r128_context.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/savage/savage_xmesa.c
src/mesa/drivers/dri/sis/sis_context.c
src/mesa/drivers/dri/tdfx/tdfx_context.c
src/mesa/drivers/glide/fxdd.c
src/mesa/main/attrib.c
src/mesa/main/extensions.c
src/mesa/main/get.c
src/mesa/main/get_gen.py
src/mesa/main/hint.c
src/mesa/main/texcompress.c
src/mesa/main/texformat.c
src/mesa/main/teximage.c
src/mesa/main/texparam.c

index 30c860b96c59d1f868a81ad66d447e36847d5323..7bee52577024380829e8bc829b3bfa34c71a3b03 100644 (file)
@@ -180,6 +180,7 @@ driGetRendererString( char * buffer, const char * hardware_name,
 
 
 #define need_GL_ARB_multisample
+#define need_GL_ARB_texture_compression
 #define need_GL_ARB_transpose_matrix
 #define need_GL_ARB_window_pos
 #define need_GL_EXT_compiled_vertex_array
@@ -199,6 +200,7 @@ driGetRendererString( char * buffer, const char * hardware_name,
 
 static const struct dri_extension all_mesa_extensions[] = {
    { "GL_ARB_multisample",           GL_ARB_multisample_functions },
+   { "GL_ARB_texture_compression",   GL_ARB_texture_compression_functions },
    { "GL_ARB_transpose_matrix",      GL_ARB_transpose_matrix_functions },
    { "GL_ARB_window_pos",            GL_ARB_window_pos_functions },
    { "GL_EXT_blend_func_separate",   GL_EXT_blend_func_separate_functions },
index c281a4990e453e179e24781d3ef42f402fd847a2..29c7363b49f71c7a6e31ed7e234c7d15e016bb11 100644 (file)
@@ -64,7 +64,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "utils.h"
 
 #define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #include "extension_helper.h"
 
@@ -125,7 +124,6 @@ const struct dri_extension card_extensions[] =
 {
     { "GL_ARB_multisample",                GL_ARB_multisample_functions },
     { "GL_ARB_multitexture",               NULL },
-    { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
     { "GL_ARB_texture_env_add",            NULL },
     { "GL_ARB_texture_env_combine",        NULL },
     { "GL_ARB_texture_env_crossbar",       NULL },
index 8f09f8d64576111edae645df48ae6c76e3095471..9030af113bf38f5fcb46028fae4b4857606f0433 100644 (file)
@@ -35,7 +35,6 @@
 #define need_GL_ARB_occlusion_query
 #define need_GL_ARB_point_parameters
 #define need_GL_ARB_shader_objects
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_ARB_vertex_program
 #define need_GL_ARB_vertex_shader
@@ -72,7 +71,6 @@ static const struct dri_extension card_extensions[] = {
    { "GL_ARB_multitexture",               NULL },
    { "GL_ARB_point_parameters",           GL_ARB_point_parameters_functions },
    { "GL_ARB_texture_border_clamp",       NULL },
-   { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
    { "GL_ARB_texture_cube_map",           NULL },
    { "GL_ARB_texture_env_add",            NULL },
    { "GL_ARB_texture_env_combine",        NULL },
index 1f9d3c57ebe960994b0e985da9e8afbebb16f03c..9fe267eafd5795b328dadffc766e975aae4df9ad 100644 (file)
@@ -152,6 +152,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
    case GL_ALPHA8:
    case GL_ALPHA12:
    case GL_ALPHA16:
+   case GL_COMPRESSED_ALPHA:
    case 2:
    case GL_LUMINANCE_ALPHA:
    case GL_LUMINANCE4_ALPHA4:
@@ -160,9 +161,11 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
    case GL_LUMINANCE12_ALPHA4:
    case GL_LUMINANCE12_ALPHA12:
    case GL_LUMINANCE16_ALPHA16:
+   case GL_COMPRESSED_LUMINANCE_ALPHA:
    case 4:
    case GL_RGBA:
    case GL_RGBA2:
+   case GL_COMPRESSED_RGBA:
       if (mmesa->mach64Screen->cpp == 4)
          return &_mesa_texformat_argb8888;
       else
@@ -193,6 +196,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
    case GL_RGB10:
    case GL_RGB12:
    case GL_RGB16:
+   case GL_COMPRESSED_RGB:
       if (mmesa->mach64Screen->cpp == 4)
          return &_mesa_texformat_argb8888;
       else
@@ -204,6 +208,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
    case GL_LUMINANCE8:
    case GL_LUMINANCE12:
    case GL_LUMINANCE16:
+   case GL_COMPRESSED_LUMINANCE:
       if (mmesa->mach64Screen->cpp == 4)
          return &_mesa_texformat_argb8888; /* inefficient but accurate */
       else
@@ -214,6 +219,7 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
    case GL_INTENSITY8:
    case GL_INTENSITY12:
    case GL_INTENSITY16:
+   case GL_COMPRESSED_INTENSITY:
       if (mmesa->mach64Screen->cpp == 4)
          return &_mesa_texformat_argb8888; /* inefficient but accurate */
       else
index 86da3a2cacffde60b3c95f0146ea0781ddd25ac6..0ebffe9e130ff10deda91fa53943928ac6bd7182 100644 (file)
@@ -70,7 +70,6 @@
 #include "GL/internal/dri_interface.h"
 
 #define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_ARB_vertex_program
 #define need_GL_EXT_fog_coord
@@ -386,7 +385,6 @@ static const struct dri_extension g400_extensions[] =
 static const struct dri_extension card_extensions[] =
 {
    { "GL_ARB_multisample",            GL_ARB_multisample_functions },
-   { "GL_ARB_texture_compression",    GL_ARB_texture_compression_functions },
    { "GL_ARB_texture_rectangle",      NULL },
    { "GL_ARB_vertex_buffer_object",   GL_ARB_vertex_buffer_object_functions },
    { "GL_EXT_blend_logic_op",         NULL },
index 535a98cc01f17a2bd04c9ad074c96777d8c7eb22..9437d900c36f8c63a5bbf92ea70154d27c1b2ce7 100644 (file)
@@ -66,7 +66,6 @@ int R128_DEBUG = 0;
 #endif
 
 #define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_EXT_blend_minmax
 #define need_GL_EXT_fog_coord
@@ -77,7 +76,6 @@ const struct dri_extension card_extensions[] =
 {
     { "GL_ARB_multisample",                GL_ARB_multisample_functions },
     { "GL_ARB_multitexture",               NULL },
-    { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
     { "GL_ARB_texture_env_add",            NULL },
     { "GL_ARB_texture_mirrored_repeat",    NULL },
     { "GL_ARB_vertex_buffer_object",       GL_ARB_vertex_buffer_object_functions },
index 5531e0a73998e915461983547739465712d6bdbb..cdd96ef2d35a50c56acd6683e74bd33edc91e36f 100644 (file)
@@ -63,7 +63,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "r200_vertprog.h"
 
 #define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_ARB_vertex_program
 #define need_GL_ATI_fragment_shader
@@ -123,7 +122,6 @@ const struct dri_extension card_extensions[] =
     { "GL_ARB_multisample",                GL_ARB_multisample_functions },
     { "GL_ARB_multitexture",               NULL },
     { "GL_ARB_texture_border_clamp",       NULL },
-    { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
     { "GL_ARB_texture_env_add",            NULL },
     { "GL_ARB_texture_env_combine",        NULL },
     { "GL_ARB_texture_env_dot3",           NULL },
index dc4cd5731de6060f73e84ccf243c92fe4db4602d..4f7afbc20c15d5ab40f35704a7848e559d57135b 100644 (file)
@@ -80,7 +80,6 @@ int hw_tcl_on = 1;
 #define need_GL_VERSION_2_0
 #define need_GL_ARB_multisample
 #define need_GL_ARB_point_parameters
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_ARB_vertex_program
 #define need_GL_EXT_blend_equation_separate
@@ -105,7 +104,6 @@ const struct dri_extension card_extensions[] = {
   {"GL_ARB_shadow",                    NULL},
   {"GL_ARB_shadow_ambient",            NULL},
   {"GL_ARB_texture_border_clamp",      NULL},
-  {"GL_ARB_texture_compression",       GL_ARB_texture_compression_functions},
   {"GL_ARB_texture_cube_map",          NULL},
   {"GL_ARB_texture_env_add",           NULL},
   {"GL_ARB_texture_env_combine",       NULL},
index 1e992c0b3d62aff5d126e0fc32f3ac7ece819ad0..cc34f2421403e823a7a467446e2c95a8e6fe3dfe 100644 (file)
@@ -63,7 +63,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "radeon_maos.h"
 
 #define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_EXT_blend_minmax
 #define need_GL_EXT_fog_coord
@@ -117,7 +116,6 @@ const struct dri_extension card_extensions[] =
     { "GL_ARB_multisample",                GL_ARB_multisample_functions },
     { "GL_ARB_multitexture",               NULL },
     { "GL_ARB_texture_border_clamp",       NULL },
-    { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
     { "GL_ARB_texture_env_add",            NULL },
     { "GL_ARB_texture_env_combine",        NULL },
     { "GL_ARB_texture_env_crossbar",       NULL },
index a344aab71bbd6e2063fe0caa6b76de8994fb010c..d9dd28a7e6aea97ad5e12133dfc02ec25b39dc57 100644 (file)
@@ -60,7 +60,6 @@
 #include "texmem.h"
 
 #define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_EXT_secondary_color
 #include "extension_helper.h"
@@ -135,7 +134,6 @@ static const struct dri_extension card_extensions[] =
 {
     { "GL_ARB_multisample",                GL_ARB_multisample_functions },
     { "GL_ARB_multitexture",               NULL },
-    { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
     { "GL_ARB_vertex_buffer_object",       GL_ARB_vertex_buffer_object_functions },
     { "GL_EXT_stencil_wrap",               NULL },
     { "GL_EXT_texture_lod_bias",           NULL },
index 00d17da3bad39af1c704124a7bed05c363256c93..ce3a583b3b100157e31632b7a16ee5922f000ce1 100644 (file)
@@ -58,7 +58,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "tnl/t_pipeline.h"
 
 #define need_GL_ARB_multisample
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 #define need_GL_EXT_fog_coord
 #define need_GL_EXT_secondary_color
@@ -77,7 +76,6 @@ struct dri_extension card_extensions[] =
     { "GL_ARB_multisample",                GL_ARB_multisample_functions },
     { "GL_ARB_multitexture",               NULL },
     { "GL_ARB_texture_border_clamp",       NULL },
-    { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
     { "GL_ARB_texture_mirrored_repeat",    NULL },
     { "GL_ARB_vertex_buffer_object",       GL_ARB_vertex_buffer_object_functions },
     /*{ "GL_EXT_fog_coord",                  GL_EXT_fog_coord_functions },*/
@@ -93,7 +91,6 @@ struct dri_extension card_extensions_6326[] =
 {
     { "GL_ARB_multisample",                GL_ARB_multisample_functions },
     /*{ "GL_ARB_texture_border_clamp",       NULL },*/
-    { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
     /*{ "GL_ARB_texture_mirrored_repeat",    NULL },*/
     /*{ "GL_MESA_ycbcr_texture",             NULL },*/
     { NULL,                                NULL }
index ef688d103d32699502970e0833e3c010f15a6136..53672daa97540cfa8249f5af631037ca14b5c175 100644 (file)
@@ -61,7 +61,6 @@
 #define need_GL_ARB_multisample
 /* #define need_GL_ARB_point_parameters */
 #define need_GL_ARB_occlusion_query
-#define need_GL_ARB_texture_compression
 #define need_GL_ARB_vertex_buffer_object
 /* #define need_GL_ARB_vertex_program */
 #define need_GL_EXT_blend_equation_separate
@@ -122,7 +121,6 @@ const struct dri_extension card_extensions[] =
  */
 const struct dri_extension napalm_extensions[] =
 {
-    { "GL_ARB_texture_compression",        GL_ARB_texture_compression_functions },
     { "GL_ARB_texture_env_combine",        NULL },
     { "GL_EXT_blend_equation_separate",    GL_EXT_blend_equation_separate_functions },
     { "GL_EXT_blend_subtract",             GL_EXT_blend_minmax_functions },
index 213ef2382feaad5db265bc964c147a20aaf9ef0a..f2d52cb49342d6ff7bd9bb25b642300d02a32584 100644 (file)
@@ -1862,7 +1862,6 @@ fxDDInitExtensions(GLcontext * ctx)
    }
 
    if (fxMesa->type >= GR_SSTTYPE_Voodoo4) {
-      _mesa_enable_extension(ctx, "GL_ARB_texture_compression");
       _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
       _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
       _mesa_enable_extension(ctx, "GL_S3_s3tc");
@@ -1894,7 +1893,6 @@ fxDDInitExtensions(GLcontext * ctx)
        * fxSetupSingleTMU_NoLock/fxSetupDoubleTMU_NoLock:
        *    grTexDownloadTable(GR_TEXTABLE_NCC0, &(ti->palette));
        */
-      /*_mesa_enable_extension(ctx, "GL_ARB_texture_compression");*/
       _mesa_enable_extension(ctx, "GL_SGIS_generate_mipmap");
    }
 
index 3be7fd5a2d6be8888f119dbed01de711893b95e8..36586758a4f7136c8b4531a07ae17075be3b358f 100644 (file)
@@ -1006,9 +1006,8 @@ _mesa_PopAttrib(void)
                _mesa_Hint(GL_FOG_HINT, hint->Fog);
                _mesa_Hint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT,
                           hint->ClipVolumeClipping);
-               if (ctx->Extensions.ARB_texture_compression)
-                  _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB,
-                             hint->TextureCompression);
+              _mesa_Hint(GL_TEXTURE_COMPRESSION_HINT_ARB,
+                         hint->TextureCompression);
             }
             break;
          case GL_LIGHTING_BIT:
index 4ebdb5d9aeacbc8f6ccc3fd485252b9ce66f5bd7..46ca2ce76631dd20e4c0af10bb70b915fef716da 100644 (file)
@@ -64,7 +64,7 @@ static const struct {
    { OFF, "GL_ARB_shadow",                     F(ARB_shadow) },
    { OFF, "GL_ARB_shadow_ambient",             F(ARB_shadow_ambient) },
    { OFF, "GL_ARB_texture_border_clamp",       F(ARB_texture_border_clamp) },
-   { OFF, "GL_ARB_texture_compression",        F(ARB_texture_compression) },
+   { ON,  "GL_ARB_texture_compression",        F(ARB_texture_compression) },
    { OFF, "GL_ARB_texture_cube_map",           F(ARB_texture_cube_map) },
    { OFF, "GL_ARB_texture_env_add",            F(EXT_texture_env_add) },
    { OFF, "GL_ARB_texture_env_combine",        F(ARB_texture_env_combine) },
@@ -345,7 +345,7 @@ _mesa_enable_1_3_extensions(GLcontext *ctx)
    ctx->Extensions.ARB_multisample = GL_TRUE;
    ctx->Extensions.ARB_multitexture = GL_TRUE;
    ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
-   ctx->Extensions.ARB_texture_compression = GL_TRUE;
+   /*ctx->Extensions.ARB_texture_compression = GL_TRUE;*/
    ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
    ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
    ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
index a5909913c80532698ecda47efdd45a3e1fe07437..d214ddc890d5613674732eecbdb4ae5cfb5b7d72 100644 (file)
@@ -1078,15 +1078,12 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
          params[0] = INT_TO_BOOLEAN((1 << (ctx->Const.MaxCubeTextureLevels - 1)));
          break;
       case GL_TEXTURE_COMPRESSION_HINT_ARB:
-         CHECK_EXT1(ARB_texture_compression, "GetBooleanv");
          params[0] = INT_TO_BOOLEAN(ctx->Hint.TextureCompression);
          break;
       case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
-         CHECK_EXT1(ARB_texture_compression, "GetBooleanv");
          params[0] = INT_TO_BOOLEAN(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE));
          break;
       case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
-         CHECK_EXT1(ARB_texture_compression, "GetBooleanv");
          {
          GLint formats[100];
          GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
@@ -2930,15 +2927,12 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
          params[0] = (GLfloat)((1 << (ctx->Const.MaxCubeTextureLevels - 1)));
          break;
       case GL_TEXTURE_COMPRESSION_HINT_ARB:
-         CHECK_EXT1(ARB_texture_compression, "GetFloatv");
          params[0] = (GLfloat)(ctx->Hint.TextureCompression);
          break;
       case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
-         CHECK_EXT1(ARB_texture_compression, "GetFloatv");
          params[0] = (GLfloat)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE));
          break;
       case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
-         CHECK_EXT1(ARB_texture_compression, "GetFloatv");
          {
          GLint formats[100];
          GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
@@ -4782,15 +4776,12 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
          params[0] = (1 << (ctx->Const.MaxCubeTextureLevels - 1));
          break;
       case GL_TEXTURE_COMPRESSION_HINT_ARB:
-         CHECK_EXT1(ARB_texture_compression, "GetIntegerv");
          params[0] = ctx->Hint.TextureCompression;
          break;
       case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB:
-         CHECK_EXT1(ARB_texture_compression, "GetIntegerv");
          params[0] = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE);
          break;
       case GL_COMPRESSED_TEXTURE_FORMATS_ARB:
-         CHECK_EXT1(ARB_texture_compression, "GetIntegerv");
          {
          GLint formats[100];
          GLuint i, n = _mesa_get_compressed_formats(ctx, formats, GL_FALSE);
index 4bdbfed0bffeb2826f64c26c50d57a5a03cbe543..c4d0aa9cc94cb5b82f48b7e2d68c07a45883f76d 100644 (file)
@@ -523,10 +523,10 @@ StateVars = [
 
        # GL_ARB_texture_compression */
        ( "GL_TEXTURE_COMPRESSION_HINT_ARB", GLint,
-         ["ctx->Hint.TextureCompression"], "", ["ARB_texture_compression"] ),
+         ["ctx->Hint.TextureCompression"], "", None ),
        ( "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB", GLint,
          ["_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)"],
-         "", ["ARB_texture_compression"] ),
+         "", None ),
        ( "GL_COMPRESSED_TEXTURE_FORMATS_ARB", GLenum,
          [],
          """GLint formats[100];
@@ -534,7 +534,7 @@ StateVars = [
          ASSERT(n <= 100);
          for (i = 0; i < n; i++)
             params[i] = CONVERSION(formats[i]);""",
-         ["ARB_texture_compression"] ),
+         None ),
 
        # GL_EXT_compiled_vertex_array
        ( "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", GLint, ["ctx->Array.LockFirst"],
index dcfa9c7363f82eafbeacffc4858712df70118ba3..e2d4129a3821535a825ca0d3f224c8687ef12229 100644 (file)
@@ -89,10 +89,6 @@ _mesa_Hint( GLenum target, GLenum mode )
 
       /* GL_ARB_texture_compression */
       case GL_TEXTURE_COMPRESSION_HINT_ARB:
-         if (!ctx->Extensions.ARB_texture_compression) {
-            _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
-           return;
-         }
         if (ctx->Hint.TextureCompression == mode)
            return;
         FLUSH_VERTICES(ctx, _NEW_HINT);
index 3ff633acd2bd1d0a03c2c1eb2d49c2e83ee97ff9..09eba151c0616cd63320f39645c9951981fbb8fd 100644 (file)
@@ -56,60 +56,58 @@ GLuint
 _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all)
 {
    GLuint n = 0;
-   if (ctx->Extensions.ARB_texture_compression) {
-      if (ctx->Extensions.TDFX_texture_compression_FXT1) {
-         if (formats) {
-            formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX;
-            formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX;
-         }
-         else {
-            n += 2;
-         }
+   if (ctx->Extensions.TDFX_texture_compression_FXT1) {
+      if (formats) {
+         formats[n++] = GL_COMPRESSED_RGB_FXT1_3DFX;
+         formats[n++] = GL_COMPRESSED_RGBA_FXT1_3DFX;
       }
-      if (ctx->Extensions.EXT_texture_compression_s3tc) {
-         if (formats) {
-            formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
-            /* This format has some restrictions/limitations and so should
-             * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query.
-             * Specifically, all transparent pixels become black.  NVIDIA
-             * omits this format too.
-             */
-            if (all)
-               formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
-            formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
-            formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
-         }
-         else {
-            n += 3;
-            if (all)
-               n += 1;
-         }
+      else {
+         n += 2;
       }
-      if (ctx->Extensions.S3_s3tc) {
-         if (formats) {
-            formats[n++] = GL_RGB_S3TC;
-            formats[n++] = GL_RGB4_S3TC;
-            formats[n++] = GL_RGBA_S3TC;
-            formats[n++] = GL_RGBA4_S3TC;
-         }
-         else {
-            n += 4;
-         }
+   }
+   if (ctx->Extensions.EXT_texture_compression_s3tc) {
+      if (formats) {
+         formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+         /* This format has some restrictions/limitations and so should
+          * not be returned via the GL_COMPRESSED_TEXTURE_FORMATS query.
+          * Specifically, all transparent pixels become black.  NVIDIA
+          * omits this format too.
+          */
+         if (all)
+             formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+         formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+         formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+      }
+      else {
+         n += 3;
+         if (all)
+             n += 1;
+      }
+   }
+   if (ctx->Extensions.S3_s3tc) {
+      if (formats) {
+         formats[n++] = GL_RGB_S3TC;
+         formats[n++] = GL_RGB4_S3TC;
+         formats[n++] = GL_RGBA_S3TC;
+         formats[n++] = GL_RGBA4_S3TC;
+      }
+      else {
+         n += 4;
       }
+   }
 #if FEATURE_EXT_texture_sRGB
-      if (ctx->Extensions.EXT_texture_sRGB) {
-         if (formats) {
-            formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
-            formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
-            formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
-            formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
-         }
-         else {
-            n += 4;
-         }
+   if (ctx->Extensions.EXT_texture_sRGB) {
+      if (formats) {
+         formats[n++] = GL_COMPRESSED_SRGB_S3TC_DXT1_EXT;
+         formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
+         formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
+         formats[n++] = GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
+      }
+      else {
+         n += 4;
       }
-#endif /* FEATURE_EXT_texture_sRGB */
    }
+#endif /* FEATURE_EXT_texture_sRGB */
    return n;
 }
 
index 08725846c6e939710133ffb9c6ac59ccf930afaa..ffbb7fb19dc41eae959dc532ccd04161c47b33fa 100644 (file)
@@ -1481,41 +1481,39 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
       }
    }
 
-   if (ctx->Extensions.ARB_texture_compression) {
-      switch (internalFormat) {
-         case GL_COMPRESSED_ALPHA_ARB:
-            return &_mesa_texformat_alpha;
-         case GL_COMPRESSED_LUMINANCE_ARB:
-            return &_mesa_texformat_luminance;
-         case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
-            return &_mesa_texformat_luminance_alpha;
-         case GL_COMPRESSED_INTENSITY_ARB:
-            return &_mesa_texformat_intensity;
-         case GL_COMPRESSED_RGB_ARB:
+   switch (internalFormat) {
+      case GL_COMPRESSED_ALPHA_ARB:
+         return &_mesa_texformat_alpha;
+      case GL_COMPRESSED_LUMINANCE_ARB:
+         return &_mesa_texformat_luminance;
+      case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
+         return &_mesa_texformat_luminance_alpha;
+      case GL_COMPRESSED_INTENSITY_ARB:
+         return &_mesa_texformat_intensity;
+      case GL_COMPRESSED_RGB_ARB:
 #if FEATURE_texture_fxt1
-            if (ctx->Extensions.TDFX_texture_compression_FXT1)
-               return &_mesa_texformat_rgb_fxt1;
+         if (ctx->Extensions.TDFX_texture_compression_FXT1)
+            return &_mesa_texformat_rgb_fxt1;
 #endif
 #if FEATURE_texture_s3tc
-            if (ctx->Extensions.EXT_texture_compression_s3tc ||
-                ctx->Extensions.S3_s3tc)
-               return &_mesa_texformat_rgb_dxt1;
+         if (ctx->Extensions.EXT_texture_compression_s3tc ||
+             ctx->Extensions.S3_s3tc)
+            return &_mesa_texformat_rgb_dxt1;
 #endif
-            return &_mesa_texformat_rgb;
-         case GL_COMPRESSED_RGBA_ARB:
+         return &_mesa_texformat_rgb;
+      case GL_COMPRESSED_RGBA_ARB:
 #if FEATURE_texture_fxt1
-            if (ctx->Extensions.TDFX_texture_compression_FXT1)
-               return &_mesa_texformat_rgba_fxt1;
+         if (ctx->Extensions.TDFX_texture_compression_FXT1)
+            return &_mesa_texformat_rgba_fxt1;
 #endif
 #if FEATURE_texture_s3tc
-            if (ctx->Extensions.EXT_texture_compression_s3tc ||
-                ctx->Extensions.S3_s3tc)
-               return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */
+         if (ctx->Extensions.EXT_texture_compression_s3tc ||
+             ctx->Extensions.S3_s3tc)
+            return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */
 #endif
-            return &_mesa_texformat_rgba;
-         default:
-            ; /* fallthrough */
-      }
+         return &_mesa_texformat_rgba;
+      default:
+         ; /* fallthrough */
    }
 
    if (ctx->Extensions.MESA_ycbcr_texture) {
index 9e968ba743428d9cee444f7f7dfffec20375b12f..2f594532cca04644fc46798017f82f79eaf1d293 100644 (file)
@@ -253,23 +253,21 @@ _mesa_base_tex_format( GLcontext *ctx, GLint internalFormat )
       }
    }
 
-   if (ctx->Extensions.ARB_texture_compression) {
-      switch (internalFormat) {
-         case GL_COMPRESSED_ALPHA:
-            return GL_ALPHA;
-         case GL_COMPRESSED_LUMINANCE:
-            return GL_LUMINANCE;
-         case GL_COMPRESSED_LUMINANCE_ALPHA:
-            return GL_LUMINANCE_ALPHA;
-         case GL_COMPRESSED_INTENSITY:
-            return GL_INTENSITY;
-         case GL_COMPRESSED_RGB:
-            return GL_RGB;
-         case GL_COMPRESSED_RGBA:
-            return GL_RGBA;
-         default:
-            ; /* fallthrough */
-      }
+   switch (internalFormat) {
+   case GL_COMPRESSED_ALPHA:
+      return GL_ALPHA;
+   case GL_COMPRESSED_LUMINANCE:
+      return GL_LUMINANCE;
+   case GL_COMPRESSED_LUMINANCE_ALPHA:
+      return GL_LUMINANCE_ALPHA;
+   case GL_COMPRESSED_INTENSITY:
+      return GL_INTENSITY;
+   case GL_COMPRESSED_RGB:
+      return GL_RGB;
+   case GL_COMPRESSED_RGBA:
+      return GL_RGBA;
+   default:
+      ; /* fallthrough */
    }
          
    if (ctx->Extensions.TDFX_texture_compression_FXT1) {
index f610fa8dda4d8b45595bf1920dd56374e5d05728..8df22fe9e2e0a5321549435c82b88602bfd1f9d8 100644 (file)
@@ -849,33 +849,21 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level,
 
       /* GL_ARB_texture_compression */
       case GL_TEXTURE_COMPRESSED_IMAGE_SIZE:
-         if (ctx->Extensions.ARB_texture_compression) {
-            if (img->IsCompressed && !isProxy) {
-               /* Don't use ctx->Driver.CompressedTextureSize() since that
-                * may returned a padded hardware size.
-                */
-               *params = _mesa_compressed_texture_size(ctx, img->Width,
-                                                   img->Height, img->Depth,
-                                                   img->TexFormat->MesaFormat);
-            }
-            else {
-               _mesa_error(ctx, GL_INVALID_OPERATION,
-                           "glGetTexLevelParameter[if]v(pname)");
-            }
-         }
-         else {
-            _mesa_error(ctx, GL_INVALID_ENUM,
-                        "glGetTexLevelParameter[if]v(pname)");
-         }
+        if (img->IsCompressed && !isProxy) {
+           /* Don't use ctx->Driver.CompressedTextureSize() since that
+            * may returned a padded hardware size.
+            */
+           *params = _mesa_compressed_texture_size(ctx, img->Width,
+                                                   img->Height, img->Depth,
+                                                   img->TexFormat->MesaFormat);
+        }
+        else {
+           _mesa_error(ctx, GL_INVALID_OPERATION,
+                       "glGetTexLevelParameter[if]v(pname)");
+        }
          break;
       case GL_TEXTURE_COMPRESSED:
-         if (ctx->Extensions.ARB_texture_compression) {
-            *params = (GLint) img->IsCompressed;
-         }
-         else {
-            _mesa_error(ctx, GL_INVALID_ENUM,
-                        "glGetTexLevelParameter[if]v(pname)");
-         }
+         *params = (GLint) img->IsCompressed;
          break;
 
       /* GL_ARB_texture_float */