Signed-off-by: Chris Forbes <chr...@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
---
 src/mesa/main/texobj.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 8bdbb08..918dd59 100644
--- a/src/mesa/main/texobj.c
+++ b/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);
 
-- 
1.9.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to