#include "ir3/ir3_nir.h"
static void
-dump_shader_info(struct ir3_shader_variant *v, bool binning_pass,
- struct pipe_debug_callback *debug)
+dump_shader_info(struct ir3_shader_variant *v, struct pipe_debug_callback *debug)
{
if (!unlikely(fd_mesa_debug & FD_DBG_SHADERDB))
return;
pipe_debug_message(debug, SHADER_INFO,
"%s shader: %u inst, %u nops, %u non-nops, %u mov, %u cov, "
"%u dwords, %u last-baryf, %u half, %u full, %u constlen, "
+ "%u cat0, %u cat1, %u cat2, %u cat3, %u cat4, %u cat5, %u cat6, %u cat7, "
"%u sstall, %u (ss), %u (sy), %d max_sun, %d loops\n",
ir3_shader_stage(v),
v->info.instrs_count,
v->info.max_half_reg + 1,
v->info.max_reg + 1,
v->constlen,
+ v->info.instrs_per_cat[0],
+ v->info.instrs_per_cat[1],
+ v->info.instrs_per_cat[2],
+ v->info.instrs_per_cat[3],
+ v->info.instrs_per_cat[4],
+ v->info.instrs_per_cat[5],
+ v->info.instrs_per_cat[6],
+ v->info.instrs_per_cat[7],
v->info.sstall,
v->info.ss, v->info.sy,
v->max_sun, v->loops);
key.vastc_srgb, key.fastc_srgb);
}
- dump_shader_info(v, binning_pass, debug);
+ dump_shader_info(v, debug);
upload_shader_variant(v);
+
+ if (v->binning) {
+ upload_shader_variant(v->binning);
+ dump_shader_info(v->binning, debug);
+ }
}
return v;
fd_bo_del(v->bo);
v->bo = NULL;
- if (v->binning) {
+ if (v->binning && v->binning->bo) {
fd_bo_del(v->binning->bo);
v->binning->bo = NULL;
}
ir3_shader_destroy(so);
}
+static void
+ir3_screen_finalize_nir(struct pipe_screen *pscreen, void *nir, bool optimize)
+{
+ struct fd_screen *screen = fd_screen(pscreen);
+
+ ir3_finalize_nir(screen->compiler, nir);
+}
+
void
ir3_prog_init(struct pipe_context *pctx)
{
pctx->create_fs_state = ir3_shader_state_create;
pctx->delete_fs_state = ir3_shader_state_delete;
}
+
+void
+ir3_screen_init(struct pipe_screen *pscreen)
+{
+ pscreen->finalize_nir = ir3_screen_finalize_nir;
+}