bool
brw_vs_emit(struct brw_context *brw,
struct gl_shader_program *prog,
- struct brw_vs_compile *c)
+ struct brw_vs_compile *c,
+ void *mem_ctx)
{
struct intel_context *intel = &brw->intel;
bool start_busy = false;
shader->compiled_once = true;
}
- vec4_visitor v(brw, c, prog, shader);
+ vec4_visitor v(brw, c, prog, shader, mem_ctx);
if (!v.run()) {
prog->LinkStatus = false;
ralloc_strcat(&prog->InfoLog, v.fail_msg);
public:
vec4_visitor(struct brw_context *brw,
struct brw_vs_compile *c,
- struct gl_shader_program *prog, struct brw_shader *shader);
+ struct gl_shader_program *prog,
+ struct brw_shader *shader,
+ void *mem_ctx);
~vec4_visitor();
dst_reg dst_null_f()
vec4_visitor::vec4_visitor(struct brw_context *brw,
struct brw_vs_compile *c,
struct gl_shader_program *prog,
- struct brw_shader *shader)
+ struct brw_shader *shader,
+ void *mem_ctx)
{
this->c = c;
this->p = &c->func;
this->prog = prog;
this->shader = shader;
- this->mem_ctx = ralloc_context(NULL);
+ this->mem_ctx = mem_ctx;
this->failed = false;
this->base_ir = NULL;
vec4_visitor::~vec4_visitor()
{
- ralloc_free(this->mem_ctx);
hash_table_dtor(this->variable_ht);
}
/* Emit GEN4 code.
*/
- if (!brw_vs_emit(brw, prog, &c)) {
+ if (!brw_vs_emit(brw, prog, &c, mem_ctx)) {
ralloc_free(mem_ctx);
return false;
}
bool brw_vs_emit(struct brw_context *brw,
struct gl_shader_program *prog,
- struct brw_vs_compile *c);
+ struct brw_vs_compile *c,
+ void *mem_ctx);
bool brw_vs_precompile(struct gl_context *ctx, struct gl_shader_program *prog);
void brw_vs_debug_recompile(struct brw_context *brw,
struct gl_shader_program *prog,