fields[i].type = field_type;
fields[i].name = decl->identifier;
fields[i].location = -1;
+ fields[i].interpolation =
+ interpret_interpolation_qualifier(qual, var_mode, state, &loc);
+ fields[i].centroid = qual->flags.q.centroid ? 1 : 0;
if (qual->flags.q.row_major || qual->flags.q.column_major) {
if (!qual->flags.q.uniform) {
} else {
fields[i].location =
earlier_per_vertex->fields.structure[j].location;
+ fields[i].interpolation =
+ earlier_per_vertex->fields.structure[j].interpolation;
+ fields[i].centroid =
+ earlier_per_vertex->fields.structure[j].centroid;
}
}
new(state) ir_variable(fields[i].type,
ralloc_strdup(state, fields[i].name),
var_mode);
+ var->interpolation = fields[i].interpolation;
+ var->centroid = fields[i].centroid;
var->init_interface_type(block_type);
if (redeclaring_per_vertex) {
this->fields[this->num_fields].name = name;
this->fields[this->num_fields].row_major = false;
this->fields[this->num_fields].location = slot;
+ this->fields[this->num_fields].interpolation = INTERP_QUALIFIER_NONE;
+ this->fields[this->num_fields].centroid = 0;
this->num_fields++;
}
ir_variable *var =
add_variable(fields[i].name, fields[i].type, ir_var_shader_out,
fields[i].location);
+ var->interpolation = fields[i].interpolation;
+ var->centroid = fields[i].centroid;
var->init_interface_type(per_vertex_out_type);
}
}
this->fields.structure[i].name = ralloc_strdup(this->fields.structure,
fields[i].name);
this->fields.structure[i].location = fields[i].location;
+ this->fields.structure[i].interpolation = fields[i].interpolation;
+ this->fields.structure[i].centroid = fields[i].centroid;
this->fields.structure[i].row_major = fields[i].row_major;
}
}
this->fields.structure[i].name = ralloc_strdup(this->fields.structure,
fields[i].name);
this->fields.structure[i].location = fields[i].location;
+ this->fields.structure[i].interpolation = fields[i].interpolation;
+ this->fields.structure[i].centroid = fields[i].centroid;
this->fields.structure[i].row_major = fields[i].row_major;
}
}
if (key1->fields.structure[i].location
!= key2->fields.structure[i].location)
return 1;
+ if (key1->fields.structure[i].interpolation
+ != key2->fields.structure[i].interpolation)
+ return 1;
+ if (key1->fields.structure[i].centroid
+ != key2->fields.structure[i].centroid)
+ return 1;
}
return 0;
* Ignored for structs.
*/
int location;
+
+ /**
+ * For interface blocks, the interpolation mode (as in
+ * ir_variable::interpolation). 0 otherwise.
+ */
+ unsigned interpolation:2;
+
+ /**
+ * For interface blocks, 1 if this variable uses centroid interpolation (as
+ * in ir_variable::centroid). 0 otherwise.
+ */
+ unsigned centroid:1;
};
static inline unsigned int
}
new_var->location = iface_t->fields.structure[i].location;
new_var->explicit_location = (new_var->location >= 0);
+ new_var->interpolation =
+ iface_t->fields.structure[i].interpolation;
+ new_var->centroid = iface_t->fields.structure[i].centroid;
new_var->init_interface_type(iface_t);
hash_table_insert(interface_namespace, new_var,