Now we can get some NIR debug on Android.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9262>
}
if (shader_debug_enabled(so->type)) {
- fprintf(stdout, "NIR (final form) for %s shader %s:\n",
+ mesa_logi("NIR (final form) for %s shader %s:",
ir3_shader_stage(so), so->shader->nir->info.name);
- nir_print_shader(ctx->s, stdout);
+ nir_log_shaderi(ctx->s);
}
ir3_ibo_mapping_init(&so->image_mapping, ctx->s->info.num_textures);
char *msg = ralloc_vasprintf(errors, format, ap);
_mesa_hash_table_insert(errors, ctx->cur_instr, msg);
} else {
- _debug_vprintf(format, ap);
+ mesa_loge_v(format, ap);
}
va_end(ap);
- nir_print_shader_annotated(ctx->s, stdout, errors);
+ nir_log_shader_annotated(ctx->s, errors);
ralloc_free(errors);
ctx->error = true;
unreachable("");
}
if (ir3_shader_debug & IR3_DBG_DISASM) {
- debug_printf("----------------------\n");
- nir_print_shader(s, stdout);
- debug_printf("----------------------\n");
+ mesa_logi("----------------------");
+ nir_log_shaderi(s);
+ mesa_logi("----------------------");
}
if (s->info.stage == MESA_SHADER_GEOMETRY)
OPT_V(s, nir_remove_dead_variables, nir_var_function_temp, NULL);
if (ir3_shader_debug & IR3_DBG_DISASM) {
- debug_printf("----------------------\n");
- nir_print_shader(s, stdout);
- debug_printf("----------------------\n");
+ mesa_logi("----------------------");
+ nir_log_shaderi(s);
+ mesa_logi("----------------------");
}
/* st_program.c's parameter list optimization requires that future nir
ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
{
if (ir3_shader_debug & IR3_DBG_DISASM) {
- debug_printf("----------------------\n");
- nir_print_shader(s, stdout);
- debug_printf("----------------------\n");
+ mesa_logi("----------------------");
+ nir_log_shaderi(s);
+ mesa_logi("----------------------");
}
bool progress = false;
OPT_V(s, nir_opt_sink, nir_move_const_undef);
if (ir3_shader_debug & IR3_DBG_DISASM) {
- debug_printf("----------------------\n");
- nir_print_shader(s, stdout);
- debug_printf("----------------------\n");
+ mesa_logi("----------------------");
+ nir_log_shaderi(s);
+ mesa_logi("----------------------");
}
nir_sweep(s);
struct state state = { .topology = topology };
if (shader_debug_enabled(shader->info.stage)) {
- fprintf(stderr, "NIR (before tess lowering) for %s shader:\n",
- _mesa_shader_stage_to_string(shader->info.stage));
- nir_print_shader(shader, stderr);
+ mesa_logi("NIR (before tess lowering) for %s shader:",
+ _mesa_shader_stage_to_string(shader->info.stage));
+ nir_log_shaderi(shader);
}
build_primitive_map(shader, &state.map);
struct state state = { .topology = topology };
if (shader_debug_enabled(shader->info.stage)) {
- fprintf(stderr, "NIR (before tess lowering) for %s shader:\n",
- _mesa_shader_stage_to_string(shader->info.stage));
- nir_print_shader(shader, stderr);
+ mesa_logi("NIR (before tess lowering) for %s shader:",
+ _mesa_shader_stage_to_string(shader->info.stage));
+ nir_log_shaderi(shader);
}
nir_function_impl *impl = nir_shader_get_entrypoint(shader);
struct state state = { };
if (shader_debug_enabled(shader->info.stage)) {
- fprintf(stderr, "NIR (before gs lowering):\n");
- nir_print_shader(shader, stderr);
+ mesa_logi("NIR (before gs lowering):");
+ nir_log_shaderi(shader);
}
/* Create an output var for vertex_flags. This will be shadowed below,
nir_fixup_deref_modes(shader);
if (shader_debug_enabled(shader->info.stage)) {
- fprintf(stderr, "NIR (after gs lowering):\n");
- nir_print_shader(shader, stderr);
+ mesa_logi("NIR (after gs lowering):");
+ nir_log_shaderi(shader);
}
}
ir3_nir_post_finalize(shader->compiler, shader->nir);
if (ir3_shader_debug & IR3_DBG_DISASM) {
- printf("dump nir%d: type=%d", shader->id, shader->type);
- nir_print_shader(shader->nir, stdout);
+ mesa_logi("dump nir%d: type=%d", shader->id, shader->type);
+ nir_log_shaderi(shader->nir);
}
if (v->disasm_info.write_disasm) {