summaryrefslogtreecommitdiff
path: root/src/glsl/ast_function.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-06-25 13:14:37 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-06-30 13:52:24 -0700
commit953ff1283d3d52e6a6b4850c2b0b574111625010 (patch)
treececa1c6c108067efcc948822b94b4f78c45d7afa /src/glsl/ast_function.cpp
parent116f1d4f95d8eb0a82b272016590549632c865b3 (diff)
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.
Diffstat (limited to 'src/glsl/ast_function.cpp')
-rw-r--r--src/glsl/ast_function.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index f3074a362d..b681115387 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -59,7 +59,7 @@ process_call(exec_list *instructions, ir_function *f,
YYLTYPE *loc, exec_list *actual_parameters,
struct _mesa_glsl_parse_state *state)
{
- void *ctx = talloc_parent(state);
+ void *ctx = state;
const ir_function_signature *sig =
f->matching_signature(actual_parameters);
@@ -119,7 +119,7 @@ match_function_by_name(exec_list *instructions, const char *name,
YYLTYPE *loc, exec_list *actual_parameters,
struct _mesa_glsl_parse_state *state)
{
- void *ctx = talloc_parent(state);
+ void *ctx = state;
ir_function *f = state->symbols->get_function(name);
if (f == NULL) {
@@ -244,7 +244,7 @@ process_array_constructor(exec_list *instructions,
YYLTYPE *loc, exec_list *parameters,
struct _mesa_glsl_parse_state *state)
{
- void *ctx = talloc_parent(state);
+ void *ctx = state;
/* Array constructors come in two forms: sized and unsized. Sized array
* constructors look like 'vec4[2](a, b)', where 'a' and 'b' are vec4
* variables. In this case the number of parameters must exactly match the
@@ -318,7 +318,7 @@ constant_record_constructor(const glsl_type *constructor_type,
YYLTYPE *loc, exec_list *parameters,
struct _mesa_glsl_parse_state *state)
{
- void *ctx = talloc_parent(state);
+ void *ctx = state;
bool all_parameters_are_constant = true;
exec_node *node = parameters->head;
@@ -862,7 +862,7 @@ ir_rvalue *
ast_function_expression::hir(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
- void *ctx = talloc_parent(state);
+ void *ctx = state;
/* There are three sorts of function calls.
*
* 1. contstructors - The first subexpression is an ast_type_specifier.