diff options
author | Brian Paul <brianp@vmware.com> | 2009-01-28 16:49:28 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-01-28 16:49:28 -0700 |
commit | 26da28c995557c8b913e5ccfe31b31dc32e6c735 (patch) | |
tree | ee8d7502dba85aef86ee27c3d3139df013590dc4 /src/mesa/main | |
parent | f584752afefb06a17b10fc879f04c3b45bbc764b (diff) |
mesa: remove GL_SGIX_shadow, GL_SGIX_shadow_ambient and GL_SGIX_depth_texture
Everyone should be using the newer/better ARB versions of these extensions.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/attrib.c | 12 | ||||
-rw-r--r-- | src/mesa/main/extensions.c | 7 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 7 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 8 | ||||
-rw-r--r-- | src/mesa/main/texparam.c | 82 | ||||
-rw-r--r-- | src/mesa/main/texstate.c | 10 |
6 files changed, 21 insertions, 105 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 825c841ee2..3be7fd5a2d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -820,15 +820,9 @@ pop_texture_group(GLcontext *ctx, struct texture_state *texstate) _mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, obj->MaxAnisotropy); } - if (ctx->Extensions.SGIX_shadow) { - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_SGIX, - obj->CompareFlag); - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_OPERATOR_SGIX, - obj->CompareOperator); - } - if (ctx->Extensions.SGIX_shadow_ambient) { - _mesa_TexParameterf(target, GL_SHADOW_AMBIENT_SGIX, - obj->ShadowAmbient); + if (ctx->Extensions.ARB_shadow_ambient) { + _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB, + obj->CompareFailValue); } } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 86144c42ad..4ebdb5d9ae 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -62,7 +62,7 @@ static const struct { { OFF, "GL_ARB_shading_language_100", F(ARB_shading_language_100) }, { OFF, "GL_ARB_shading_language_120", F(ARB_shading_language_120) }, { OFF, "GL_ARB_shadow", F(ARB_shadow) }, - { OFF, "GL_ARB_shadow_ambient", F(SGIX_shadow_ambient) }, + { 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) }, { OFF, "GL_ARB_texture_cube_map", F(ARB_texture_cube_map) }, @@ -170,8 +170,6 @@ static const struct { { ON, "GL_SGIS_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, { ON, "GL_SGIS_texture_lod", F(SGIS_texture_lod) }, { OFF, "GL_SGIX_depth_texture", F(ARB_depth_texture) }, - { OFF, "GL_SGIX_shadow", F(SGIX_shadow) }, - { OFF, "GL_SGIX_shadow_ambient", F(SGIX_shadow_ambient) }, { OFF, "GL_SUN_multi_draw_arrays", F(EXT_multi_draw_arrays) }, { OFF, "GL_S3_s3tc", F(S3_s3tc) }, }; @@ -214,6 +212,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_shading_language_120 = GL_FALSE; /* not quite done */ #endif ctx->Extensions.ARB_shadow = GL_TRUE; + ctx->Extensions.ARB_shadow_ambient = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; ctx->Extensions.ARB_texture_cube_map = GL_TRUE; ctx->Extensions.ARB_texture_env_combine = GL_TRUE; @@ -302,8 +301,6 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.SGI_texture_color_table = GL_TRUE; ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; ctx->Extensions.SGIS_texture_edge_clamp = GL_TRUE; - ctx->Extensions.SGIX_shadow = GL_TRUE; - ctx->Extensions.SGIX_shadow_ambient = GL_TRUE; #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE; #endif diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 8ab0d26f45..da243eceac 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1433,11 +1433,9 @@ struct gl_texture_object GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */ GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */ GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ - GLboolean CompareFlag; /**< GL_SGIX_shadow */ - GLenum CompareOperator; /**< GL_SGIX_shadow */ - GLfloat ShadowAmbient; /**< GL_ARB_shadow_ambient */ GLenum CompareMode; /**< GL_ARB_shadow */ GLenum CompareFunc; /**< GL_ARB_shadow */ + GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */ GLenum _Function; /**< Comparison function derived from * \c CompareOperator, \c CompareMode, and * \c CompareFunc. @@ -2563,6 +2561,7 @@ struct gl_extensions GLboolean ARB_shading_language_100; GLboolean ARB_shading_language_120; GLboolean ARB_shadow; + GLboolean ARB_shadow_ambient; /* or GL_ARB_shadow_ambient */ GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_compression; GLboolean ARB_texture_cube_map; @@ -2660,8 +2659,6 @@ struct gl_extensions GLboolean SGIS_generate_mipmap; GLboolean SGIS_texture_edge_clamp; GLboolean SGIS_texture_lod; - GLboolean SGIX_shadow; - GLboolean SGIX_shadow_ambient; /* or GL_ARB_shadow_ambient */ GLboolean TDFX_texture_compression_FXT1; GLboolean S3_s3tc; /*@}*/ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index fad39a0634..4e6cf439fc 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -134,12 +134,10 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, obj->BaseLevel = 0; obj->MaxLevel = 1000; obj->MaxAnisotropy = 1.0; - obj->CompareFlag = GL_FALSE; /* SGIX_shadow */ - obj->CompareOperator = GL_TEXTURE_LEQUAL_R_SGIX; /* SGIX_shadow */ obj->CompareMode = GL_NONE; /* ARB_shadow */ obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */ + obj->CompareFailValue = 0.0F; /* ARB_shadow_ambient */ obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */ - obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */ obj->Swizzle[0] = GL_RED; obj->Swizzle[1] = GL_GREEN; obj->Swizzle[2] = GL_BLUE; @@ -248,11 +246,9 @@ _mesa_copy_texture_object( struct gl_texture_object *dest, dest->BaseLevel = src->BaseLevel; dest->MaxLevel = src->MaxLevel; dest->MaxAnisotropy = src->MaxAnisotropy; - dest->CompareFlag = src->CompareFlag; - dest->CompareOperator = src->CompareOperator; - dest->ShadowAmbient = src->ShadowAmbient; dest->CompareMode = src->CompareMode; dest->CompareFunc = src->CompareFunc; + dest->CompareFailValue = src->CompareFailValue; dest->DepthMode = src->DepthMode; dest->_MaxLevel = src->_MaxLevel; dest->_MaxLambda = src->_MaxLambda; diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 41c914e5b3..f610fa8dda 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -260,30 +260,6 @@ set_tex_parameteri(GLcontext *ctx, texObj->MaxLevel = params[0]; return; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareFlag = params[0] ? GL_TRUE : GL_FALSE; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_SGIX)"); - } - return; - - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow && - (params[0] == GL_TEXTURE_LEQUAL_R_SGIX || - params[0] == GL_TEXTURE_GEQUAL_R_SGIX)) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->CompareOperator = params[0]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(GL_TEXTURE_COMPARE_OPERATOR_SGIX)"); - } - return; - case GL_GENERATE_MIPMAP_SGIS: if (ctx->Extensions.SGIS_generate_mipmap) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -454,14 +430,14 @@ set_tex_parameterf(GLcontext *ctx, } return; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + if (ctx->Extensions.ARB_shadow_ambient) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->ShadowAmbient = CLAMP(params[0], 0.0F, 1.0F); + texObj->CompareFailValue = CLAMP(params[0], 0.0F, 1.0F); } else { _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_SHADOW_AMBIENT_SGIX)"); + "glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)"); } return; @@ -512,8 +488,6 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) case GL_TEXTURE_WRAP_R: case GL_TEXTURE_BASE_LEVEL: case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_COMPARE_SGIX: - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: case GL_GENERATE_MIPMAP_SGIS: case GL_TEXTURE_COMPARE_MODE_ARB: case GL_TEXTURE_COMPARE_FUNC_ARB: @@ -556,8 +530,6 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) case GL_TEXTURE_WRAP_R: case GL_TEXTURE_BASE_LEVEL: case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_COMPARE_SGIX: - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: case GL_GENERATE_MIPMAP_SGIS: case GL_TEXTURE_COMPARE_MODE_ARB: case GL_TEXTURE_COMPARE_FUNC_ARB: @@ -613,7 +585,7 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) case GL_TEXTURE_PRIORITY: case GL_TEXTURE_MAX_ANISOTROPY_EXT: case GL_TEXTURE_LOD_BIAS: - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { GLfloat fparam = (GLfloat) param; /* convert int param to float */ @@ -662,7 +634,7 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) case GL_TEXTURE_PRIORITY: case GL_TEXTURE_MAX_ANISOTROPY_EXT: case GL_TEXTURE_LOD_BIAS: - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { /* convert int param to float */ GLfloat fparam = (GLfloat) params[0]; @@ -1060,23 +1032,9 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) else error = GL_TRUE; break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareFlag; - } - else - error = GL_TRUE; - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLfloat) obj->CompareOperator; - } - else - error = GL_TRUE; - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - *params = obj->ShadowAmbient; + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + if (ctx->Extensions.ARB_shadow_ambient) { + *params = obj->CompareFailValue; } else error = GL_TRUE; @@ -1248,25 +1206,9 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) error = GL_TRUE; } break; - case GL_TEXTURE_COMPARE_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareFlag; - } - else { - error = GL_TRUE; - } - break; - case GL_TEXTURE_COMPARE_OPERATOR_SGIX: - if (ctx->Extensions.SGIX_shadow) { - *params = (GLint) obj->CompareOperator; - } - else { - error = GL_TRUE; - } - break; - case GL_SHADOW_AMBIENT_SGIX: /* aka GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - if (ctx->Extensions.SGIX_shadow_ambient) { - *params = (GLint) FLOAT_TO_INT(obj->ShadowAmbient); + case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: + if (ctx->Extensions.ARB_shadow_ambient) { + *params = (GLint) FLOAT_TO_INT(obj->CompareFailValue); } else { error = GL_TRUE; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 7cddec0bce..f7a4d8b323 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -404,16 +404,6 @@ update_texture_compare_function(GLcontext *ctx, */ tObj->_Function = GL_NONE; } - else if (tObj->CompareFlag) { - /* GL_SGIX_shadow */ - if (tObj->CompareOperator == GL_TEXTURE_LEQUAL_R_SGIX) { - tObj->_Function = GL_LEQUAL; - } - else { - ASSERT(tObj->CompareOperator == GL_TEXTURE_GEQUAL_R_SGIX); - tObj->_Function = GL_GEQUAL; - } - } else if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { /* GL_ARB_shadow */ tObj->_Function = tObj->CompareFunc; |