From 19e342b8770d2a0c50dcbd61f3011939ca7679d7 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 17 Jun 2024 13:04:53 +0200 Subject: [PATCH] radeonsi: handle DBG(TEX) after tc_compatible_htile is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise the value printed might be incorrect. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_texture.c | 26 ++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index d43b42b2684..92e97f7e0bc 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -977,6 +977,19 @@ void si_print_texture_info(struct si_screen *sscreen, struct si_texture *tex, } } +static void print_debug_tex(struct si_screen *sscreen, struct si_texture *tex) +{ + if (sscreen->debug_flags & DBG(TEX)) { + puts("Texture:"); + struct u_log_context log; + u_log_context_init(&log); + si_print_texture_info(sscreen, tex, &log); + u_log_new_page_print(&log, stdout); + fflush(stdout); + u_log_context_destroy(&log); + } +} + /** * Common function for si_texture_create and si_texture_from_handle. * @@ -1077,17 +1090,8 @@ static struct si_texture *si_texture_create_object(struct pipe_screen *screen, fprintf(stderr, "\n"); } - if (sscreen->debug_flags & DBG(TEX)) { - puts("Texture:"); - struct u_log_context log; - u_log_context_init(&log); - si_print_texture_info(sscreen, tex, &log); - u_log_new_page_print(&log, stdout); - fflush(stdout); - u_log_context_destroy(&log); - } - if (sscreen->info.gfx_level >= GFX12) { + print_debug_tex(sscreen, tex); if (tex->is_depth) { /* Z24 is no longer supported. We should use Z32_FLOAT instead. */ if (base->format == PIPE_FORMAT_Z16_UNORM) { @@ -1126,6 +1130,8 @@ static struct si_texture *si_texture_create_object(struct pipe_screen *screen, tex->surface.flags & RADEON_SURF_TC_COMPATIBLE_HTILE && tex->buffer.b.b.last_level > 0); + print_debug_tex(sscreen, tex); + /* TC-compatible HTILE: * - GFX8 only supports Z32_FLOAT. * - GFX9 only supports Z32_FLOAT and Z16_UNORM. */