intel/compiler: Respect NIR_DEBUG_PRINT_INTERNAL flag

If flag is not set, don't print debugging
information for internal shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23756>
This commit is contained in:
Caio Oliveira
2023-06-20 14:42:02 -07:00
committed by Marge Bot
parent af9be8c024
commit fde8bf7b7f
7 changed files with 21 additions and 10 deletions

View File

@@ -7460,7 +7460,7 @@ brw_compile_fs(const struct brw_compiler *compiler,
struct brw_wm_prog_data *prog_data = params->prog_data;
bool allow_spilling = params->allow_spilling;
const bool debug_enabled =
INTEL_DEBUG(params->debug_flag ? params->debug_flag : DEBUG_WM);
brw_should_print_shader(nir, params->debug_flag ? params->debug_flag : DEBUG_WM);
prog_data->base.stage = MESA_SHADER_FRAGMENT;
prog_data->base.ray_queries = nir->info.ray_queries;
@@ -7817,7 +7817,7 @@ brw_compile_cs(const struct brw_compiler *compiler,
struct brw_cs_prog_data *prog_data = params->prog_data;
const bool debug_enabled =
INTEL_DEBUG(params->debug_flag ? params->debug_flag : DEBUG_CS);
brw_should_print_shader(nir, params->debug_flag ? params->debug_flag : DEBUG_CS);
prog_data->base.stage = MESA_SHADER_COMPUTE;
prog_data->base.total_shared = nir->info.shared_size;
@@ -7966,7 +7966,7 @@ compile_single_bs(const struct brw_compiler *compiler, void *log_data,
int *prog_offset,
char **error_str)
{
const bool debug_enabled = INTEL_DEBUG(DEBUG_RT);
const bool debug_enabled = brw_should_print_shader(shader, DEBUG_RT);
prog_data->base.stage = shader->info.stage;
prog_data->max_stack_size = MAX2(prog_data->max_stack_size,
@@ -8060,7 +8060,7 @@ brw_compile_bs(const struct brw_compiler *compiler,
struct brw_bs_prog_data *prog_data = params->prog_data;
unsigned num_resume_shaders = params->num_resume_shaders;
nir_shader **resume_shaders = params->resume_shaders;
const bool debug_enabled = INTEL_DEBUG(DEBUG_RT);
const bool debug_enabled = brw_should_print_shader(shader, DEBUG_RT);
prog_data->base.stage = shader->info.stage;
prog_data->base.ray_queries = shader->info.ray_queries;
@@ -8167,3 +8167,8 @@ fs_visitor::workgroup_size() const
const struct brw_cs_prog_data *cs = brw_cs_prog_data(prog_data);
return cs->local_size[0] * cs->local_size[1] * cs->local_size[2];
}
bool brw_should_print_shader(const nir_shader *shader, uint64_t debug_flag)
{
return INTEL_DEBUG(debug_flag) && (!shader->info.internal || NIR_DEBUG(PRINT_INTERNAL));
}