return c;
}
+static int
+type_size_vec4(const struct glsl_type *type)
+{
+ return glsl_count_attribute_slots(type, false);
+}
+
static void
v3d_lower_nir(struct v3d_compile *c)
{
c->vs_key = key;
+ /* Split our input vars and dead code eliminate the unused
+ * components.
+ */
+ NIR_PASS_V(c->s, nir_lower_io_to_scalar_early, nir_var_shader_in);
+ v3d_optimize_nir(c->s);
+ NIR_PASS_V(c->s, nir_remove_dead_variables, nir_var_shader_in);
+ NIR_PASS_V(c->s, nir_lower_io, nir_var_shader_in,
+ type_size_vec4,
+ (nir_lower_io_options)0);
+
v3d_lower_nir(c);
if (key->clamp_color)
so->was_tgsi = true;
}
- NIR_PASS_V(s, nir_lower_io, nir_var_all & ~nir_var_uniform,
+ nir_variable_mode lower_mode = nir_var_all & ~nir_var_uniform;
+ if (s->info.stage == MESA_SHADER_VERTEX)
+ lower_mode &= ~nir_var_shader_in;
+ NIR_PASS_V(s, nir_lower_io, lower_mode,
type_size,
(nir_lower_io_options)0);