The CHROMIUM_bind_uniform_location spec previously had some
conflicting information on when uniform location aliasing was
allowed. Now the section on uniform location aliasing makes it clear
that aliasing locations of two statically used uniforms is an error.
This guarantees compatibility between different compiler versions that
may treat a different subset of uniforms as active, depending on
optimizations. It follows the spirit of GLSL ES 3.00.6 spec section
12.46, that has similar rules for attributes.
The implementation is fixed to correctly follow the spec. When
flattening uniforms, static use is tracked separately from activeness.
BUG=angleproject:2262
TEST=angle_end2end_tests
Change-Id: I570fd384064aec66ef0380a53fa01ac5e43eec5a
Reviewed-on: https://chromium-review.googlesource.com/978144
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
This is a complete implementation of the uniform location layout
qualifier. Uniform location set in the shader is plumbed to shader
linking, which does several link-time checks for conflicts and
recursively applies the location to struct members.
Validate that location is consistent as specified in the table in
section 9.2.1 of the ESSL 3.10.4 spec. The location set in the shader
overrides the one set via the CHROMIUM_bind_uniform_location API.
Location conflicts must be checked even if the uniforms are not
statically used. Because of this unused uniforms are now recorded
during uniform linking. After linking checks are done, unused uniforms
are pruned from the program state.
Location is validated against the maximum number of uniform locations
at compile time as specified in section 4.4.3 of the ESSL 3.10.4 spec.
All dEQP uniform location tests don't yet pass due to unrelated bugs.
BUG=angleproject:1442
TEST=angle_end2end_tests, dEQP-GLES31.functional.uniform_location.*
Change-Id: I1f968e971f521fbc804b01e1a7c2b4d14f24d20f
Reviewed-on: https://chromium-review.googlesource.com/447942
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>