summaryrefslogtreecommitdiff
path: root/src/glsl/glsl_types.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-07-19 17:12:42 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-07-20 17:48:24 -0700
commit7e2aa91507a5883e33473e0a94215ee3985baad1 (patch)
tree0e88667d83141c9359eb00b50d6945b4e18c8e72 /src/glsl/glsl_types.cpp
parent1124e5a3cbba839ffd968742bfa3295c8de5498c (diff)
glsl2: Add and use new variable mode ir_var_temporary
This is quite a large patch because breaking it into smaller pieces would result in the tree being intermitently broken. The big changes are: * Add the ir_var_temporary variable mode * Change the ir_variable constructor to take the mode as a parameter and correctly specify the mode for all ir_varables. * Change the linker to not cross validate ir_var_temporary variables. * Change the linker to pull all ir_var_temporary variables from global scope into 'main'.
Diffstat (limited to 'src/glsl/glsl_types.cpp')
-rw-r--r--src/glsl/glsl_types.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 77c591ed69..5cb327c89d 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -251,10 +251,9 @@ glsl_type::generate_constructor(glsl_symbol_table *symtab) const
snprintf(param_name, 10, "p%08X", i);
ir_variable *var = (this->base_type == GLSL_TYPE_ARRAY)
- ? new(ctx) ir_variable(fields.array, param_name)
- : new(ctx) ir_variable(fields.structure[i].type, param_name);
+ ? new(ctx) ir_variable(fields.array, param_name, ir_var_in)
+ : new(ctx) ir_variable(fields.structure[i].type, param_name, ir_var_in);
- var->mode = ir_var_in;
declarations[i] = var;
sig->parameters.push_tail(var);
}
@@ -264,7 +263,7 @@ glsl_type::generate_constructor(glsl_symbol_table *symtab) const
* the same type as the constructor. After initializing __retval,
* __retval is returned.
*/
- ir_variable *retval = new(ctx) ir_variable(this, "__retval");
+ ir_variable *retval = new(ctx) ir_variable(this, "__retval", ir_var_auto);
sig->body.push_tail(retval);
for (unsigned i = 0; i < length; i++) {