diff options
author | Brian Paul <[email protected]> | 2006-04-14 02:20:18 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-04-14 02:20:18 +0000 |
commit | ee4e75bd6f768b7210436feeb32b4545ed62e025 (patch) | |
tree | 2684654e69d43aa244fc6082717523da202aa43e /src/mesa/main/matrix.c | |
parent | 1d886a81add08536f18d2453ae38fcac79f0b806 (diff) |
Replace ctx->Const.MaxTextureUnits w/ ctx->Const.MaxTexture[Coord/Image]Units
in various places.
Note that ctx->Texture.CurrentUnit needs to be tested against Coord/Image
limits when referenced, not just in glActiveTexture().
Diffstat (limited to 'src/mesa/main/matrix.c')
-rw-r--r-- | src/mesa/main/matrix.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 5ff250a0c79..7339b0ce409 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -160,6 +160,10 @@ _mesa_MatrixMode( GLenum mode ) ctx->CurrentStack = &ctx->ProjectionMatrixStack; break; case GL_TEXTURE: + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glMatrixMode(texcoord unit)"); + return; + } ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit]; break; case GL_COLOR: |