Micro-optimizations to draw call entry point.
Thanks to Markus from NVIDIA. This inlines some methods and optimizes
the check if a uniform is a bool type.
BUG=angleproject:2119
Change-Id: I6f2c2d22c577458b39de600d3c56ec8e1a456a7a
Reviewed-on: https://chromium-review.googlesource.com/591699
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp
index 603e795..5818036 100644
--- a/src/libANGLE/Program.cpp
+++ b/src/libANGLE/Program.cpp
@@ -2901,7 +2901,9 @@
count = maxElementCount / vectorSize;
}
- if (VariableComponentType(linkedUniform->type) == GL_BOOL)
+ // VariableComponentType(linkedUniform->type) has a dozens of compares and thus is evil for
+ // inlining with regards to code size. This version is one subtract and one compare only.
+ if (IsVariableComponentTypeBool(linkedUniform->type))
{
// Do a cast conversion for boolean types. From the spec:
// "The uniform is set to FALSE if the input value is 0 or 0.0f, and set to TRUE otherwise."