Removed "name" and "used" from variable location.
The used flag was redundant with the index (which used MAXUINT). The
name was redundant with the stored uniform. Removing these gives a
very minor performance speed up when iterating and retrieving
uniform locations.
BUG=angleproject:1390
Change-Id: Ieeccdff7c131e1359e754e246d3648b73aad5baf
Reviewed-on: https://chromium-review.googlesource.com/659224
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/UniformLinker.cpp b/src/libANGLE/UniformLinker.cpp
index 8c3f8c9..f2df3af 100644
--- a/src/libANGLE/UniformLinker.cpp
+++ b/src/libANGLE/UniformLinker.cpp
@@ -201,8 +201,7 @@
for (unsigned int arrayIndex = 0; arrayIndex < uniform.elementCount(); arrayIndex++)
{
- VariableLocation location(uniform.name, arrayIndex,
- static_cast<unsigned int>(uniformIndex));
+ VariableLocation location(arrayIndex, static_cast<unsigned int>(uniformIndex));
if ((arrayIndex == 0 && preSetLocation != -1) || shaderLocation != -1)
{
@@ -230,14 +229,14 @@
// Assign ignored uniforms
for (const auto &ignoredLocation : ignoredLocations)
{
- mUniformLocations[ignoredLocation].ignored = true;
+ mUniformLocations[ignoredLocation].markIgnored();
}
// Automatically assign locations for the rest of the uniforms
size_t nextUniformLocation = 0;
for (const auto &unlocatedUniform : unlocatedUniforms)
{
- while (mUniformLocations[nextUniformLocation].used ||
+ while (mUniformLocations[nextUniformLocation].used() ||
mUniformLocations[nextUniformLocation].ignored)
{
nextUniformLocation++;