Only store innermost array offset in VariableLocation
Separate entries will be generated for each innermost array of arrays
of arrays in the variable tables. Because of this VariableLocation
actually only needs to store the innermost array index.
BUG=angleproject:2125
TEST=angle_end2end_tests
Change-Id: Id1ee35b3cecfc011d96b58e43cf0b1cccbfed408
Reviewed-on: https://chromium-review.googlesource.com/741742
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/MemoryProgramCache.cpp b/src/libANGLE/MemoryProgramCache.cpp
index 1c0a453..9add9f5 100644
--- a/src/libANGLE/MemoryProgramCache.cpp
+++ b/src/libANGLE/MemoryProgramCache.cpp
@@ -238,9 +238,8 @@
uniformIndexIndex++)
{
VariableLocation variable;
- stream.readIntVector<unsigned int>(&variable.arrayIndices);
+ stream.readInt(&variable.arrayIndex);
stream.readInt(&variable.index);
- stream.readInt(&variable.flattenedArrayOffset);
stream.readBool(&variable.ignored);
state->mUniformLocations.push_back(variable);
@@ -320,9 +319,8 @@
for (unsigned int outputIndex = 0; outputIndex < outputVarCount; ++outputIndex)
{
VariableLocation locationData;
- stream.readIntVector<unsigned int>(&locationData.arrayIndices);
+ stream.readInt(&locationData.arrayIndex);
stream.readInt(&locationData.index);
- stream.readInt(&locationData.flattenedArrayOffset);
stream.readBool(&locationData.ignored);
state->mOutputLocations.push_back(locationData);
}
@@ -429,9 +427,8 @@
stream.writeInt(state.getUniformLocations().size());
for (const auto &variable : state.getUniformLocations())
{
- stream.writeIntVector(variable.arrayIndices);
+ stream.writeInt(variable.arrayIndex);
stream.writeIntOrNegOne(variable.index);
- stream.writeInt(variable.flattenedArrayOffset);
stream.writeInt(variable.ignored);
}
@@ -483,9 +480,8 @@
stream.writeInt(state.getOutputLocations().size());
for (const auto &outputVar : state.getOutputLocations())
{
- stream.writeIntVector(outputVar.arrayIndices);
+ stream.writeInt(outputVar.arrayIndex);
stream.writeIntOrNegOne(outputVar.index);
- stream.writeInt(outputVar.flattenedArrayOffset);
stream.writeInt(outputVar.ignored);
}