diff options
author | Roland Scheidegger <rscheidegger@gmx.ch> | 2005-08-15 18:24:12 +0000 |
---|---|---|
committer | Roland Scheidegger <rscheidegger@gmx.ch> | 2005-08-15 18:24:12 +0000 |
commit | 7a362deb8c432ec520d70dde7330cd845b79e89a (patch) | |
tree | ae79cd215ca37b0b8b9c6c703981f48101113724 | |
parent | a3dd6efb0009110fdd8154640af51e4b15ad625c (diff) |
In _mesa_TexEnvfv, do not accept values for GL_OPERAND2_ALPHA and GL_OPERAND2_RGB which are only valid with ARB_texture_env_combine but not with EXT_texture_env_combine, when only EXT_texture_env_combine is supported.
-rw-r--r-- | src/mesa/main/texstate.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index a425de4216..1fe11425b4 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -544,8 +544,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) } break; case GL_OPERAND2_RGB: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { + if (ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; if (texUnit->Combine.OperandRGB[2] == operand) return; @@ -562,14 +561,24 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } } + else if (ctx->Extensions.EXT_texture_env_combine) { + const GLenum operand = (GLenum) (GLint) *param; + if (texUnit->Combine.OperandRGB[2] == operand) + return; + /* operand must be GL_SRC_ALPHA which is the initial value - thus + don't need to actually compare the operand to the possible value */ + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); + return; + } + } else { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); return; } break; case GL_OPERAND2_ALPHA: - if (ctx->Extensions.EXT_texture_env_combine || - ctx->Extensions.ARB_texture_env_combine) { + if (ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; if (texUnit->Combine.OperandA[2] == operand) return; @@ -584,6 +593,17 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } } + else if (ctx->Extensions.EXT_texture_env_combine) { + const GLenum operand = (GLenum) (GLint) *param; + if (texUnit->Combine.OperandA[2] == operand) + return; + /* operand must be GL_SRC_ALPHA which is the initial value - thus + don't need to actually compare the operand to the possible value */ + else { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); + return; + } + } else { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); return; |