Add support for arrays of arrays to VariableLocation
Array indices are sorted so that the outermost index is in the back.
This is because we want to be consistent with future arrays of arrays
parsing code. In parsing we'll have a utility function to make a
TType object into an array, and there it's most natural to push the
new outermost sizes to the back of the vector.
Further patches will still be needed to parse arrays of arrays and
add support to arrays of arrays into the API.
BUG=angleproject:2125
TEST=angle_unittests, angle_end2end_tests
Change-Id: I6c88edabf68ae9dbd803ec6d20543016c408b702
Reviewed-on: https://chromium-review.googlesource.com/686414
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/libANGLE/renderer/gl/ProgramGL.cpp b/src/libANGLE/renderer/gl/ProgramGL.cpp
index 0b45f12..6f81fd0 100644
--- a/src/libANGLE/renderer/gl/ProgramGL.cpp
+++ b/src/libANGLE/renderer/gl/ProgramGL.cpp
@@ -659,14 +659,18 @@
continue;
}
- // From the spec:
+ // From the GLES 3.0.5 spec:
// "Locations for sequential array indices are not required to be sequential."
const gl::LinkedUniform &uniform = uniforms[entry.index];
std::stringstream fullNameStr;
fullNameStr << uniform.mappedName;
if (uniform.isArray())
{
- fullNameStr << "[" << entry.element << "]";
+ for (auto arrayElementIndexIt = entry.arrayIndices.rbegin();
+ arrayElementIndexIt != entry.arrayIndices.rend(); ++arrayElementIndexIt)
+ {
+ fullNameStr << "[" << (*arrayElementIndexIt) << "]";
+ }
}
const std::string &fullName = fullNameStr.str();