glsl: use explicit offset when lowering buffer access
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 8 Jan 2016 11:49:24 +0000 (22:49 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Sat, 5 Mar 2016 08:38:49 +0000 (19:38 +1100)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
src/compiler/glsl/lower_buffer_access.cpp

index 9ad811de9f1b91f32527c63d4554009cd6f06915..f85b421cf270b480960635388bbb208e8ad1e068 100644 (file)
@@ -440,6 +440,10 @@ lower_buffer_access::setup_buffer_access(void *mem_ctx,
             else
                field_align = type->std140_base_alignment(field_row_major);
 
+            if (struct_type->fields.structure[i].offset != -1) {
+               intra_struct_offset = struct_type->fields.structure[i].offset;
+            }
+
             intra_struct_offset = glsl_align(intra_struct_offset, field_align);
 
             if (strcmp(struct_type->fields.structure[i].name,