Bug 83639

Summary: [UBO] nested structures don't get appropriate padding with an instance name
Product: Mesa Reporter: Ian Romanick <idr>
Component: glsl-compilerAssignee: Ian Romanick <idr>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Test case

Description Ian Romanick 2014-09-09 02:16:39 UTC
Created attachment 105940 [details]
Test case

For the attached shader, Mesa generates:

    (expression vec2 ubo_load (constant uint (0)) (constant uint (48)))

but the offset should be 64.

This is different from bug #83533.
Comment 1 Samuel Iglesias Gonsálvez 2015-07-27 08:23:08 UTC
When running this test against today's master (d69da58) on HSW, the offset is 64:

   (expression vec2 ubo_load (constant uint (0)) (constant uint (64))

Can you reproduce the bug?
Comment 2 Timothy Arceri 2016-02-23 08:13:37 UTC
Fixed by:

commit	8e01c66da6c780601f941aa5b9939962c219fdbd

glsl: Make sure fields after small structs have correct padding

Previously the linker would correctly calculate the layout, but the
lower_ubo_reference pass would not apply correct alignment to fields
following small (less than 16-byte) nested structures.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83533
Cc: mesa-stable@lists.freedesktop.org

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.