{
public:
brw_blorp_blit_program(struct brw_context *brw,
- const brw_blorp_blit_prog_key *key);
+ const brw_blorp_blit_prog_key *key, bool debug_flag);
const GLuint *compile(struct brw_context *brw, GLuint *program_size,
FILE *dump_file = stderr);
brw_blorp_blit_program::brw_blorp_blit_program(
struct brw_context *brw,
- const brw_blorp_blit_prog_key *key)
- : brw_blorp_eu_emitter(brw),
+ const brw_blorp_blit_prog_key *key,
+ bool debug_flag)
+ : brw_blorp_eu_emitter(brw, debug_flag),
brw(brw),
key(key)
{
if (!brw_search_cache(&brw->cache, BRW_BLORP_BLIT_PROG,
&this->wm_prog_key, sizeof(this->wm_prog_key),
&prog_offset, prog_data)) {
- brw_blorp_blit_program prog(brw, &this->wm_prog_key);
+ brw_blorp_blit_program prog(brw, &this->wm_prog_key,
+ INTEL_DEBUG & DEBUG_BLORP);
GLuint program_size;
const GLuint *program = prog.compile(brw, &program_size, stderr);
brw_upload_cache(&brw->cache, BRW_BLORP_BLIT_PROG,
#include "brw_blorp_blit_eu.h"
#include "brw_blorp.h"
-brw_blorp_eu_emitter::brw_blorp_eu_emitter(struct brw_context *brw)
+brw_blorp_eu_emitter::brw_blorp_eu_emitter(struct brw_context *brw,
+ bool debug_flag)
: mem_ctx(ralloc_context(NULL)),
generator(brw, mem_ctx,
rzalloc(mem_ctx, struct brw_wm_prog_key),
rzalloc(mem_ctx, struct brw_wm_prog_data),
- NULL, NULL, false)
+ NULL, NULL, false, debug_flag)
{
}
const unsigned *
brw_blorp_eu_emitter::get_program(unsigned *program_size, FILE *dump_file)
{
- const unsigned *res;
-
- if (unlikely(INTEL_DEBUG & DEBUG_BLORP)) {
- fprintf(stderr, "Native code for BLORP blit:\n");
- res = generator.generate_assembly(NULL, &insts, program_size, dump_file);
- fprintf(stderr, "\n");
- } else {
- res = generator.generate_assembly(NULL, &insts, program_size);
- }
-
- return res;
+ return generator.generate_assembly(NULL, &insts, program_size, dump_file);
}
/**
class brw_blorp_eu_emitter
{
protected:
- explicit brw_blorp_eu_emitter(struct brw_context *brw);
+ explicit brw_blorp_eu_emitter(struct brw_context *brw, bool debug_flag);
~brw_blorp_eu_emitter();
const unsigned *get_program(unsigned *program_size, FILE *dump_file);
assembly = g.generate_assembly(&v.instructions, simd16_instructions,
final_assembly_size);
} else {
- fs_generator g(brw, mem_ctx, key, prog_data, prog, fp, v.do_dual_src);
+ fs_generator g(brw, mem_ctx, key, prog_data, prog, fp, v.do_dual_src,
+ INTEL_DEBUG & DEBUG_WM);
assembly = g.generate_assembly(&v.instructions, simd16_instructions,
final_assembly_size);
}
struct brw_wm_prog_data *prog_data,
struct gl_shader_program *prog,
struct gl_fragment_program *fp,
- bool dual_source_output);
+ bool dual_source_output,
+ bool debug_flag);
~fs_generator();
const unsigned *generate_assembly(exec_list *simd8_instructions,
exec_list discard_halt_patches;
bool dual_source_output;
+ const bool debug_flag;
void *mem_ctx;
};
struct brw_wm_prog_data *prog_data,
struct gl_shader_program *prog,
struct gl_fragment_program *fp,
- bool dual_source_output)
+ bool dual_source_output,
+ bool debug_flag)
: brw(brw), key(key), prog_data(prog_data), prog(prog), fp(fp),
- dual_source_output(dual_source_output), mem_ctx(mem_ctx)
+ dual_source_output(dual_source_output), debug_flag(debug_flag),
+ mem_ctx(mem_ctx)
{
ctx = &brw->ctx;
const char *last_annotation_string = NULL;
const void *last_annotation_ir = NULL;
- if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
+ if (unlikely(debug_flag)) {
if (prog) {
fprintf(stderr,
"Native code for %s fragment shader %d (SIMD%d dispatch):\n",
}
cfg_t *cfg = NULL;
- if (unlikely(INTEL_DEBUG & DEBUG_WM))
+ if (unlikely(debug_flag))
cfg = new(mem_ctx) cfg_t(instructions);
foreach_list(node, instructions) {
fs_inst *inst = (fs_inst *)node;
struct brw_reg src[3], dst;
- if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
+ if (unlikely(debug_flag)) {
foreach_list(node, &cfg->block_list) {
bblock_link *link = (bblock_link *)node;
bblock_t *block = link->block;
abort();
}
- if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
+ if (unlikely(debug_flag)) {
brw_disassemble(brw, p->store, last_native_insn_offset, p->next_insn_offset, stderr);
foreach_list(node, &cfg->block_list) {
last_native_insn_offset = p->next_insn_offset;
}
- if (unlikely(INTEL_DEBUG & DEBUG_WM)) {
+ if (unlikely(debug_flag)) {
fprintf(stderr, "\n");
}