diff options
author | Chris Forbes <[email protected]> | 2014-01-25 10:36:04 +1300 |
---|---|---|
committer | Chris Forbes <[email protected]> | 2014-04-10 18:27:40 +1200 |
commit | c1b017472bbee23d8cc6595707055561239a62a7 (patch) | |
tree | 62492f8e195d521ea161874d5cc4d036be63f9f9 /src/mesa/main/texobj.c | |
parent | 61e264f4fcdba3623781a0a339426672f0d431e4 (diff) |
mesa: Adjust _MaxLevel computation to account for views
Signed-off-by: Chris Forbes <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Acked-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r-- | src/mesa/main/texobj.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 8bdbb08c8ea..918dd59edaa 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); |