From 953ff1283d3d52e6a6b4850c2b0b574111625010 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 25 Jun 2010 13:14:37 -0700 Subject: glsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader. _mesa_glsl_parse_state should be the parent for all temporary allocation done while compiling a shader. glsl_shader should only be used as the parent for the shader's final IR---the _result_ of compilation. Since many IR instructions may be added or discarded during optimization passes, IR should not ever be allocated to glsl_shader directly. Done via sed -i s/talloc_parent(state)/state/g and s/talloc_parent(st)/st/g. This also removes a ton of talloc_parent calls, which may help performance. --- src/glsl/hir_field_selection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glsl/hir_field_selection.cpp') diff --git a/src/glsl/hir_field_selection.cpp b/src/glsl/hir_field_selection.cpp index e2efff60d3..5500e09d7e 100644 --- a/src/glsl/hir_field_selection.cpp +++ b/src/glsl/hir_field_selection.cpp @@ -33,7 +33,7 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, exec_list *instructions, struct _mesa_glsl_parse_state *state) { - void *ctx = talloc_parent(state); + void *ctx = state; ir_rvalue *result = NULL; ir_rvalue *op; -- cgit v1.2.3