radeon: drop mtface/mtlevel, use ones in base class.
authorDave Airlie <airlied@redhat.com>
Fri, 4 Nov 2011 10:47:40 +0000 (10:47 +0000)
committerDave Airlie <airlied@redhat.com>
Fri, 4 Nov 2011 17:17:17 +0000 (17:17 +0000)
This just uses the base class copies.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/drivers/dri/radeon/radeon_common_context.h
src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
src/mesa/drivers/dri/radeon/radeon_texture.c

index eba5db017e3bfe0f26f42925ccf1567f83072c33..1ae4f878a8900b7493e57ec05d41e786f9846a04 100644 (file)
@@ -174,9 +174,6 @@ struct _radeon_texture_image {
         */
        struct _radeon_mipmap_tree *mt;
        struct radeon_bo *bo;
-
-       int mtlevel; /** if mt != 0, this is the image's level in the mipmap tree */
-       int mtface; /** if mt != 0, this is the image's face in the mipmap tree */
 };
 
 
index d251670794abddb193e94330adaa0dda519b98e1..a9901382f84f53f723a73c945979cbb80116f1e3 100644 (file)
@@ -466,9 +466,9 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt,
                 */
                assert(mt->mesaFormat == image->base.Base.TexFormat);
 
-               radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel];
+               radeon_mipmap_level *srclvl = &image->mt->levels[image->base.Base.Level];
 
-               assert(image->mtlevel == level);
+               assert(image->base.Base.Level == level);
                assert(srclvl->size == dstlvl->size);
                assert(srclvl->rowstride == dstlvl->rowstride);
 
@@ -506,8 +506,6 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt,
        radeon_bo_unmap(mt->bo);
 
        radeon_miptree_reference(mt, &image->mt);
-       image->mtface = face;
-       image->mtlevel = level;
 }
 
 /**
@@ -542,13 +540,13 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj,
                for (i = 0; i < mtCount; ++i) {
                        if (mts[i] == img->mt) {
                                found = 1;
-                               mtSizes[i] += img->mt->levels[img->mtlevel].size;
+                               mtSizes[i] += img->mt->levels[img->base.Base.Level].size;
                                break;
                        }
                }
 
                if (!found && radeon_miptree_matches_texture(img->mt, &texObj->base)) {
-                       mtSizes[mtCount] = img->mt->levels[img->mtlevel].size;
+                       mtSizes[mtCount] = img->mt->levels[img->base.Base.Level].size;
                        mts[mtCount] = img->mt;
                        mtCount++;
                }
index 6b597c8c93172f443a6933f7e68211be0184219d..715b93269cc6ca954045c3d6d7ae4484d7698123 100644 (file)
@@ -135,9 +135,9 @@ static void teximage_set_map_data(radeon_texture_image *image)
                return;
        }
 
-       lvl = &image->mt->levels[image->mtlevel];
+       lvl = &image->mt->levels[image->base.Base.Level];
 
-       image->base.Data = image->mt->bo->ptr + lvl->faces[image->mtface].offset;
+       image->base.Data = image->mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
        image->base.RowStride = lvl->rowstride / _mesa_get_format_bytes(image->base.Base.TexFormat);
 }
 
@@ -304,7 +304,7 @@ radeon_map_texture_image(struct gl_context *ctx,
        } else if (likely(mt)) {
                radeon_bo_map(mt->bo, write);
                radeon_mipmap_level *lvl = &image->mt->levels[texImage->Level];
-               void *base = mt->bo->ptr + lvl->faces[image->mtface].offset;
+               void *base = mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
 
                *stride = lvl->rowstride;
                *map = base + (slice * height) * *stride;
@@ -647,8 +647,6 @@ static void teximage_assign_miptree(radeonContextPtr rmesa,
        /* Miptree alocation may have failed,
         * when there was no image for baselevel specified */
        if (t->mt) {
-               image->mtface = face;
-               image->mtlevel = level;
                radeon_miptree_reference(t->mt, &image->mt);
        } else
                radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
@@ -684,7 +682,7 @@ static void radeon_store_teximage(struct gl_context* ctx, int dims,
                        __func__, ctx, texObj, texImage, compressed);
 
        if (image->mt) {
-               dstRowStride = image->mt->levels[image->mtlevel].rowstride;
+               dstRowStride = image->mt->levels[image->base.Base.Level].rowstride;
        } else if (t->bo) {
                /* TFP case */
                dstRowStride = get_texture_image_row_stride(rmesa, texImage->TexFormat, width, 0);
@@ -1049,8 +1047,6 @@ void radeon_image_target_texture_2d(struct gl_context *ctx, GLenum target,
 
        radeon_try_alloc_miptree(radeon, t);
 
-       radeonImage->mtface = _mesa_tex_target_to_face(target);
-       radeonImage->mtlevel = 0;
        radeon_miptree_reference(t->mt, &radeonImage->mt);
 
        if (t->mt == NULL)
@@ -1067,7 +1063,7 @@ void radeon_image_target_texture_2d(struct gl_context *ctx, GLenum target,
        t->mt->bo = image->bo;
 
        if (!radeon_miptree_matches_image(t->mt, &radeonImage->base.Base,
-                                         radeonImage->mtface, 0))
+                                         radeonImage->base.Base.Face, 0))
                fprintf(stderr, "miptree doesn't match image\n");
 }
 #endif