[Mesa-dev] [PATCH 6/7] glsl: use explicit offset when lowering buffer access

Timothy Arceri timothy.arceri at collabora.com
Sun Jan 10 19:13:11 PST 2016


---
 src/glsl/lower_buffer_access.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/glsl/lower_buffer_access.cpp b/src/glsl/lower_buffer_access.cpp
index f8c8d14..ef1b1c5 100644
--- a/src/glsl/lower_buffer_access.cpp
+++ b/src/glsl/lower_buffer_access.cpp
@@ -439,6 +439,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.4.3



More information about the mesa-dev mailing list