diff options
author | Eric Anholt <[email protected]> | 2010-04-19 11:10:37 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-04-19 11:13:20 -0700 |
commit | 71df19f5ef6e78beb5160801f81468184b75447e (patch) | |
tree | 3b481c4db98510f0fa0c0b0c8d307621b09fc609 /ast_to_hir.cpp | |
parent | 484606610e36ec7598f7733e9787d888b6a63d64 (diff) |
Mark some variables as having usage beyond the shader's scope.
This will be important to optimization passes. We don't want to
dead-code eliminate writes to out varyings, or propagate uninitialized
values of uniforms.
Diffstat (limited to 'ast_to_hir.cpp')
-rw-r--r-- | ast_to_hir.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp index 83dac584b2b..316bcf7d71c 100644 --- a/ast_to_hir.cpp +++ b/ast_to_hir.cpp @@ -1446,6 +1446,15 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, else var->mode = ir_var_auto; + if (qual->uniform) + var->shader_in = true; + if (qual->varying) { + if (qual->in) + var->shader_in = true; + if (qual->out) + var->shader_out = true; + } + if (qual->flat) var->interpolation = ir_var_flat; else if (qual->noperspective) |