glsl: Make is_fixed_function_array actually check for varyings.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 7 Jan 2017 20:55:17 +0000 (12:55 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 7 Jan 2017 21:05:37 +0000 (13:05 -0800)
We can't check VARYING_SLOT_* locations until we've determined that
the variable is actually a varying.

Fixes assert failures in drivers which actually use this path,
such as radeonsi and i915.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99314
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/ir_set_program_inouts.cpp

index 376d9c693fac9279b33ffbb62928e84530a12dc8..354b533bdcd1b127278c7980e5fd2a5300a6b564 100644 (file)
@@ -337,6 +337,10 @@ is_multiple_vertices(gl_shader_stage stage, ir_variable *var)
 static bool
 is_fixed_function_array(ir_variable *var)
 {
+   if (var->data.mode != ir_var_shader_in &&
+       var->data.mode != ir_var_shader_out)
+      return false;
+
    switch (var->data.location) {
    case VARYING_SLOT_TESS_LEVEL_OUTER:
    case VARYING_SLOT_TESS_LEVEL_INNER: