summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-12-14 20:25:56 +0000
committerBrian Paul <[email protected]>2000-12-14 20:25:56 +0000
commit083e466f88e1203f08b7699fa34b05d0e45b3172 (patch)
treeb7b59415b44d7691840c9e965125a98ac431fc5a /src/mesa/main/texobj.c
parentdaabce72db97dc10fce5928169a4b29334b76e5f (diff)
Renamed texture object _P to _MaxLevel and _M to _MaxLambda.
Now add BaseLevel in _MaxLevel computation.
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c24
1 files changed, 13 insertions, 11 deletions
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;