From f1f2d407e77d05e34e6892709c58cbef96d54415 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 29 Apr 2022 16:39:43 +0200 Subject: [PATCH] radeonsi: don't always strip NIR debug infos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using NIR_DEBUG=print, always having shader names help debugging. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_state_shaders.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.cpp b/src/gallium/drivers/radeonsi/si_state_shaders.cpp index 09eff4aa54b..ff9003106b7 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.cpp +++ b/src/gallium/drivers/radeonsi/si_state_shaders.cpp @@ -154,7 +154,8 @@ void si_get_ir_cache_key(struct si_shader_selector *sel, bool ngg, bool es, assert(sel->nir); blob_init(&blob); - nir_serialize(&blob, sel->nir, true); + /* Keep debug info if NIR debug prints are in use. */ + nir_serialize(&blob, sel->nir, NIR_DEBUG(PRINT) == 0); ir_binary = blob.data; ir_size = blob.size; } @@ -2846,8 +2847,10 @@ static void si_init_shader_selector_async(void *job, void *gdata, int thread_ind /* true = remove optional debugging data to increase * the likehood of getting more shader cache hits. * It also drops variable names, so we'll save more memory. + * If NIR debug prints are used we don't strip to get more + * useful logs. */ - nir_serialize(&blob, sel->nir, true); + nir_serialize(&blob, sel->nir, NIR_DEBUG(PRINT) == 0); blob_finish_get_buffer(&blob, &sel->nir_binary, &size); sel->nir_size = size; }