Separate function info from TIntermAggregate
This change will make it easier to split types of TIntermAggregate
nodes representing functions and function calls into different node
classes.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I730aa7858fe31fda86218fc685980c6ad486f5e0
Reviewed-on: https://chromium-review.googlesource.com/394706
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/IntermNode.cpp b/src/compiler/translator/IntermNode.cpp
index 4f09fac..c4430b8 100644
--- a/src/compiler/translator/IntermNode.cpp
+++ b/src/compiler/translator/IntermNode.cpp
@@ -305,7 +305,7 @@
}
// ESSL 3.0 spec section 8: textureSize always gets highp precision.
// All other functions that take a sampler are assumed to be texture functions.
- if (mName.getString().find("textureSize") == 0)
+ if (mFunctionInfo.getName().find("textureSize") == 0)
mType.setPrecision(EbpHigh);
else
mType.setPrecision(precision);
@@ -455,13 +455,18 @@
mUnionArrayPointer = node.mUnionArrayPointer;
}
+void TFunctionSymbolInfo::setFromFunction(const TFunction &function)
+{
+ setName(function.getMangledName());
+ setId(function.getUniqueId());
+}
+
TIntermAggregate::TIntermAggregate(const TIntermAggregate &node)
: TIntermOperator(node),
- mName(node.mName),
mUserDefined(node.mUserDefined),
- mFunctionId(node.mFunctionId),
mUseEmulatedFunction(node.mUseEmulatedFunction),
- mGotPrecisionFromChildren(node.mGotPrecisionFromChildren)
+ mGotPrecisionFromChildren(node.mGotPrecisionFromChildren),
+ mFunctionInfo(node.mFunctionInfo)
{
for (TIntermNode *child : node.mSequence)
{