Mesa (master): radeon/r200/r300: fix max texture levels assert

Dave Airlie airlied at kemper.freedesktop.org
Fri Jun 12 01:39:23 UTC 2009


Module: Mesa
Branch: master
Commit: a5d92d7ed208d20c788889640503fa61b2d38851
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5d92d7ed208d20c788889640503fa61b2d38851

Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Jun 12 11:35:10 2009 +1000

radeon/r200/r300: fix max texture levels assert

use the actual value set in the context

---

 src/mesa/drivers/dri/r300/r300_context.c         |    5 +----
 src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c |    4 ++--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index 9004a3f..394521a 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -265,10 +265,7 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen)
 	    driQueryOptioni(&r300->radeon.optionCache, "texture_coord_units");
 	ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureImageUnits,
 		 ctx->Const.MaxTextureCoordUnits);
-    /* FIXME: When no memory manager is available we should set this 
-     * to some reasonable value based on texture memory pool size */
-    /* FIXME: r5xx limit is 4096 */
-    ctx->Const.MaxTextureLevels = 12;
+
 	ctx->Const.MaxTextureMaxAnisotropy = 16.0;
 	ctx->Const.MaxTextureLodBias = 16.0;
 
diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
index 8d1ba1c..55aa450 100644
--- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
+++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
@@ -141,7 +141,7 @@ static void calculate_miptree_layout_r100(radeonContextPtr rmesa, radeon_mipmap_
 	GLuint face;
 
 	numLevels = mt->lastLevel - mt->firstLevel + 1;
-	assert(numLevels <= RADEON_MAX_TEXTURE_LEVELS);
+	assert(numLevels <= rmesa->glCtx->Const.MaxTextureLevels);
 
 	curOffset = 0;
 	for(face = 0; face < mt->faces; face++) {
@@ -165,7 +165,7 @@ static void calculate_miptree_layout_r300(radeonContextPtr rmesa, radeon_mipmap_
 	GLuint i;
 
 	numLevels = mt->lastLevel - mt->firstLevel + 1;
-	assert(numLevels <= RADEON_MAX_TEXTURE_LEVELS);
+	assert(numLevels <= rmesa->glCtx->Const.MaxTextureLevels);
 
 	curOffset = 0;
 	for(i = 0; i < numLevels; i++) {




More information about the mesa-commit mailing list