aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/texobj.c')
-rw-r--r--mesalib/src/mesa/main/texobj.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c
index 8bdbb08c8..918dd59ed 100644
--- a/mesalib/src/mesa/main/texobj.c
+++ b/mesalib/src/mesa/main/texobj.c
@@ -559,6 +559,13 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
/* 'q' in the GL spec */
maxLevels - 1);
+ if (t->Immutable) {
+ /* Adjust max level for views: the data store may have more levels than
+ * the view exposes.
+ */
+ t->_MaxLevel = MIN2(t->_MaxLevel, t->NumLevels - 1);
+ }
+
/* Compute _MaxLambda = q - p in the spec used during mipmapping */
t->_MaxLambda = (GLfloat) (t->_MaxLevel - baseLevel);