virtual void nir_emit_jump(nir_jump_instr *instr);
virtual void nir_emit_texture(nir_tex_instr *instr);
+ src_reg *nir_inputs;
+
protected:
void emit_vertex();
void lower_attributes_to_hw_regs(const int *attribute_map,
void
vec4_visitor::nir_setup_inputs(nir_shader *shader)
{
- /* @TODO: Not yet implemented */
+ nir_inputs = ralloc_array(mem_ctx, src_reg, shader->num_inputs);
+
+ foreach_list_typed(nir_variable, var, node, &shader->inputs) {
+ int offset = var->data.driver_location;
+ unsigned size = type_size(var->type);
+ for (unsigned i = 0; i < size; i++) {
+ src_reg src = src_reg(ATTR, var->data.location + i, var->type);
+ nir_inputs[offset + i] = src;
+ }
+ }
}
void