From: Timothy Arceri Date: Fri, 8 Jan 2016 11:49:24 +0000 (+1100) Subject: glsl: use explicit offset when lowering buffer access X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=802262c0afe1a45abc4920b61641c774a8f9792a;p=mesa.git glsl: use explicit offset when lowering buffer access Reviewed-by: Edward O'Callaghan --- 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,