struct gl_shader_program *shader_prog,
struct gl_fragment_program *fp,
unsigned dispatch_width)
- : dispatch_width(dispatch_width)
+ : backend_visitor(brw, shader_prog, &fp->Base, &c->prog_data.base),
+ dispatch_width(dispatch_width)
{
this->c = c;
- this->brw = brw;
this->fp = fp;
- this->prog = &fp->Base;
- this->shader_prog = shader_prog;
- this->prog = &fp->Base;
- this->stage_prog_data = &c->prog_data.base;
- this->ctx = &brw->ctx;
this->mem_ctx = ralloc_context(NULL);
if (shader_prog)
shader = (struct brw_shader *)
}
}
+backend_visitor::backend_visitor(struct brw_context *brw,
+ struct gl_shader_program *shader_prog,
+ struct gl_program *prog,
+ struct brw_stage_prog_data *stage_prog_data)
+ : brw(brw),
+ ctx(&brw->ctx),
+ shader_prog(shader_prog),
+ prog(prog),
+ stage_prog_data(stage_prog_data)
+{
+}
+
bool
backend_instruction::is_tex()
{
};
class backend_visitor : public ir_visitor {
+protected:
+
+ backend_visitor(struct brw_context *brw,
+ struct gl_shader_program *shader_prog,
+ struct gl_program *prog,
+ struct brw_stage_prog_data *stage_prog_data);
+
public:
struct brw_context *brw;
shader_time_shader_type st_base,
shader_time_shader_type st_written,
shader_time_shader_type st_reset)
- : c(c),
+ : backend_visitor(brw, shader_prog, prog, &prog_data->base),
+ c(c),
key(key),
prog_data(prog_data),
sanity_param_count(0),
st_written(st_written),
st_reset(st_reset)
{
- this->brw = brw;
- this->ctx = &brw->ctx;
- this->shader_prog = shader_prog;
this->shader = shader;
this->mem_ctx = mem_ctx;
this->current_annotation = NULL;
memset(this->output_reg_annotation, 0, sizeof(this->output_reg_annotation));
- this->prog = prog;
- this->stage_prog_data = &prog_data->base;
-
this->variable_ht = hash_table_ctor(0,
hash_table_pointer_hash,
hash_table_pointer_compare);