Bug 83639 - [UBO] nested structures don't get appropriate padding with an instance name
Summary: [UBO] nested structures don't get appropriate padding with an instance name
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-09 02:16 UTC by Ian Romanick
Modified: 2016-02-23 08:13 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Test case (2.61 KB, text/plain)
2014-09-09 02:16 UTC, Ian Romanick
Details

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.