summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/radeonsi/si_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-04-02 13:33:38 -0400
committerMarge Bot <eric+marge@anholt.net>2021-04-12 20:53:45 +0000
commit48dbdc62bf8611c60a7c27ece9b7c5ba11212e46 (patch)
treefa40116608977e275b7c2038816731f8e4a01c39 /src/gallium/drivers/radeonsi/si_texture.c
parentbbda20bf292ba9c74966a311b40d92dcfe019a0b (diff)
ac/surface: change legacy_surf_level::offset to 32-bit offset_256B shifted by 8
Images are always aligned to 256B (enforced by register and descriptor fields) and limited to 40-bit addresses. This saves some space. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10083>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_texture.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_texture.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c
index 30f2cea12e4..ce750fe3d90 100644
--- a/src/gallium/drivers/radeonsi/si_texture.c
+++ b/src/gallium/drivers/radeonsi/si_texture.c
@@ -142,11 +142,11 @@ static unsigned si_texture_get_offset(struct si_screen *sscreen, struct si_textu
*layer_stride = (uint64_t)tex->surface.u.legacy.level[level].slice_size_dw * 4;
if (!box)
- return tex->surface.u.legacy.level[level].offset;
+ return (uint64_t)tex->surface.u.legacy.level[level].offset_256B * 256;
/* Each texture is an array of mipmap levels. Each level is
* an array of slices. */
- return tex->surface.u.legacy.level[level].offset +
+ return (uint64_t)tex->surface.u.legacy.level[level].offset_256B * 256 +
box->z * (uint64_t)tex->surface.u.legacy.level[level].slice_size_dw * 4 +
(box->y / tex->surface.blk_h * tex->surface.u.legacy.level[level].nblk_x +
box->x / tex->surface.blk_w) *
@@ -846,7 +846,7 @@ void si_print_texture_info(struct si_screen *sscreen, struct si_texture *tex,
" Level[%i]: offset=%" PRIu64 ", slice_size=%" PRIu64 ", "
"npix_x=%u, npix_y=%u, npix_z=%u, nblk_x=%u, nblk_y=%u, "
"mode=%u, tiling_index = %u\n",
- i, tex->surface.u.legacy.level[i].offset,
+ i, (uint64_t)tex->surface.u.legacy.level[i].offset_256B * 256,
(uint64_t)tex->surface.u.legacy.level[i].slice_size_dw * 4,
u_minify(tex->buffer.b.b.width0, i), u_minify(tex->buffer.b.b.height0, i),
u_minify(tex->buffer.b.b.depth0, i), tex->surface.u.legacy.level[i].nblk_x,
@@ -860,7 +860,7 @@ void si_print_texture_info(struct si_screen *sscreen, struct si_texture *tex,
"slice_size=%" PRIu64 ", npix_x=%u, "
"npix_y=%u, npix_z=%u, nblk_x=%u, nblk_y=%u, "
"mode=%u, tiling_index = %u\n",
- i, tex->surface.u.legacy.stencil_level[i].offset,
+ i, (uint64_t)tex->surface.u.legacy.stencil_level[i].offset_256B * 256,
(uint64_t)tex->surface.u.legacy.stencil_level[i].slice_size_dw * 4,
u_minify(tex->buffer.b.b.width0, i), u_minify(tex->buffer.b.b.height0, i),
u_minify(tex->buffer.b.b.depth0, i),