{ NULL, 0, NULL, 0 }
};
+static void
+steal_memory(ir_instruction *ir, void *new_ctx)
+{
+ talloc_steal(new_ctx, ir);
+}
+
void
compile_shader(struct gl_shader *shader)
{
shader->InfoLog = state->info_log;
+ /* Retain any live IR, but trash the rest. */
+ foreach_list(node, shader->ir) {
+ visit_tree((ir_instruction *) node, steal_memory, shader);
+ }
+
talloc_free(state);
return;
extern "C" {
+static void
+steal_memory(ir_instruction *ir, void *new_ctx)
+{
+ talloc_steal(new_ctx, ir);
+}
+
void
_mesa_glsl_compile_shader(GLcontext *ctx, struct gl_shader *shader)
{
shader->CompileStatus = !state->error;
shader->InfoLog = state->info_log;
+ /* Retain any live IR, but trash the rest. */
+ foreach_list(node, shader->ir) {
+ visit_tree((ir_instruction *) node, steal_memory, shader);
+ }
+
talloc_free(state);
}