Bug 83533 - [UBO] nested structures don't get appropriate padding
Summary: [UBO] nested structures don't get appropriate padding
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
Depends on:
Reported: 2014-09-05 15:26 UTC by Ian Romanick
Modified: 2014-12-17 19:22 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Test case (1.08 KB, text/plain)
2014-09-05 15:26 UTC, Ian Romanick

Description Ian Romanick 2014-09-05 15:26:27 UTC
Created attachment 105808 [details]
Test case

Looking at the IR dump, the compiler frontend generates

  (expression bvec2 ubo_load (constant uint (0)) (constant uint (8)))

to load s2.bv.x.  However, the GL API (correctly) believes that s2.bv is at offset 16.  Deleting any field from S1 or S2 (or putting the contents of S2 directly in the UBO) masks the problem.  It seems that some part of the compiler stack is not putting padding after s1 to align bv to a vec4 boundary.
Comment 1 Ian Romanick 2014-12-17 19:22:08 UTC
This test passes on master and 10.4.  It was fixed with all the UBO work I did earlier in the year, but I forgot to close the bug.

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.