mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
radeon: drop mtface/mtlevel, use ones in base class.
This just uses the base class copies. Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
85c151f3d9
commit
2431c992cb
3 changed files with 9 additions and 18 deletions
|
|
@ -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 */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue