"must be a multiple of the base "
"alignment of %s", field_type->name);
}
+ fields[i].offset = qual_offset;
next_offset = glsl_align(qual_offset + size, align);
} else {
_mesa_glsl_error(&loc, state, "offset can only be used "
}
}
} else {
+ fields[i].offset = -1;
if (align != 0 && size != 0)
next_offset = glsl_align(next_offset + size, align);
}
} else {
fields[i].location =
earlier_per_vertex->fields.structure[j].location;
+ fields[i].offset =
+ earlier_per_vertex->fields.structure[j].offset;
fields[i].interpolation =
earlier_per_vertex->fields.structure[j].interpolation;
fields[i].centroid =
this->fields[this->num_fields].name = name;
this->fields[this->num_fields].matrix_layout = GLSL_MATRIX_LAYOUT_INHERITED;
this->fields[this->num_fields].location = slot;
+ this->fields[this->num_fields].offset = -1;
this->fields[this->num_fields].interpolation = INTERP_QUALIFIER_NONE;
this->fields[this->num_fields].centroid = 0;
this->fields[this->num_fields].sample = 0;
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].offset = fields[i].offset;
this->fields.structure[i].interpolation = fields[i].interpolation;
this->fields.structure[i].centroid = fields[i].centroid;
this->fields.structure[i].sample = fields[i].sample;
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].offset = fields[i].offset;
this->fields.structure[i].interpolation = fields[i].interpolation;
this->fields.structure[i].centroid = fields[i].centroid;
this->fields.structure[i].sample = fields[i].sample;
if (this->fields.structure[i].location
!= b->fields.structure[i].location)
return false;
+ if (this->fields.structure[i].offset
+ != b->fields.structure[i].offset)
+ return false;
if (this->fields.structure[i].interpolation
!= b->fields.structure[i].interpolation)
return false;
*/
int location;
+ /**
+ * For interface blocks, members may have an explicit byte offset
+ * specified; -1 otherwise.
+ *
+ * Ignored for structs.
+ */
+ int offset;
+
/**
* For interface blocks, the interpolation mode (as in
* ir_variable::interpolation). 0 otherwise.