From 802262c0afe1a45abc4920b61641c774a8f9792a Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 8 Jan 2016 22:49:24 +1100 Subject: [PATCH] glsl: use explicit offset when lowering buffer access Reviewed-by: Edward O'Callaghan --- src/compiler/glsl/lower_buffer_access.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/glsl/lower_buffer_access.cpp b/src/compiler/glsl/lower_buffer_access.cpp index 9ad811de9f1..f85b421cf27 100644 --- a/src/compiler/glsl/lower_buffer_access.cpp +++ b/src/compiler/glsl/lower_buffer_access.cpp @@ -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, -- 2.30.2