glsl: Disable structure splitting for shader ins/outs.
authorPaul Berry <stereotype441@gmail.com>
Fri, 11 Jan 2013 21:34:40 +0000 (13:34 -0800)
committerPaul Berry <stereotype441@gmail.com>
Fri, 25 Jan 2013 00:30:37 +0000 (16:30 -0800)
Previously, it didn't matter whether structure splitting tried to
split shader ins/outs, because structs were prohibited from being used
for shader ins/outs.  However, GLSL 3.00 ES supports varying structs.
In order for varying structs to work, we need to make sure that
structure splitting doesn't get applied to them, because if it does,
then the linker won't be able to match up varyings properly.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/opt_structure_splitting.cpp

index 9b3f048e4dd3fdaf195a944e8a06175e1b7666a5..806c079e585da3c36c691c97a3e4ca544dd81e15 100644 (file)
@@ -104,7 +104,8 @@ ir_structure_reference_visitor::get_variable_entry(ir_variable *var)
 {
    assert(var);
 
-   if (!var->type->is_record() || var->mode == ir_var_uniform)
+   if (!var->type->is_record() || var->mode == ir_var_uniform
+       || var->mode == ir_var_shader_in || var->mode == ir_var_shader_out)
       return NULL;
 
    foreach_iter(exec_list_iterator, iter, this->variable_list) {