+ struct etna_shader_io_file *sf = &c->variant->outfile;
+
+ if (is_fs(c)) {
+ switch (var->data.location) {
+ case FRAG_RESULT_COLOR:
+ case FRAG_RESULT_DATA0: /* DATA0 is used by gallium shaders for color */
+ c->variant->ps_color_out_reg = src.reg;
+ break;
+ case FRAG_RESULT_DEPTH:
+ c->variant->ps_depth_out_reg = src.reg;
+ break;
+ default:
+ unreachable("Unsupported fs output");
+ }
+ return;
+ }
+
+ switch (var->data.location) {
+ case VARYING_SLOT_POS:
+ c->variant->vs_pos_out_reg = src.reg;
+ break;
+ case VARYING_SLOT_PSIZ:
+ c->variant->vs_pointsize_out_reg = src.reg;
+ break;
+ default:
+ sf->reg[sf->num_reg].reg = src.reg;
+ sf->reg[sf->num_reg].slot = var->data.location;
+ sf->reg[sf->num_reg].num_components = glsl_get_components(var->type);
+ sf->num_reg++;
+ break;
+ }