summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/lower_buffer_access.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/compiler/glsl/lower_buffer_access.cpp b/src/compiler/glsl/lower_buffer_access.cpp
index db6e8e367b7..ff6f9c1fcfe 100644
--- a/src/compiler/glsl/lower_buffer_access.cpp
+++ b/src/compiler/glsl/lower_buffer_access.cpp
@@ -73,16 +73,22 @@ lower_buffer_access::emit_access(void *mem_ctx,
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;
}