aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-07-03 03:05:48 +0000
committerBrian Paul <[email protected]>2003-07-03 03:05:48 +0000
commit887e2cf01a99f7fe1b7c94320b7bdbbf0d6ad2f8 (patch)
tree0db71a71d77fc7130d080e2435cddf22f7f8fea3 /src/mesa/main/texobj.c
parent32bac60519dab482cd3f44355563750a4521f4cb (diff)
Implemented GL_ARB_texture_non_power_of_two (except for auto mipmap generation).
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 3d5d256240d..19b2b3f8e4a 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -228,6 +228,7 @@ _mesa_copy_texture_object( struct gl_texture_object *dest,
dest->GenerateMipmap = src->GenerateMipmap;
dest->Palette = src->Palette;
dest->Complete = src->Complete;
+ dest->_IsPowerOfTwo = src->_IsPowerOfTwo;
}
@@ -257,6 +258,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
GLint maxLog2 = 0, maxLevels = 0;
t->Complete = GL_TRUE; /* be optimistic */
+ t->_IsPowerOfTwo = GL_TRUE; /* may be set FALSE below */
/* Always need the base level image */
if (!t->Image[baseLevel]) {
@@ -329,6 +331,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
}
}
+ /* check for non power of two */
+ if (!t->Image[baseLevel]->_IsPowerOfTwo) {
+ t->_IsPowerOfTwo = GL_FALSE;
+ }
+
+ /* extra checking for mipmaps */
if (t->MinFilter != GL_NEAREST && t->MinFilter != GL_LINEAR) {
/*
* Mipmapping: determine if we have a complete set of mipmaps