OSDN Git Service

increate MaxTextureLevels to 11 (bug 3130)
authorBrian Paul <brian.paul@tungstengraphics.com>
Sun, 15 Oct 2006 17:57:53 +0000 (17:57 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sun, 15 Oct 2006 17:57:53 +0000 (17:57 +0000)
src/mesa/drivers/dri/unichrome/via_context.c
src/mesa/drivers/dri/unichrome/via_tex.c

index 2459336..d92da8f 100644 (file)
@@ -557,8 +557,8 @@ viaCreateContext(const __GLcontextModes *visual,
     driContextPriv->driverPrivate = vmesa;
 
     ctx = vmesa->glCtx;
-    
-    ctx->Const.MaxTextureLevels = 10;    
+
+    ctx->Const.MaxTextureLevels = 11;
     ctx->Const.MaxTextureUnits = 2;
     ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
     ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
index 939422c..1cba08d 100644 (file)
@@ -513,6 +513,13 @@ static GLboolean viaSetTexImages(GLcontext *ctx,
 
    numLevels = lastLevel - firstLevel + 1;
 
+   /* The hardware only supports 10 mipmap levels. Ignore higher levels.
+    */
+   if (numLevels > 10) {
+      lastLevel -= numLevels - 10;
+      numLevels = 10;
+   }
+
    /* save these values, check if they effect the residency of the
     * texture:
     */