diff options
author | Brian Paul <[email protected]> | 2003-01-21 15:49:06 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-01-21 15:49:06 +0000 |
commit | 943f0c6a41aa66705ffba90a55cf75296b0bde1d (patch) | |
tree | 7a6b2f673bdf28081316ca8e1fa8f991145afda9 /src/mesa/main/texstate.c | |
parent | 19ad3fee8c721f35ea3467c9ba4c84d1fd9ef10c (diff) |
GL_ATI_texture_env_combine3 extension
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r-- | src/mesa/main/texstate.c | 256 |
1 files changed, 141 insertions, 115 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index b511b1a8d36..6762ee9ea91 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.91 2003/01/16 15:22:13 brianp Exp $ */ +/* $Id: texstate.c,v 1.92 2003/01/21 15:49:17 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -171,7 +171,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) mode == GL_DECAL || mode == GL_REPLACE || (mode == GL_ADD && ctx->Extensions.EXT_texture_env_add) || - (mode == GL_COMBINE_EXT && + (mode == GL_COMBINE && (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine))) { /* legal */ @@ -199,7 +199,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) COPY_4FV(texUnit->EnvColor, tmp); } break; - case GL_COMBINE_RGB_EXT: + case GL_COMBINE_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum mode = (GLenum) (GLint) *param; @@ -207,11 +207,11 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) case GL_REPLACE: case GL_MODULATE: case GL_ADD: - case GL_ADD_SIGNED_EXT: - case GL_INTERPOLATE_EXT: + case GL_ADD_SIGNED: + case GL_INTERPOLATE: /* OK */ break; - case GL_SUBTRACT_ARB: + case GL_SUBTRACT: if (!ctx->Extensions.ARB_texture_env_combine) { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); return; @@ -224,13 +224,21 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_DOT3_RGB_ARB: - case GL_DOT3_RGBA_ARB: + case GL_DOT3_RGB: + case GL_DOT3_RGBA: if (!ctx->Extensions.ARB_texture_env_dot3) { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); return; } break; + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + if (!ctx->Extensions.ATI_texture_env_combine3) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; default: TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); return; @@ -245,47 +253,63 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_COMBINE_ALPHA_EXT: + case GL_COMBINE_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum mode = (GLenum) (GLint) *param; - if (mode == GL_REPLACE || - mode == GL_MODULATE || - mode == GL_ADD || - mode == GL_ADD_SIGNED_EXT || - mode == GL_INTERPOLATE_EXT || - (mode == GL_SUBTRACT_ARB && - ctx->Extensions.ARB_texture_env_combine)) { - /* legal */ - if (texUnit->CombineModeA == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->CombineModeA = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + switch (mode) { + case GL_REPLACE: + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_INTERPOLATE: + /* OK */ + break; + case GL_SUBTRACT: + if (!ctx->Extensions.ARB_texture_env_combine) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + if (!ctx->Extensions.ATI_texture_env_combine3) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); return; } + + if (texUnit->CombineModeA == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->CombineModeA = mode; } else { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); return; } break; - case GL_SOURCE0_RGB_EXT: - case GL_SOURCE1_RGB_EXT: - case GL_SOURCE2_RGB_EXT: + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_RGB_EXT; + const GLuint s = pname - GL_SOURCE0_RGB; if (source == GL_TEXTURE || - source == GL_CONSTANT_EXT || - source == GL_PRIMARY_COLOR_EXT || - source == GL_PREVIOUS_EXT || + source == GL_CONSTANT || + source == GL_PRIMARY_COLOR || + source == GL_PREVIOUS || (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0_ARB && - source < GL_TEXTURE0_ARB + ctx->Const.MaxTextureUnits)) { + source >= GL_TEXTURE0 && + source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || + (ctx->Extensions.ATI_texture_env_combine3 && + (source == GL_ZERO || source == GL_ONE))) { /* legal */ if (texUnit->CombineSourceRGB[s] == source) return; @@ -302,20 +326,22 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_SOURCE0_ALPHA_EXT: - case GL_SOURCE1_ALPHA_EXT: - case GL_SOURCE2_ALPHA_EXT: + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_ALPHA_EXT; + const GLuint s = pname - GL_SOURCE0_ALPHA; if (source == GL_TEXTURE || - source == GL_CONSTANT_EXT || - source == GL_PRIMARY_COLOR_EXT || - source == GL_PREVIOUS_EXT || + source == GL_CONSTANT || + source == GL_PRIMARY_COLOR || + source == GL_PREVIOUS || (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0_ARB && - source < GL_TEXTURE0_ARB + ctx->Const.MaxTextureUnits)) { + source >= GL_TEXTURE0 && + source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || + (ctx->Extensions.ATI_texture_env_combine3 && + (source == GL_ZERO || source == GL_ONE))) { /* legal */ if (texUnit->CombineSourceA[s] == source) return; @@ -332,12 +358,12 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_OPERAND0_RGB_EXT: - case GL_OPERAND1_RGB_EXT: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; - const GLuint s = pname - GL_OPERAND0_RGB_EXT; + const GLuint s = pname - GL_OPERAND0_RGB; switch (operand) { case GL_SRC_COLOR: case GL_ONE_MINUS_SRC_COLOR: @@ -358,19 +384,19 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_OPERAND0_ALPHA_EXT: - case GL_OPERAND1_ALPHA_EXT: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; switch (operand) { case GL_SRC_ALPHA: case GL_ONE_MINUS_SRC_ALPHA: - if (texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA_EXT] == + if (texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA] == operand) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA_EXT] = operand; + texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA] = operand; break; default: TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); @@ -382,7 +408,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_OPERAND2_RGB_EXT: + case GL_OPERAND2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; @@ -405,7 +431,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_OPERAND2_ALPHA_EXT: + case GL_OPERAND2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; @@ -427,7 +453,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_RGB_SCALE_EXT: + case GL_RGB_SCALE: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { GLuint newshift; @@ -604,7 +630,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) case GL_TEXTURE_ENV_COLOR: COPY_4FV( params, texUnit->EnvColor ); break; - case GL_COMBINE_RGB_EXT: + case GL_COMBINE_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineModeRGB; @@ -613,7 +639,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_COMBINE_ALPHA_EXT: + case GL_COMBINE_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineModeA; @@ -622,7 +648,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE0_RGB_EXT: + case GL_SOURCE0_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceRGB[0]; @@ -631,7 +657,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE1_RGB_EXT: + case GL_SOURCE1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceRGB[1]; @@ -640,7 +666,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE2_RGB_EXT: + case GL_SOURCE2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceRGB[2]; @@ -649,7 +675,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE0_ALPHA_EXT: + case GL_SOURCE0_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceA[0]; @@ -658,7 +684,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE1_ALPHA_EXT: + case GL_SOURCE1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceA[1]; @@ -667,7 +693,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE2_ALPHA_EXT: + case GL_SOURCE2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceA[2]; @@ -676,7 +702,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND0_RGB_EXT: + case GL_OPERAND0_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandRGB[0]; @@ -685,7 +711,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND1_RGB_EXT: + case GL_OPERAND1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandRGB[1]; @@ -694,7 +720,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND2_RGB_EXT: + case GL_OPERAND2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandRGB[2]; @@ -703,7 +729,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND0_ALPHA_EXT: + case GL_OPERAND0_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandA[0]; @@ -712,7 +738,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND1_ALPHA_EXT: + case GL_OPERAND1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandA[1]; @@ -721,7 +747,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND2_ALPHA_EXT: + case GL_OPERAND2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandA[2]; @@ -730,7 +756,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_RGB_SCALE_EXT: + case GL_RGB_SCALE: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { if (texUnit->CombineScaleShiftRGB == 0) @@ -817,7 +843,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); break; - case GL_COMBINE_RGB_EXT: + case GL_COMBINE_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineModeRGB; @@ -826,7 +852,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_COMBINE_ALPHA_EXT: + case GL_COMBINE_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineModeA; @@ -835,7 +861,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE0_RGB_EXT: + case GL_SOURCE0_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceRGB[0]; @@ -844,7 +870,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE1_RGB_EXT: + case GL_SOURCE1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceRGB[1]; @@ -853,7 +879,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE2_RGB_EXT: + case GL_SOURCE2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceRGB[2]; @@ -862,7 +888,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE0_ALPHA_EXT: + case GL_SOURCE0_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceA[0]; @@ -871,7 +897,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE1_ALPHA_EXT: + case GL_SOURCE1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceA[1]; @@ -880,7 +906,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE2_ALPHA_EXT: + case GL_SOURCE2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceA[2]; @@ -889,7 +915,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND0_RGB_EXT: + case GL_OPERAND0_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandRGB[0]; @@ -898,7 +924,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND1_RGB_EXT: + case GL_OPERAND1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandRGB[1]; @@ -907,7 +933,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND2_RGB_EXT: + case GL_OPERAND2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandRGB[2]; @@ -916,7 +942,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND0_ALPHA_EXT: + case GL_OPERAND0_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandA[0]; @@ -925,7 +951,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND1_ALPHA_EXT: + case GL_OPERAND1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandA[1]; @@ -934,7 +960,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND2_ALPHA_EXT: + case GL_OPERAND2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandA[2]; @@ -943,7 +969,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_RGB_SCALE_EXT: + case GL_RGB_SCALE: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { if (texUnit->CombineScaleShiftRGB == 0) @@ -1049,10 +1075,10 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) case GL_TEXTURE_2D: texObj = texUnit->Current2D; break; - case GL_TEXTURE_3D_EXT: + case GL_TEXTURE_3D: texObj = texUnit->Current3D; break; - case GL_TEXTURE_CUBE_MAP_ARB: + case GL_TEXTURE_CUBE_MAP: if (!ctx->Extensions.ARB_texture_cube_map) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); return; @@ -1111,7 +1137,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) if (texObj->WrapS == eparam) return; if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER_ARB && + (eparam == GL_CLAMP_TO_BORDER && ctx->Extensions.ARB_texture_border_clamp)) { /* any texture target */ FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -1119,7 +1145,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) } else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV && (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT_ARB && + (eparam == GL_MIRRORED_REPEAT && ctx->Extensions.ARB_texture_mirrored_repeat) || (eparam == GL_MIRROR_CLAMP_ATI && ctx->Extensions.ATI_texture_mirror_once) || @@ -1138,7 +1164,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) if (texObj->WrapT == eparam) return; if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER_ARB && + (eparam == GL_CLAMP_TO_BORDER && ctx->Extensions.ARB_texture_border_clamp)) { /* any texture target */ FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -1146,7 +1172,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) } else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV && (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT_ARB && + (eparam == GL_MIRRORED_REPEAT && ctx->Extensions.ARB_texture_mirrored_repeat) || (eparam == GL_MIRROR_CLAMP_ATI && ctx->Extensions.ATI_texture_mirror_once) || @@ -1161,11 +1187,11 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) return; } break; - case GL_TEXTURE_WRAP_R_EXT: + case GL_TEXTURE_WRAP_R: if (texObj->WrapR == eparam) return; if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER_ARB && + (eparam == GL_CLAMP_TO_BORDER && ctx->Extensions.ARB_texture_border_clamp)) { /* any texture target */ FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -1173,7 +1199,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) } else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV && (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT_ARB && + (eparam == GL_MIRRORED_REPEAT && ctx->Extensions.ARB_texture_mirrored_repeat) || (eparam == GL_MIRROR_CLAMP_ATI && ctx->Extensions.ATI_texture_mirror_once) || @@ -1433,14 +1459,14 @@ tex_image_dimensions(GLcontext *ctx, GLenum target) case GL_TEXTURE_3D: case GL_PROXY_TEXTURE_3D: return 3; - case GL_TEXTURE_CUBE_MAP_ARB: - case GL_PROXY_TEXTURE_CUBE_MAP_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: + case GL_TEXTURE_CUBE_MAP: + case GL_PROXY_TEXTURE_CUBE_MAP: + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: return ctx->Extensions.ARB_texture_cube_map ? 2 : 0; case GL_TEXTURE_RECTANGLE_NV: case GL_PROXY_TEXTURE_RECTANGLE_NV: @@ -1482,13 +1508,13 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, case GL_PROXY_TEXTURE_3D: maxLevels = ctx->Const.Max3DTextureLevels; break; - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: - case GL_PROXY_TEXTURE_CUBE_MAP_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + case GL_PROXY_TEXTURE_CUBE_MAP: maxLevels = ctx->Const.MaxCubeTextureLevels; break; case GL_TEXTURE_RECTANGLE_NV: @@ -1518,7 +1544,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, isProxy = (target == GL_PROXY_TEXTURE_1D) || (target == GL_PROXY_TEXTURE_2D) || (target == GL_PROXY_TEXTURE_3D) || - (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) || + (target == GL_PROXY_TEXTURE_CUBE_MAP) || (target == GL_PROXY_TEXTURE_RECTANGLE_NV); switch (pname) { @@ -1597,7 +1623,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, return; /* GL_ARB_texture_compression */ - case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB: + case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: if (ctx->Extensions.ARB_texture_compression) { if (img->IsCompressed && !isProxy) *params = img->CompressedSize; @@ -1610,7 +1636,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, "glGetTexLevelParameter[if]v(pname)"); } return; - case GL_TEXTURE_COMPRESSED_ARB: + case GL_TEXTURE_COMPRESSED: if (ctx->Extensions.ARB_texture_compression) { *params = (GLint) img->IsCompressed; } @@ -1655,7 +1681,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) case GL_TEXTURE_WRAP_T: *params = ENUM_TO_FLOAT(obj->WrapT); return; - case GL_TEXTURE_WRAP_R_EXT: + case GL_TEXTURE_WRAP_R: *params = ENUM_TO_FLOAT(obj->WrapR); return; case GL_TEXTURE_BORDER_COLOR: @@ -1772,7 +1798,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) case GL_TEXTURE_WRAP_T: *params = (GLint) obj->WrapT; return; - case GL_TEXTURE_WRAP_R_EXT: + case GL_TEXTURE_WRAP_R: *params = (GLint) obj->WrapR; return; case GL_TEXTURE_BORDER_COLOR: @@ -2420,7 +2446,7 @@ void _mesa_ActiveTextureARB( GLenum target ) { GET_CURRENT_CONTEXT(ctx); - GLuint texUnit = target - GL_TEXTURE0_ARB; + GLuint texUnit = target - GL_TEXTURE0; ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) @@ -2429,7 +2455,7 @@ _mesa_ActiveTextureARB( GLenum target ) /* Cater for texture unit 0 is first, therefore use >= */ if (texUnit >= ctx->Const.MaxTextureUnits) { - _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTextureARB(target)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(target)"); return; } @@ -2452,11 +2478,11 @@ void _mesa_ClientActiveTextureARB( GLenum target ) { GET_CURRENT_CONTEXT(ctx); - GLuint texUnit = target - GL_TEXTURE0_ARB; + GLuint texUnit = target - GL_TEXTURE0; ASSERT_OUTSIDE_BEGIN_END(ctx); if (texUnit > ctx->Const.MaxTextureUnits) { - _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTextureARB(target)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(target)"); return; } |