summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-02-28 18:24:30 -0700
committerBrian Paul <brianp@vmware.com>2011-02-28 18:24:30 -0700
commit9d20849516fe34bb0a430b007cef7878858cf0c7 (patch)
tree67c226c5ccade1c0eb30f3c3e76443c81ffbd586
parent7e161bcf11d539ecc2482b71b21783a23e36f596 (diff)
mesa: remove GL_SGI_texture_color_table support
It was only implemented in the swrast driver and probably not used by any applications. A modern app would use a dependent/chained texture lookup in the fragment shader.
-rw-r--r--docs/relnotes-7.11.html2
-rw-r--r--src/mesa/main/attrib.c11
-rw-r--r--src/mesa/main/colortab.c99
-rw-r--r--src/mesa/main/enable.c14
-rw-r--r--src/mesa/main/extensions.c2
-rw-r--r--src/mesa/main/get.c6
-rw-r--r--src/mesa/main/mtypes.h12
-rw-r--r--src/mesa/main/pixel.c3
-rw-r--r--src/mesa/main/texstate.c3
-rw-r--r--src/mesa/swrast/s_texcombine.c5
10 files changed, 3 insertions, 154 deletions
diff --git a/docs/relnotes-7.11.html b/docs/relnotes-7.11.html
index 4b1730b17e..277339bc4c 100644
--- a/docs/relnotes-7.11.html
+++ b/docs/relnotes-7.11.html
@@ -53,6 +53,8 @@ tbd
<ul>
<li>The Windows MSVC project files have been removed. They haven't been maintained
in quite a while. Building with SCons is an alterantive.
+<li>Removed GL_SGI_texture_color_table support from swrast driver - the only
+driver that implemented it.
</ul>
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 7fd1287368..ae7f633b8d 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -125,9 +125,6 @@ struct gl_enable_attrib
GLbitfield Texture[MAX_TEXTURE_UNITS];
GLbitfield TexGen[MAX_TEXTURE_UNITS];
- /* SGI_texture_color_table */
- GLboolean TextureColorTable[MAX_TEXTURE_UNITS];
-
/* GL_ARB_vertex_program / GL_NV_vertex_program */
GLboolean VertexProgram;
GLboolean VertexProgramPointSize;
@@ -311,7 +308,6 @@ _mesa_PushAttrib(GLbitfield mask)
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
attr->Texture[i] = ctx->Texture.Unit[i].Enabled;
attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled;
- attr->TextureColorTable[i] = ctx->Texture.Unit[i].ColorTableEnabled;
}
/* GL_NV_vertex_program */
attr->VertexProgram = ctx->VertexProgram.Enabled;
@@ -657,9 +653,6 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable)
_mesa_set_enable(ctx, GL_TEXTURE_GEN_Q,
(genEnabled & Q_BIT) ? GL_TRUE : GL_FALSE);
}
-
- /* GL_SGI_texture_color_table */
- ctx->Texture.Unit[i].ColorTableEnabled = enable->TextureColorTable[i];
}
_mesa_ActiveTextureARB(GL_TEXTURE0 + curTexUnitSave);
@@ -702,10 +695,6 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
(unit->Enabled & TEXTURE_2D_ARRAY_BIT) ? GL_TRUE : GL_FALSE);
}
- if (ctx->Extensions.SGI_texture_color_table) {
- _mesa_set_enable(ctx, GL_TEXTURE_COLOR_TABLE_SGI,
- unit->ColorTableEnabled);
- }
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, unit->EnvMode);
_mesa_TexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, unit->EnvColor);
_mesa_TexGeni(GL_S, GL_TEXTURE_GEN_MODE, unit->GenS.Mode);
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c
index b0ba31c732..026fa48786 100644
--- a/src/mesa/main/colortab.c
+++ b/src/mesa/main/colortab.c
@@ -300,23 +300,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
case GL_SHARED_TEXTURE_PALETTE_EXT:
table = &ctx->Texture.Palette;
break;
- case GL_TEXTURE_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_texture_color_table) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)");
- return;
- }
- table = &(texUnit->ColorTable);
- scale = ctx->Pixel.TextureColorTableScale;
- bias = ctx->Pixel.TextureColorTableBias;
- break;
- case GL_PROXY_TEXTURE_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_texture_color_table) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorTable(target)");
- return;
- }
- table = &(texUnit->ProxyColorTable);
- proxy = GL_TRUE;
- break;
default:
/* try texture targets */
{
@@ -435,15 +418,6 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
case GL_SHARED_TEXTURE_PALETTE_EXT:
table = &ctx->Texture.Palette;
break;
- case GL_TEXTURE_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_texture_color_table) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)");
- return;
- }
- table = &(texUnit->ColorTable);
- scale = ctx->Pixel.TextureColorTableScale;
- bias = ctx->Pixel.TextureColorTableBias;
- break;
default:
/* try texture targets */
texObj = _mesa_select_tex_object(ctx, texUnit, target);
@@ -551,13 +525,6 @@ _mesa_GetColorTable( GLenum target, GLenum format,
case GL_SHARED_TEXTURE_PALETTE_EXT:
table = &ctx->Texture.Palette;
break;
- case GL_TEXTURE_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_texture_color_table) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)");
- return;
- }
- table = &(texUnit->ColorTable);
- break;
default:
/* try texture targets */
{
@@ -666,10 +633,6 @@ _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params)
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
switch (target) {
- case GL_TEXTURE_COLOR_TABLE_SGI:
- scale = ctx->Pixel.TextureColorTableScale;
- bias = ctx->Pixel.TextureColorTableBias;
- break;
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glColorTableParameter(target)");
return;
@@ -695,17 +658,7 @@ static void GLAPIENTRY
_mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params)
{
GLfloat fparams[4];
- if (pname == GL_TEXTURE_COLOR_TABLE_SGI) {
- /* four values */
- fparams[0] = (GLfloat) params[0];
- fparams[1] = (GLfloat) params[1];
- fparams[2] = (GLfloat) params[2];
- fparams[3] = (GLfloat) params[3];
- }
- else {
- /* one values */
- fparams[0] = (GLfloat) params[0];
- }
+ fparams[0] = (GLfloat) params[0];
_mesa_ColorTableParameterfv(target, pname, fparams);
}
@@ -723,28 +676,6 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
case GL_SHARED_TEXTURE_PALETTE_EXT:
table = &ctx->Texture.Palette;
break;
- case GL_TEXTURE_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_texture_color_table) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)");
- return;
- }
- table = &(texUnit->ColorTable);
- if (pname == GL_COLOR_TABLE_SCALE_SGI) {
- COPY_4V(params, ctx->Pixel.TextureColorTableScale);
- return;
- }
- else if (pname == GL_COLOR_TABLE_BIAS_SGI) {
- COPY_4V(params, ctx->Pixel.TextureColorTableBias);
- return;
- }
- break;
- case GL_PROXY_TEXTURE_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_texture_color_table) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)");
- return;
- }
- table = &(texUnit->ProxyColorTable);
- break;
default:
/* try texture targets */
{
@@ -808,34 +739,6 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
case GL_SHARED_TEXTURE_PALETTE_EXT:
table = &ctx->Texture.Palette;
break;
- case GL_TEXTURE_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_texture_color_table) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)");
- return;
- }
- table = &(texUnit->ColorTable);
- if (pname == GL_COLOR_TABLE_SCALE_SGI) {
- params[0] = (GLint) ctx->Pixel.TextureColorTableScale[0];
- params[1] = (GLint) ctx->Pixel.TextureColorTableScale[1];
- params[2] = (GLint) ctx->Pixel.TextureColorTableScale[2];
- params[3] = (GLint) ctx->Pixel.TextureColorTableScale[3];
- return;
- }
- else if (pname == GL_COLOR_TABLE_BIAS_SGI) {
- params[0] = (GLint) ctx->Pixel.TextureColorTableBias[0];
- params[1] = (GLint) ctx->Pixel.TextureColorTableBias[1];
- params[2] = (GLint) ctx->Pixel.TextureColorTableBias[2];
- params[3] = (GLint) ctx->Pixel.TextureColorTableBias[3];
- return;
- }
- break;
- case GL_PROXY_TEXTURE_COLOR_TABLE_SGI:
- if (!ctx->Extensions.SGI_texture_color_table) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)");
- return;
- }
- table = &(texUnit->ProxyColorTable);
- break;
default:
/* Try texture targets */
{
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index ea3b8214c3..f247092410 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -703,15 +703,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
client_state( ctx, cap, state );
return;
- /* GL_SGI_texture_color_table */
- case GL_TEXTURE_COLOR_TABLE_SGI:
- CHECK_EXTENSION(SGI_texture_color_table, cap);
- if (ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled == state)
- return;
- FLUSH_VERTICES(ctx, _NEW_TEXTURE);
- ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled = state;
- break;
-
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
CHECK_EXTENSION(ARB_texture_cube_map, cap);
@@ -1308,11 +1299,6 @@ _mesa_IsEnabled( GLenum cap )
return (ctx->Array.ArrayObj->PointSize.Enabled != 0);
#endif
- /* GL_SGI_texture_color_table */
- case GL_TEXTURE_COLOR_TABLE_SGI:
- CHECK_EXTENSION(SGI_texture_color_table);
- return ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled;
-
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
CHECK_EXTENSION(ARB_texture_cube_map);
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index b8bb2555ac..3840cdc5d3 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -290,7 +290,6 @@ static const struct extension extension_table[] = {
{ "GL_SGIS_texture_border_clamp", o(ARB_texture_border_clamp), GL },
{ "GL_SGIS_texture_edge_clamp", o(SGIS_texture_edge_clamp), GL },
{ "GL_SGIS_texture_lod", o(SGIS_texture_lod), GL },
- { "GL_SGI_texture_color_table", o(SGI_texture_color_table), GL },
{ "GL_SUN_multi_draw_arrays", o(EXT_multi_draw_arrays), GL },
{ 0, 0, 0 },
@@ -520,7 +519,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program
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_texture_edge_clamp = GL_TRUE;
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index fa7aa1121a..336304c591 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -290,7 +290,6 @@ EXTRA_EXT(NV_fragment_program);
EXTRA_EXT(NV_texture_rectangle);
EXTRA_EXT(EXT_stencil_two_side);
EXTRA_EXT(NV_light_max_exponent);
-EXTRA_EXT(SGI_texture_color_table);
EXTRA_EXT(EXT_depth_bounds_test);
EXTRA_EXT(ARB_depth_clamp);
EXTRA_EXT(ATI_fragment_shader);
@@ -911,11 +910,6 @@ static const struct value_desc values[] = {
CONTEXT_MATRIX_T(ProjectionMatrixStack.Top), NO_EXTRA },
{ GL_TRANSPOSE_TEXTURE_MATRIX_ARB, CONTEXT_MATRIX_T(TextureMatrixStack), NO_EXTRA },
- /* GL_SGI_texture_color_table */
- { GL_TEXTURE_COLOR_TABLE_SGI, LOC_TEXUNIT, TYPE_BOOLEAN,
- offsetof(struct gl_texture_unit, ColorTableEnabled),
- extra_SGI_texture_color_table },
-
/* GL_EXT_secondary_color */
{ GL_COLOR_SUM_EXT, CONTEXT_BOOL(Fog.ColorSumEnabled),
extra_EXT_secondary_color_ARB_vertex_program },
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b237063a6d..fcb06d49e9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1031,10 +1031,6 @@ struct gl_pixel_attrib
/** glPixelZoom */
GLfloat ZoomX, ZoomY;
-
- /** GL_SGI_texture_color_table */
- GLfloat TextureColorTableScale[4]; /**< RGBA */
- GLfloat TextureColorTableBias[4]; /**< RGBA */
};
@@ -1435,13 +1431,6 @@ struct gl_texture_unit
/** Points to highest priority, complete and enabled texture object */
struct gl_texture_object *_Current;
-
- /** GL_SGI_texture_color_table */
- /*@{*/
- struct gl_color_table ColorTable;
- struct gl_color_table ProxyColorTable;
- GLboolean ColorTableEnabled;
- /*@}*/
};
@@ -2859,7 +2848,6 @@ struct gl_extensions
GLboolean NV_vertex_program;
GLboolean NV_vertex_program1_1;
GLboolean OES_read_format;
- GLboolean SGI_texture_color_table;
GLboolean SGIS_generate_mipmap;
GLboolean SGIS_texture_edge_clamp;
GLboolean SGIS_texture_lod;
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 0254980b89..08ef8fc844 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -685,9 +685,6 @@ _mesa_init_pixel( struct gl_context *ctx )
init_pixelmap(&ctx->PixelMaps.GtoG);
init_pixelmap(&ctx->PixelMaps.BtoB);
init_pixelmap(&ctx->PixelMaps.AtoA);
- /* GL_SGI_texture_color_table */
- ASSIGN_4V(ctx->Pixel.TextureColorTableScale, 1.0, 1.0, 1.0, 1.0);
- ASSIGN_4V(ctx->Pixel.TextureColorTableBias, 0.0, 0.0, 0.0, 0.0);
if (ctx->Visual.doubleBufferMode) {
ctx->Pixel.ReadBuffer = GL_BACK;
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index f4d77189f2..41d531f597 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -818,9 +818,6 @@ _mesa_free_texture_data(struct gl_context *ctx)
/* Free proxy texture objects */
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++)
ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]);
-
- for (u = 0; u < Elements(ctx->Texture.Unit); u++)
- _mesa_free_colortable_data(&ctx->Texture.Unit[u].ColorTable);
}
diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c
index 99c44413fb..0c8cc9ff37 100644
--- a/src/mesa/swrast/s_texcombine.c
+++ b/src/mesa/swrast/s_texcombine.c
@@ -713,11 +713,6 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
swrast->TextureSample[unit]( ctx, texUnit->_Current, span->end,
texcoords, lambda, texels );
- /* GL_SGI_texture_color_table */
- if (texUnit->ColorTableEnabled) {
- _mesa_lookup_rgba_float(&texUnit->ColorTable, span->end, texels);
- }
-
/* GL_EXT_texture_swizzle */
if (curObj->_Swizzle != SWIZZLE_NOOP) {
swizzle_texels(curObj->_Swizzle, span->end, texels);