[Mesa-dev] [PATCH 1/2] mesa: Adjust _MaxLevel computation to account for views

Chris Forbes chrisf at ijw.co.nz
Fri Jan 24 14:09:25 PST 2014


Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 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 3c64c437..9cb46cd 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -557,6 +557,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.8.5.3



More information about the mesa-dev mailing list