summaryrefslogtreecommitdiff
path: root/ir_variable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ir_variable.cpp')
-rw-r--r--ir_variable.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/ir_variable.cpp b/ir_variable.cpp
index 76a528ca2b..12992a9b81 100644
--- a/ir_variable.cpp
+++ b/ir_variable.cpp
@@ -38,9 +38,25 @@ add_variable(const char *name, enum ir_variable_mode mode,
ir_variable *var = new ir_variable(type, name);
var->mode = mode;
- if (var->mode != ir_var_out)
+ switch (var->mode) {
+ case ir_var_in:
+ var->shader_in = true;
var->read_only = true;
-
+ break;
+ case ir_var_inout:
+ var->shader_in = true;
+ var->shader_out = true;
+ case ir_var_out:
+ var->shader_out = true;
+ break;
+ case ir_var_uniform:
+ var->shader_in = true;
+ var->read_only = true;
+ break;
+ default:
+ assert(0);
+ break;
+ }
/* Once the variable is created an initialized, add it to the symbol table
* and add the declaration to the IR stream.