Some backends require that there are no array varyings.
If there were no arrays in the input shader, the pass shouldn't have to
create new ones.
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2103
Fixes: bcd14756eec ('nir/lower_io_to_vector: add flat mode')
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
if (num_vars <= 1)
return NULL;
- return glsl_array_type(glsl_vector_type(base, 4), slots, 0);
+ if (slots == 1)
+ return glsl_vector_type(base, 4);
+ else
+ return glsl_array_type(glsl_vector_type(base, 4), slots, 0);
}
static bool
deref = nir_build_deref_array(b, deref, index);
}
+ if (!glsl_type_is_array(deref->type))
+ return deref;
+
bool vs_in = shader->info.stage == MESA_SHADER_VERTEX &&
new_var->data.mode == nir_var_shader_in;
return nir_build_deref_array(