enum glsl_interface_packing packing,
unsigned int write_mask)
{
- if (deref->type->is_record()) {
+ if (deref->type->is_struct()) {
unsigned int field_offset = 0;
for (unsigned i = 0; i < deref->type->length; i++) {
new(mem_ctx) ir_dereference_record(deref->clone(mem_ctx, NULL),
field->name);
- field_offset =
- glsl_align(field_offset,
- field->type->std140_base_alignment(row_major));
+ unsigned field_align;
+ if (packing == GLSL_INTERFACE_PACKING_STD430)
+ field_align = field->type->std430_base_alignment(row_major);
+ else
+ field_align = field->type->std140_base_alignment(row_major);
+ field_offset = glsl_align(field_offset, field_align);
emit_access(mem_ctx, is_write, field_deref, base_offset,
deref_offset + field_offset,
row_major, NULL, packing,
writemask_for_size(field_deref->type->vector_elements));
- field_offset += field->type->std140_size(row_major);
+ if (packing == GLSL_INTERFACE_PACKING_STD430)
+ field_offset += field->type->std430_size(row_major);
+ else
+ field_offset += field->type->std140_size(row_major);
}
return;
}
case GLSL_MATRIX_LAYOUT_COLUMN_MAJOR:
return false;
case GLSL_MATRIX_LAYOUT_ROW_MAJOR:
- return matrix || deref->type->without_array()->is_record();
+ return matrix || deref->type->without_array()->is_struct();
}
break;
case GLSL_MATRIX_LAYOUT_COLUMN_MAJOR:
return false;
case GLSL_MATRIX_LAYOUT_ROW_MAJOR:
- return matrix || deref->type->without_array()->is_record();
+ return matrix || deref->type->without_array()->is_struct();
}
unreachable("invalid matrix layout");
* of the member following the sub-structure is rounded up to
* the next multiple of the base alignment of the structure."
*/
- if (type->without_array()->is_record()) {
+ if (type->without_array()->is_struct()) {
intra_struct_offset = glsl_align(intra_struct_offset,
field_align);