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.
This commit is contained in:

committed by
Ian Romanick

parent
116f1d4f95
commit
953ff1283d
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user