#include <string.h>
#include "pan_bo.h"
#include "pan_context.h"
+#include "pan_util.h"
#include "compiler/nir/nir.h"
#include "nir/tgsi_to_nir.h"
.alpha_ref = state->alpha_state.ref_value
};
- midgard_compile_shader_nir(s, &program, false, 0, screen->gpu_id);
+ midgard_compile_shader_nir(s, &program, false, 0, screen->gpu_id,
+ pan_debug & PAN_DBG_PRECOMPILE);
/* Prepare the compiled binary for upload */
int size = program.compiled.size;
/* Compile the built shader */
midgard_program program;
- midgard_compile_shader_nir(shader, &program, true, rt, screen->gpu_id);
+ midgard_compile_shader_nir(shader, &program, true, rt, screen->gpu_id, false);
/* Allow us to patch later */
res.patch_index = program.blend_patch_offset;
}
int
-midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id)
+midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id, bool shaderdb)
{
struct util_dynarray *compiled = &program->compiled;
if (midgard_debug & MIDGARD_DBG_SHADERS)
disassemble_midgard(program->compiled.data, program->compiled.size, gpu_id, ctx->stage);
- if (midgard_debug & MIDGARD_DBG_SHADERDB) {
+ if (midgard_debug & MIDGARD_DBG_SHADERDB || shaderdb) {
unsigned nr_bundles = 0, nr_ins = 0;
/* Count instructions and bundles */
} midgard_program;
int
-midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id);
+midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_blend, unsigned blend_rt, unsigned gpu_id, bool shaderdb);
/* NIR options are shared between the standalone compiler and the online
* compiler. Defining it here is the simplest, though maybe not the Right