summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-01-05 15:48:31 -0800
committerEric Anholt <eric@anholt.net>2011-01-05 15:51:37 -0800
commit9b7f57b18eff3959a525297f068697ac03a75840 (patch)
treeb36f0625b6c854b1773d5b481bc5c638b4d247b4
parent39cc0ee3eaf0d0cae70d91ae33961053782662c8 (diff)
mesa: Consider textures incomplete when maxlevel < baselevel.
See section 3.8.10 of the GL 2.1 specification. There's no way to do anything sane with that, and drivers would get all sorts of angry.
-rw-r--r--src/mesa/main/texobj.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 5bc5639dbf7..f61e0237add 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -470,6 +470,12 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
ASSERT(maxLevels > 0);
+ if (t->MaxLevel < t->BaseLevel) {
+ incomplete(t, "MAX_LEVEL (%d) < BASE_LEVEL (%d)",
+ t->MaxLevel, t->BaseLevel);
+ return;
+ }
+
t->_MaxLevel = baseLevel + maxLog2;
t->_MaxLevel = MIN2(t->_MaxLevel, t->MaxLevel);
t->_MaxLevel = MIN2(t->_MaxLevel, maxLevels - 1);