diff options
author | Brian Paul <[email protected]> | 2001-06-13 14:56:14 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-06-13 14:56:14 +0000 |
commit | cd1cefae9146fc14b35ee93a04bdb1b1590fba7b (patch) | |
tree | 01f74b0349d478ed65822a3271ce7cdf8384a304 /src/mesa/main/texstore.c | |
parent | cc22179cd855dad85a28c40416873a07e8b7cc0c (diff) |
Allow different max texture sizes for 1/2D, 3D and cube maps.
Diffstat (limited to 'src/mesa/main/texstore.c')
-rw-r--r-- | src/mesa/main/texstore.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 0947e116226..792f58bb975 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1,4 +1,4 @@ -/* $Id: texstore.c,v 1.27 2001/05/24 14:47:56 brianp Exp $ */ +/* $Id: texstore.c,v 1.28 2001/06/13 14:56:14 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1544,6 +1544,7 @@ _mesa_generate_mipmap(GLcontext *ctx, 0 }; const GLenum *targets; GLuint level; + GLint maxLevels = 0; ASSERT(texObj); ASSERT(texObj->Image[texObj->BaseLevel]); @@ -1551,15 +1552,19 @@ _mesa_generate_mipmap(GLcontext *ctx, switch (texObj->Dimensions) { case 1: targets = targets1D; + maxLevels = ctx->Const.MaxTextureLevels; break; case 2: targets = targets2D; + maxLevels = ctx->Const.MaxTextureLevels; break; case 3: targets = targets3D; + maxLevels = ctx->Const.Max3DTextureLevels; break; case 6: targets = targetsCube; + maxLevels = ctx->Const.MaxCubeTextureLevels; break; default: _mesa_problem(ctx, @@ -1568,7 +1573,7 @@ _mesa_generate_mipmap(GLcontext *ctx, } for (level = texObj->BaseLevel; level < texObj->MaxLevel - && level < ctx->Const.MaxTextureLevels - 1; level++) { + && level < maxLevels - 1; level++) { /* generate image[level+1] from image[level] */ const struct gl_texture_image *srcImage; struct gl_texture_image *dstImage; |