diff options
| author | Eric Anholt <eric@anholt.net> | 2010-08-23 11:29:25 -0700 | 
|---|---|---|
| committer | Eric Anholt <eric@anholt.net> | 2010-08-23 12:57:59 -0700 | 
| commit | 18a60239001c27ff98739865d5fc70fd3d011b2e (patch) | |
| tree | ca4f731c808ff7900dd3a31b20bfb375f670b4a7 /src | |
| parent | 6dad5a4e8d5c4ea90bb9342e329defb9c8eb2092 (diff) | |
glsl: Count function call outvals as writing to variables for linker checks.
Fixes: glsl-vs-position-outval.  Bug #28138 (regnum online)
Diffstat (limited to 'src')
| -rw-r--r-- | src/glsl/linker.cpp | 21 | 
1 files changed, 21 insertions, 0 deletions
| diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index deb30d7fec..38d19c4c71 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -106,6 +106,27 @@ public:        return visit_continue_with_parent;     } +   virtual ir_visitor_status visit_enter(ir_call *ir) +   { +      exec_list_iterator sig_iter = ir->get_callee()->parameters.iterator(); +      foreach_iter(exec_list_iterator, iter, *ir) { +	 ir_rvalue *param_rval = (ir_rvalue *)iter.get(); +	 ir_variable *sig_param = (ir_variable *)sig_iter.get(); + +	 if (sig_param->mode == ir_var_out || +	     sig_param->mode == ir_var_inout) { +	    ir_variable *var = param_rval->variable_referenced(); +	    if (var && strcmp(name, var->name) == 0) { +	       found = true; +	       return visit_stop; +	    } +	 } +	 sig_iter.next(); +      } + +      return visit_continue_with_parent; +   } +     bool variable_found()     {        return found; | 
