summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_common_context.h3
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c10
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c14
3 files changed, 9 insertions, 18 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h
index eba5db017e3..1ae4f878a89 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.h
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h
@@ -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 */
};
diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
index d251670794a..a9901382f84 100644
--- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
+++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
@@ -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++;
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 6b597c8c931..715b93269cc 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -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