diff options
author | Eric Anholt <[email protected]> | 2012-03-29 17:02:15 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-04-19 16:33:36 -0700 |
commit | f2475ca424f7e001be50f64dafa5700f6603d684 (patch) | |
tree | 432e0d9c8da042785c8fb6de1aa70a2eeed89eae /src/glsl/ast_to_hir.cpp | |
parent | cc7e0de009a0ab528fe950b17fa465a0a97988fc (diff) |
glsl: Track in each ir_variable whether it was ever assigned.
This will be used for some compile-and-link-time error checking, where
currently we've been doing error checking only at link time.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 820c86c5e6b..80ea8bc4af6 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -672,6 +672,10 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state, void *ctx = state; bool error_emitted = (lhs->type->is_error() || rhs->type->is_error()); + ir_variable *lhs_var = lhs->variable_referenced(); + if (lhs_var) + lhs_var->assigned = true; + if (!error_emitted) { if (non_lvalue_description != NULL) { _mesa_glsl_error(&lhs_loc, state, |