void nir_lower_locals_to_regs(nir_shader *shader);
+void nir_assign_var_locations_scalar(struct exec_list *var_list,
+ unsigned *size);
+
void nir_lower_io(nir_shader *shader);
void nir_lower_vars_to_ssa(nir_shader *shader);
return 0;
}
-static void
-assign_var_locations(struct exec_list *var_list, unsigned *size)
+void
+nir_assign_var_locations_scalar(struct exec_list *var_list, unsigned *size)
{
unsigned location = 0;
*size = location;
}
-static void
-assign_var_locations_shader(nir_shader *shader)
-{
- assign_var_locations(&shader->inputs, &shader->num_inputs);
- assign_var_locations(&shader->outputs, &shader->num_outputs);
- assign_var_locations(&shader->uniforms, &shader->num_uniforms);
-}
-
static bool
deref_has_indirect(nir_deref_var *deref)
{
void
nir_lower_io(nir_shader *shader)
{
- assign_var_locations_shader(shader);
-
nir_foreach_overload(shader, overload) {
if (overload->impl)
nir_lower_io_impl(overload->impl);
/* Get rid of split copies */
nir_optimize(nir);
+ nir_assign_var_locations_scalar(&nir->uniforms, &nir->num_uniforms);
+ nir_assign_var_locations_scalar(&nir->inputs, &nir->num_inputs);
+ nir_assign_var_locations_scalar(&nir->outputs, &nir->num_outputs);
+
nir_lower_io(nir);
nir_validate_shader(nir);