diff options
author | Iago Toral Quiroga <[email protected]> | 2014-05-09 08:50:03 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2014-05-13 10:01:02 +0200 |
commit | a143fbb3220e4c40cd2c75eca6f3e94fba0fe324 (patch) | |
tree | 342bc09104d91a18af3c545971b2017ea73dac27 /src/glsl/ast_to_hir.cpp | |
parent | 2a549c43a8c585b312fda920fcd7048e52fdcb05 (diff) |
glsl: Do not call lhs->variable_referenced() multiple times
Instead take the result from the first call and use it where needed.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 7516c33e1df..0128b3f4e82 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -799,11 +799,10 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, "assignment to %s", non_lvalue_description); error_emitted = true; - } else if (lhs->variable_referenced() != NULL - && lhs->variable_referenced()->data.read_only) { + } else if (lhs_var != NULL && lhs_var->data.read_only) { _mesa_glsl_error(&lhs_loc, state, "assignment to read-only variable '%s'", - lhs->variable_referenced()->name); + lhs_var->name); error_emitted = true; } else if (lhs->type->is_array() && !state->check_version(120, 300, &lhs_loc, |