Optimize more front-end VertexArray binding.
Improves perf slightly (1-2%) in the Vulkan VBO state change test.
Bug: angleproject:3014
Change-Id: Ia8082b5b3f5e847a6b2775e896893fa8d38c1afd
Reviewed-on: https://chromium-review.googlesource.com/c/1393904
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp
index 3938ba6..1bda45c 100644
--- a/src/libANGLE/Program.cpp
+++ b/src/libANGLE/Program.cpp
@@ -3097,8 +3097,10 @@
// gl_VertexID and gl_InstanceID are active attributes but don't have a bound attribute.
if (!attribute.isBuiltIn())
{
- mState.mAttributesTypeMask.setIndex(VariableComponentType(attribute.type),
- location);
+ ComponentType componentType =
+ GLenumToComponentType(VariableComponentType(attribute.type));
+
+ SetComponentTypeMask(componentType, location, &mState.mAttributesTypeMask);
mState.mAttributesMask.set(location);
}
}
@@ -3648,7 +3650,9 @@
ASSERT(location < mState.mActiveOutputVariables.size());
mState.mActiveOutputVariables.set(location);
mState.mOutputVariableTypes[location] = VariableComponentType(outputVariable.type);
- mState.mDrawBufferTypeMask.setIndex(mState.mOutputVariableTypes[location], location);
+ ComponentType componentType =
+ GLenumToComponentType(mState.mOutputVariableTypes[location]);
+ SetComponentTypeMask(componentType, location, &mState.mDrawBufferTypeMask);
}
}