return NULL;
}
- vec4_generator g(brw, prog, &c->vp->program.Base, mem_ctx);
+ vec4_generator g(brw, prog, &c->vp->program.Base, mem_ctx,
+ INTEL_DEBUG & DEBUG_VS);
const unsigned *generated =g.generate_assembly(&v.instructions,
final_assembly_size);
struct brw_vec4_prog_data *prog_data,
struct gl_shader_program *shader_prog,
struct brw_shader *shader,
- void *mem_ctx);
+ void *mem_ctx,
+ bool debug_flag);
~vec4_visitor();
dst_reg dst_null_f()
virtual void emit_urb_write_header(int mrf) = 0;
virtual vec4_instruction *emit_urb_write_opcode(bool complete) = 0;
virtual int compute_array_stride(ir_dereference_array *ir);
+
+ const bool debug_flag;
};
class vec4_vs_visitor : public vec4_visitor
vec4_generator(struct brw_context *brw,
struct gl_shader_program *shader_prog,
struct gl_program *prog,
- void *mem_ctx);
+ void *mem_ctx,
+ bool debug_flag);
~vec4_generator();
const unsigned *generate_assembly(exec_list *insts, unsigned *asm_size);
const struct gl_program *prog;
void *mem_ctx;
+ const bool debug_flag;
};
} /* namespace brw */
vec4_generator::vec4_generator(struct brw_context *brw,
struct gl_shader_program *shader_prog,
struct gl_program *prog,
- void *mem_ctx)
- : brw(brw), shader_prog(shader_prog), prog(prog), mem_ctx(mem_ctx)
+ void *mem_ctx,
+ bool debug_flag)
+ : brw(brw), shader_prog(shader_prog), prog(prog), mem_ctx(mem_ctx),
+ debug_flag(debug_flag)
{
intel = &brw->intel;
const char *last_annotation_string = NULL;
const void *last_annotation_ir = NULL;
- if (unlikely(INTEL_DEBUG & DEBUG_VS)) {
+ if (unlikely(debug_flag)) {
if (shader) {
printf("Native code for vertex shader %d:\n", shader_prog->Name);
} else {
vec4_instruction *inst = (vec4_instruction *)node;
struct brw_reg src[3], dst;
- if (unlikely(INTEL_DEBUG & DEBUG_VS)) {
+ if (unlikely(debug_flag)) {
if (last_annotation_ir != inst->ir) {
last_annotation_ir = inst->ir;
if (last_annotation_ir) {
last->header.dependency_control |= BRW_DEPENDENCY_NOTCHECKED;
}
- if (unlikely(INTEL_DEBUG & DEBUG_VS)) {
+ if (unlikely(debug_flag)) {
brw_dump_compile(p, stdout,
last_native_insn_offset, p->next_insn_offset);
}
last_native_insn_offset = p->next_insn_offset;
}
- if (unlikely(INTEL_DEBUG & DEBUG_VS)) {
+ if (unlikely(debug_flag)) {
printf("\n");
}
* which is often something we want to debug. So this is here in
* case you're doing that.
*/
- if (0 && unlikely(INTEL_DEBUG & DEBUG_VS)) {
+ if (0 && unlikely(debug_flag)) {
brw_dump_compile(p, stdout, 0, p->next_insn_offset);
}
}
struct brw_vec4_prog_data *prog_data,
struct gl_shader_program *shader_prog,
struct brw_shader *shader,
- void *mem_ctx)
+ void *mem_ctx,
+ bool debug_flag)
+ : debug_flag(debug_flag)
{
this->brw = brw;
this->intel = &brw->intel;
void *mem_ctx)
: vec4_visitor(brw, &vs_compile->base, &vs_compile->vp->program.Base,
&vs_compile->key.base, &vs_prog_data->base, prog, shader,
- mem_ctx),
+ mem_ctx, INTEL_DEBUG & DEBUG_VS),
vs_compile(vs_compile),
vs_prog_data(vs_prog_data)
{
this->fail_msg = msg;
- if (INTEL_DEBUG & DEBUG_VS) {
+ if (debug_flag) {
fprintf(stderr, "%s", msg);
}
}
public:
register_coalesce_vec4_visitor(struct brw_context *brw,
struct gl_shader_program *shader_prog)
- : vec4_visitor(brw, NULL, NULL, NULL, NULL, shader_prog, NULL, NULL)
+ : vec4_visitor(brw, NULL, NULL, NULL, NULL, shader_prog, NULL, NULL,
+ false)
{
}