summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-06-18 18:57:31 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-06-18 19:02:45 -0700
commitc96822cf311d764a3cf6a2c62145851e8326c896 (patch)
tree026667d067861fa6b8626fe7968050cecbacf4c9
parent93dad36844a7e967aa9a9ec62587bac65b9eb5b4 (diff)
Ensure that shader_in and shader_out are correctly set in declarations
-rw-r--r--ast_to_hir.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/ast_to_hir.cpp b/ast_to_hir.cpp
index 3414da00eb..dbc3666069 100644
--- a/ast_to_hir.cpp
+++ b/ast_to_hir.cpp
@@ -1471,11 +1471,27 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
if (qual->uniform)
var->shader_in = true;
- if (qual->varying) {
- if (qual->in)
+
+ /* Any 'in' or 'inout' variables at global scope must be marked as being
+ * shader inputs. Likewise, any 'out' or 'inout' variables at global scope
+ * must be marked as being shader outputs.
+ */
+ if (state->current_function == NULL) {
+ switch (var->mode) {
+ case ir_var_in:
+ case ir_var_uniform:
+ var->shader_in = true;
+ break;
+ case ir_var_out:
+ var->shader_out = true;
+ break;
+ case ir_var_inout:
var->shader_in = true;
- if (qual->out)
var->shader_out = true;
+ break;
+ default:
+ break;
+ }
}
if (qual->flat)