From 9b7f57b18eff3959a525297f068697ac03a75840 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 5 Jan 2011 15:48:31 -0800 Subject: [PATCH] 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. --- src/mesa/main/texobj.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.30.2