nv40: remove use of pt->first_level
authorBen Skeggs <skeggsb@gmail.com>
Wed, 13 Feb 2008 03:27:32 +0000 (14:27 +1100)
committerBen Skeggs <skeggsb@gmail.com>
Fri, 15 Feb 2008 02:51:12 +0000 (13:51 +1100)
src/mesa/pipe/nv40/nv40_fragtex.c
src/mesa/pipe/nv40/nv40_miptree.c

index d278ce1897545a580a9684304e48da24e760ae82..69c0fcb5e056fac4ada3ffbe8c1bfc573841158d 100644 (file)
@@ -70,8 +70,7 @@ nv40_fragtex_build(struct nv40_context *nv40, int unit)
 
        txf  = ps->fmt;
        txf |= tf->format | 0x8000;
-       txf |= ((pt->last_level - pt->first_level + 1) <<
-               NV40TCL_TEX_FORMAT_MIPMAP_COUNT_SHIFT);
+       txf |= ((pt->last_level + 1) << NV40TCL_TEX_FORMAT_MIPMAP_COUNT_SHIFT);
 
        if (1) /* XXX */
                txf |= NV40TCL_TEX_FORMAT_NO_BORDER;
index df70feaa05793cff664f709cff254977c37603e3..1b3c27dc45ba2c002ee78cc27c3eec5589300c81 100644 (file)
@@ -23,7 +23,7 @@ nv40_miptree_layout(struct nv40_miptree *nv40mt)
                nr_faces = 1;
        }
        
-       for (l = pt->first_level; l <= pt->last_level; l++) {
+       for (l = 0; l <= pt->last_level; l++) {
                pt->width[l] = width;
                pt->height[l] = height;
                pt->depth[l] = depth;
@@ -44,7 +44,7 @@ nv40_miptree_layout(struct nv40_miptree *nv40mt)
        }
 
        for (f = 0; f < nr_faces; f++) {
-               for (l = pt->first_level; l <= pt->last_level; l++) {
+               for (l = 0; l <= pt->last_level; l++) {
                        nv40mt->level[l].image_offset[f] = offset;
                        offset += nv40mt->level[l].pitch * pt->height[l];
                }
@@ -87,7 +87,7 @@ nv40_miptree_release(struct pipe_context *pipe, struct pipe_texture **pt)
                int l;
 
                pipe_buffer_reference(ws, &nv40mt->buffer, NULL);
-               for (l = mt->first_level; l <= mt->last_level; l++) {
+               for (l = 0; l <= mt->last_level; l++) {
                        if (nv40mt->level[l].image_offset)
                                free(nv40mt->level[l].image_offset);
                }