From bf364cbdb40f044d2a11b6fe5636e8a039fdad81 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 31 Oct 2023 10:13:52 +0100 Subject: [PATCH] radeonsi: Fix offset for linear surfaces on GFX < 9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: 86262b6eac0 ("radeonsi,radv: fix usages of surf_pitch") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9949 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10073 Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_texture.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index b13b8a80e1d..084dca54d6a 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -638,7 +638,9 @@ static bool si_resource_get_param(struct pipe_screen *screen, struct pipe_contex if (resource->target == PIPE_BUFFER) { *value = 0; } else { - uint64_t level_offset = tex->surface.is_linear ? tex->surface.u.gfx9.offset[level] : 0; + uint64_t level_offset = 0; + if (sscreen->info.gfx_level >= GFX9 && tex->surface.is_linear) + level_offset = tex->surface.u.gfx9.offset[level]; *value = ac_surface_get_plane_offset(sscreen->info.gfx_level, &tex->surface, plane, layer) + level_offset; }