From: Chris Forbes Date: Fri, 24 Jan 2014 21:36:04 +0000 (+1300) Subject: mesa: Adjust _MaxLevel computation to account for views X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1b017472bbee23d8cc6595707055561239a62a7;p=mesa.git mesa: Adjust _MaxLevel computation to account for views Signed-off-by: Chris Forbes Reviewed-by: Ian Romanick Reviewed-by: Kenneth Graunke Acked-by: Eric Anholt --- 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);