diff options
author | Brian Paul <[email protected]> | 2000-12-14 20:25:56 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-12-14 20:25:56 +0000 |
commit | 083e466f88e1203f08b7699fa34b05d0e45b3172 (patch) | |
tree | b7b59415b44d7691840c9e965125a98ac431fc5a /src/mesa/main | |
parent | daabce72db97dc10fce5928169a4b29334b76e5f (diff) |
Renamed texture object _P to _MaxLevel and _M to _MaxLambda.
Now add BaseLevel in _MaxLevel computation.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/attrib.c | 6 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 10 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 4 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 24 |
4 files changed, 23 insertions, 21 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index c6475ca5afd..3fab9416884 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,4 +1,4 @@ -/* $Id: attrib.c,v 1.37 2000/11/27 18:59:09 brianp Exp $ */ +/* $Id: attrib.c,v 1.38 2000/12/14 20:25:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -85,8 +85,8 @@ copy_texobj_state( struct gl_texture_object *dest, dest->MaxLod = src->MaxLod; dest->BaseLevel = src->BaseLevel; dest->MaxLevel = src->MaxLevel; - dest->_P = src->_P; - dest->_M = src->_M; + dest->_MaxLevel = src->_MaxLevel; + dest->_MaxLambda = src->_MaxLambda; dest->Palette = src->Palette; dest->Complete = src->Complete; } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 72676708228..c6b4ac9180b 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,4 +1,4 @@ -/* $Id: mtypes.h,v 1.5 2000/12/08 00:20:15 brianp Exp $ */ +/* $Id: mtypes.h,v 1.6 2000/12/14 20:25:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -786,10 +786,10 @@ struct gl_texture_object { GLenum MagFilter; /* magnification filter */ GLfloat MinLod; /* OpenGL 1.2 */ GLfloat MaxLod; /* OpenGL 1.2 */ - GLint BaseLevel; /* OpenGL 1.2 */ - GLint MaxLevel; /* OpenGL 1.2 */ - GLint _P; /* Highest mipmap level */ - GLfloat _M; /* = MIN(MaxLevel, P) - BaseLevel */ + GLint BaseLevel; /* user-specified, OpenGL 1.2 */ + GLint MaxLevel; /* user-specified, OpenGL 1.2 */ + GLint _MaxLevel; /* actual max mipmap level (q in the spec) */ + GLfloat _MaxLambda; /* = _MaxLevel - BaseLevel (q - b in spec) */ struct gl_texture_image *Image[MAX_TEXTURE_LEVELS]; /* Texture cube faces */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 36412cbb928..4b6e855abc4 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,4 +1,4 @@ -/* $Id: teximage.c,v 1.67 2000/12/09 21:30:43 brianp Exp $ */ +/* $Id: teximage.c,v 1.68 2000/12/14 20:25:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2134,7 +2134,7 @@ _mesa_get_teximages_from_driver(GLcontext *ctx, * all but this is easier. We're on a (slow) software path * anyway. */ - for (level = 0; level <= texObj->_P; level++) { + for (level = texObj->BaseLevel; level <= texObj->_MaxLevel; level++) { struct gl_texture_image *texImg = texObj->Image[level]; if (texImg && !texImg->Data) { _mesa_get_teximage_from_driver(ctx, target, level, texObj); diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index f090fcd734c..68ce55b738d 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,4 +1,4 @@ -/* $Id: texobj.c,v 1.35 2000/11/22 07:32:17 joukj Exp $ */ +/* $Id: texobj.c,v 1.36 2000/12/14 20:25:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -177,6 +177,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, struct gl_texture_object *t ) { const GLint baseLevel = t->BaseLevel; + GLint maxLog2; t->Complete = GL_TRUE; /* be optimistic */ @@ -187,24 +188,26 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, return; } - /* Compute number of mipmap levels */ + /* Compute _MaxLevel */ if (t->Dimensions == 1) { - t->_P = t->Image[baseLevel]->WidthLog2; + maxLog2 = t->Image[baseLevel]->WidthLog2; } else if (t->Dimensions == 2 || t->Dimensions == 6) { - t->_P = MAX2(t->Image[baseLevel]->WidthLog2, - t->Image[baseLevel]->HeightLog2); + maxLog2 = MAX2(t->Image[baseLevel]->WidthLog2, + t->Image[baseLevel]->HeightLog2); } else if (t->Dimensions == 3) { GLint max = MAX2(t->Image[baseLevel]->WidthLog2, t->Image[baseLevel]->HeightLog2); - max = MAX2(max, (GLint)(t->Image[baseLevel]->DepthLog2)); - t->_P = max; + maxLog2 = MAX2(max, (GLint)(t->Image[baseLevel]->DepthLog2)); } - /* Compute M (see the 1.2 spec) used during mipmapping */ - t->_M = (GLfloat) (MIN2(t->MaxLevel, t->_P) - t->BaseLevel); + t->_MaxLevel = baseLevel + maxLog2; + t->_MaxLevel = MIN2(t->_MaxLevel, t->MaxLevel); + t->_MaxLevel = MIN2(t->_MaxLevel, ctx->Const.MaxTextureLevels - 1); + /* Compute _MaxLambda = q - b (see the 1.2 spec) used during mipmapping */ + t->_MaxLambda = (GLfloat) (t->_MaxLevel - t->BaseLevel); if (t->Dimensions == 6) { /* make sure that all six cube map level 0 images are the same size */ @@ -237,8 +240,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, */ GLint i; GLint minLevel = baseLevel; - GLint maxLevel = MIN2(t->_P, ctx->Const.MaxTextureLevels-1); - maxLevel = MIN2(maxLevel, t->MaxLevel); + GLint maxLevel = t->_MaxLevel; if (minLevel > maxLevel) { t->Complete = GL_FALSE; |