Mesa (master): mesa: Force GL_SGIS_generate_mipmap to always be enabled

Ian Romanick idr at kemper.freedesktop.org
Mon Sep 27 15:31:42 PDT 2010


Module: Mesa
Branch: master
Commit: 7f11d471e6bafae2282ec82ba4a19d30c440d28f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7f11d471e6bafae2282ec82ba4a19d30c440d28f

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Sep 27 14:55:52 2010 -0700

mesa: Force GL_SGIS_generate_mipmap to always be enabled

As per discussions at XDS.

---

 src/mesa/drivers/dri/i810/i810context.c        |    1 -
 src/mesa/drivers/dri/intel/intel_extensions.c  |    1 -
 src/mesa/drivers/dri/mach64/mach64_context.c   |    1 -
 src/mesa/drivers/dri/mga/mga_xmesa.c           |    1 -
 src/mesa/drivers/dri/nouveau/nouveau_context.c |    1 -
 src/mesa/drivers/dri/r128/r128_context.c       |    1 -
 src/mesa/drivers/dri/r200/r200_context.c       |    1 -
 src/mesa/drivers/dri/r300/r300_context.c       |    1 -
 src/mesa/drivers/dri/r600/r600_context.c       |    1 -
 src/mesa/drivers/dri/radeon/radeon_context.c   |    1 -
 src/mesa/drivers/dri/tdfx/tdfx_context.c       |    2 -
 src/mesa/main/extensions.c                     |    6 ++--
 src/mesa/main/hint.c                           |    4 ---
 src/mesa/main/texparam.c                       |   28 +++++------------------
 14 files changed, 9 insertions(+), 41 deletions(-)

diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c
index 49f3ee8..8f52c20 100644
--- a/src/mesa/drivers/dri/i810/i810context.c
+++ b/src/mesa/drivers/dri/i810/i810context.c
@@ -127,7 +127,6 @@ static const struct dri_extension card_extensions[] =
     { "GL_EXT_texture_rectangle",          NULL },
     { "GL_MESA_ycbcr_texture",             NULL },
     { "GL_NV_blend_square",                NULL },
-    { "GL_SGIS_generate_mipmap",           NULL },
     { NULL,                                NULL }
 };
 
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
index 112f71d..a946ee4 100644
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -130,7 +130,6 @@ static const struct dri_extension card_extensions[] = {
    { "GL_NV_blend_square",                NULL },
    { "GL_NV_vertex_program",              GL_NV_vertex_program_functions },
    { "GL_NV_vertex_program1_1",           NULL },
-   { "GL_SGIS_generate_mipmap",           NULL },
 #if FEATURE_OES_EGL_image
    { "GL_OES_EGL_image",                  GL_OES_EGL_image_functions },
 #endif
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c
index 72a44d9..a20a1c9 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.c
+++ b/src/mesa/drivers/dri/mach64/mach64_context.c
@@ -79,7 +79,6 @@ static const struct dri_extension card_extensions[] =
     { "GL_ARB_multitexture",               NULL },
     { "GL_EXT_texture_edge_clamp",         NULL },
     { "GL_MESA_ycbcr_texture",             NULL },
-    { "GL_SGIS_generate_mipmap",           NULL },
     { NULL,                                NULL }
 };
 
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index 3a31dfb..069947e 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -394,7 +394,6 @@ static const struct dri_extension card_extensions[] =
    { "GL_EXT_stencil_wrap",           NULL },
    { "GL_APPLE_vertex_array_object",  GL_APPLE_vertex_array_object_functions },
    { "GL_MESA_ycbcr_texture",         NULL },
-   { "GL_SGIS_generate_mipmap",       NULL },
    { NULL,                            NULL }
 };
 
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index 0fecdee..fbe4ede 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -62,7 +62,6 @@ static const struct dri_extension nouveau_extensions[] = {
 	{ "GL_EXT_texture_lod_bias",	NULL },
 	{ "GL_NV_blend_square",         NULL },
 	{ "GL_NV_texture_env_combine4",	NULL },
-	{ "GL_SGIS_generate_mipmap",	NULL },
 	{ NULL,				NULL }
 };
 
diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c
index 7860708..b917e0e 100644
--- a/src/mesa/drivers/dri/r128/r128_context.c
+++ b/src/mesa/drivers/dri/r128/r128_context.c
@@ -81,7 +81,6 @@ static const struct dri_extension card_extensions[] =
     { "GL_EXT_stencil_wrap",               NULL },
     { "GL_MESA_ycbcr_texture",             NULL },
     { "GL_NV_blend_square",                NULL },
-    { "GL_SGIS_generate_mipmap",           NULL },
     { NULL,                                NULL }
 };
 
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 5896296..3b85e84 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -137,7 +137,6 @@ static const struct dri_extension card_extensions[] =
     { "GL_ATI_texture_mirror_once",        NULL },
     { "GL_MESA_pack_invert",               NULL },
     { "GL_NV_blend_square",                NULL },
-    { "GL_SGIS_generate_mipmap",           NULL },
     { NULL,                                NULL }
 };
 
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index 3d2f892..ef495aa 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -134,7 +134,6 @@ static const struct dri_extension card_extensions[] = {
   {"GL_MESAX_texture_float",		NULL},
   {"GL_NV_blend_square",		NULL},
   {"GL_NV_vertex_program",		GL_NV_vertex_program_functions},
-  {"GL_SGIS_generate_mipmap",		NULL},
   {NULL,				NULL}
   /* *INDENT-ON* */
 };
diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c
index f4e6716..cd34e62 100644
--- a/src/mesa/drivers/dri/r600/r600_context.c
+++ b/src/mesa/drivers/dri/r600/r600_context.c
@@ -146,7 +146,6 @@ static const struct dri_extension card_extensions[] = {
   {"GL_MESAX_texture_float",		NULL},
   {"GL_NV_blend_square",		NULL},
   {"GL_NV_vertex_program",		GL_NV_vertex_program_functions},
-  {"GL_SGIS_generate_mipmap",		NULL},
   {"GL_ARB_pixel_buffer_object",        NULL},
   {"GL_ARB_draw_elements_base_vertex",	GL_ARB_draw_elements_base_vertex_functions },
   {NULL,				NULL}
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index ee65d7f..0b92c51 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -101,7 +101,6 @@ static const struct dri_extension card_extensions[] =
     { "GL_ATI_texture_mirror_once",        NULL },
     { "GL_MESA_ycbcr_texture",             NULL },
     { "GL_NV_blend_square",                NULL },
-    { "GL_SGIS_generate_mipmap",           NULL },
     { NULL,                                NULL }
 };
 
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c
index c30fcf3..6f1e8bf 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_context.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c
@@ -136,8 +136,6 @@ static void tdfxDDInitExtensions( GLcontext *ctx )
 
    if ( TDFX_IS_NAPALM( fxMesa ) ) {
       driInitExtensions( ctx, napalm_extensions, GL_FALSE );
-   } else {
-      _mesa_enable_extension( ctx, "GL_SGIS_generate_mipmap" );
    }
 }
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index fe7eade..0ca068c 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -206,7 +206,7 @@ static const struct {
    { OFF, "GL_NV_vertex_program1_1",           F(NV_vertex_program1_1) },
    { ON,  "GL_OES_read_format",                F(OES_read_format) },
    { OFF, "GL_SGI_texture_color_table",        F(SGI_texture_color_table) },
-   { OFF, "GL_SGIS_generate_mipmap",           F(SGIS_generate_mipmap) },
+   { ON,  "GL_SGIS_generate_mipmap",           F(SGIS_generate_mipmap) },
    { OFF, "GL_SGIS_texture_border_clamp",      F(ARB_texture_border_clamp) },
    { ON,  "GL_SGIS_texture_edge_clamp",        F(SGIS_texture_edge_clamp) },
    { ON,  "GL_SGIS_texture_lod",               F(SGIS_texture_lod) },
@@ -364,7 +364,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
    ctx->Extensions.NV_fragment_program_option = GL_TRUE;
 #endif
    ctx->Extensions.SGI_texture_color_table = GL_TRUE;
-   ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
+   /*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/
    ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE;
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
    ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
@@ -437,7 +437,7 @@ _mesa_enable_1_4_extensions(GLcontext *ctx)
    ctx->Extensions.EXT_secondary_color = GL_TRUE;
    ctx->Extensions.EXT_stencil_wrap = GL_TRUE;
    ctx->Extensions.EXT_texture_lod_bias = GL_TRUE;
-   ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;
+   /*ctx->Extensions.SGIS_generate_mipmap = GL_TRUE;*/
 }
 
 
diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c
index e2d4129..8902ae3 100644
--- a/src/mesa/main/hint.c
+++ b/src/mesa/main/hint.c
@@ -97,10 +97,6 @@ _mesa_Hint( GLenum target, GLenum mode )
 
       /* GL_SGIS_generate_mipmap */
       case GL_GENERATE_MIPMAP_HINT_SGIS:
-         if (!ctx->Extensions.SGIS_generate_mipmap) {
-            _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)");
-	    return;
-         }
          if (ctx->Hint.GenerateMipmap == mode)
             return;
 	 FLUSH_VERTICES(ctx, _NEW_HINT);
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 745a0ae..187049c 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -291,17 +291,10 @@ set_tex_parameteri(GLcontext *ctx,
       return GL_TRUE;
 
    case GL_GENERATE_MIPMAP_SGIS:
-      if (ctx->Extensions.SGIS_generate_mipmap) {
-         if (texObj->GenerateMipmap != params[0]) {
-            flush(ctx, texObj);
-            texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE;
-            return GL_TRUE;
-         }
-         return GL_FALSE;
-      }
-      else {
-         _mesa_error(ctx, GL_INVALID_ENUM,
-                     "glTexParameter(pname=GL_GENERATE_MIPMAP_SGIS)");
+      if (texObj->GenerateMipmap != params[0]) {
+	 flush(ctx, texObj);
+	 texObj->GenerateMipmap = params[0] ? GL_TRUE : GL_FALSE;
+	 return GL_TRUE;
       }
       return GL_FALSE;
 
@@ -1126,11 +1119,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
 	    error = GL_TRUE;
          break;
       case GL_GENERATE_MIPMAP_SGIS:
-         if (ctx->Extensions.SGIS_generate_mipmap) {
-            *params = (GLfloat) obj->GenerateMipmap;
-         }
-	 else 
-	    error = GL_TRUE;
+	 *params = (GLfloat) obj->GenerateMipmap;
          break;
       case GL_TEXTURE_COMPARE_MODE_ARB:
          if (ctx->Extensions.ARB_shadow) {
@@ -1291,12 +1280,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params )
          }
          break;
       case GL_GENERATE_MIPMAP_SGIS:
-         if (ctx->Extensions.SGIS_generate_mipmap) {
-            *params = (GLint) obj->GenerateMipmap;
-         }
-         else {
-            error = GL_TRUE;
-         }
+	 *params = (GLint) obj->GenerateMipmap;
          break;
       case GL_TEXTURE_COMPARE_MODE_ARB:
          if (ctx->Extensions.ARB_shadow) {



More information about the mesa-commit mailing list