struct brw_shader *shader;
shader = talloc_zero(NULL, struct brw_shader);
- shader->base.Type = type;
- shader->base.Name = name;
if (shader) {
+ shader->base.Type = type;
+ shader->base.Name = name;
_mesa_init_shader(ctx, &shader->base);
}
struct brw_shader_program *prog;
prog = talloc_zero(NULL, struct brw_shader_program);
if (prog) {
+ prog->base.Name = name;
_mesa_init_shader_program(ctx, &prog->base);
}
return &prog->base;
void *mem_ctx = talloc_new(NULL);
bool progress;
+ if (shader->ir)
+ talloc_free(shader->ir);
shader->ir = new(shader) exec_list;
clone_ir_list(mem_ctx, shader->ir, shader->base.ir);
progress = do_common_optimization(shader->ir, true) || progress;
} while (progress);
- reparent_ir(shader->ir, shader);
+ reparent_ir(shader->ir, shader->ir);
talloc_free(mem_ctx);
}
}
functions->IsProgramNative = brwIsProgramNative;
functions->ProgramStringNotify = brwProgramStringNotify;
+ functions->NewShader = brw_new_shader;
+ functions->NewShaderProgram = brw_new_shader_program;
functions->CompileShader = brw_compile_shader;
functions->LinkShader = brw_link_shader;
}