From: Marek Olšák Date: Sat, 15 Oct 2016 13:27:57 +0000 (+0200) Subject: radeonsi/gfx9: don't write mipmap level offsets to BO metadata X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3685a12bad497bd979abf94d2c64ed9dcf1cdc5a;p=mesa.git radeonsi/gfx9: don't write mipmap level offsets to BO metadata GFX9 doesn't have (usable) mipmap offsets. Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index f6c6f1f2dc5..de64e64a338 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -4053,12 +4053,15 @@ static void si_query_opaque_metadata(struct r600_common_screen *rscreen, /* Dwords [2:9] contain the image descriptor. */ memcpy(&md->metadata[2], desc, sizeof(desc)); + md->size_metadata = 10 * 4; /* Dwords [10:..] contain the mipmap level offsets. */ - for (i = 0; i <= res->last_level; i++) - md->metadata[10+i] = rtex->surface.u.legacy.level[i].offset >> 8; + if (rscreen->chip_class <= VI) { + for (i = 0; i <= res->last_level; i++) + md->metadata[10+i] = rtex->surface.u.legacy.level[i].offset >> 8; - md->size_metadata = (11 + res->last_level) * 4; + md->size_metadata += (1 + res->last_level) * 4; + } } static void si_apply_opaque_metadata(struct r600_common_screen *rscreen,