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'.
diff --git a/src/glsl/ir_variable.cpp b/src/glsl/ir_variable.cpp
index 4593c18..700c5de 100644
--- a/src/glsl/ir_variable.cpp
+++ b/src/glsl/ir_variable.cpp
@@ -39,9 +39,8 @@
const glsl_type *type, exec_list *instructions,
glsl_symbol_table *symtab)
{
- ir_variable *var = new(symtab) ir_variable(type, name);
+ ir_variable *var = new(symtab) ir_variable(type, name, mode);
- var->mode = mode;
switch (var->mode) {
case ir_var_auto:
var->read_only = true;