aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-03-17 16:30:02 -0600
committerBrian Paul <[email protected]>2012-03-20 08:23:32 -0600
commit4c9537f7d06af9f7f8a706ecd784ce3b04e132e8 (patch)
treedefc40e6fe50bb48d58c6cf8900dd43b739e7f4b /src/mesa/main/texobj.c
parent4c385d382f6932d5d88a26dcc9eedf520b3a9ed7 (diff)
mesa: move some code in _mesa_test_texobj_completeness()
Move the simple MaxLevel < BaseLevel test earlier to be closer to where we error-check BaseLevel. Also, use the local baseLevel var in more places. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 1611ba7f8d5..9934f2a446c 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -438,6 +438,12 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
return;
}
+ if (t->MaxLevel < baseLevel) {
+ incomplete(t, "MAX_LEVEL (%d) < BASE_LEVEL (%d)",
+ t->MaxLevel, baseLevel);
+ return;
+ }
+
/* Always need the base level image */
if (!t->Image[0][baseLevel]) {
incomplete(t, "Image[baseLevel=%d] == NULL", baseLevel);
@@ -491,18 +497,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);
/* Compute _MaxLambda = q - b (see the 1.2 spec) used during mipmapping */
- t->_MaxLambda = (GLfloat) (t->_MaxLevel - t->BaseLevel);
+ t->_MaxLambda = (GLfloat) (t->_MaxLevel - baseLevel);
if (t->Immutable) {
/* This texture object was created with glTexStorage1/2/3D() so we