It basically allocates registers local to a function in a nir_locals map,
then emits all its control-flow blocks.
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
virtual dst_reg *make_reg_for_system_value(int location,
const glsl_type *type) = 0;
+ dst_reg *nir_locals;
src_reg *nir_inputs;
unsigned *nir_uniform_driver_location;
dst_reg *nir_system_values;
void
vec4_visitor::nir_emit_impl(nir_function_impl *impl)
{
- /* @TODO: Not yet implemented */
+ nir_locals = ralloc_array(mem_ctx, dst_reg, impl->reg_alloc);
+
+ foreach_list_typed(nir_register, reg, node, &impl->registers) {
+ unsigned array_elems =
+ reg->num_array_elems == 0 ? 1 : reg->num_array_elems;
+
+ nir_locals[reg->index] = dst_reg(GRF, alloc.allocate(array_elems));
+ }
+
+ nir_emit_cf_list(&impl->body);
}
void