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/RewriteTexelFetchOffset.cpp b/src/compiler/translator/RewriteTexelFetchOffset.cpp
index bf89dda..487c909 100644
--- a/src/compiler/translator/RewriteTexelFetchOffset.cpp
+++ b/src/compiler/translator/RewriteTexelFetchOffset.cpp
@@ -75,7 +75,7 @@
return true;
}
- if (node->getName().compare(0, 16, "texelFetchOffset") != 0)
+ if (node->getFunctionSymbolInfo()->getName().compare(0, 16, "texelFetchOffset") != 0)
{
return true;
}
@@ -85,11 +85,12 @@
ASSERT(sequence->size() == 4u);
// Decide if there is a 2DArray sampler.
- bool is2DArray = node->getName().find("s2a1") != TString::npos;
+ bool is2DArray = node->getFunctionSymbolInfo()->getName().find("s2a1") != TString::npos;
// Create new argument list from node->getName().
// e.g. Get "(is2a1;vi3;i1;" from "texelFetchOffset(is2a1;vi3;i1;vi2;"
- TString newArgs = node->getName().substr(16, node->getName().length() - 20);
+ TString newArgs = node->getFunctionSymbolInfo()->getName().substr(
+ 16, node->getFunctionSymbolInfo()->getName().length() - 20);
TString newName = "texelFetch" + newArgs;
TSymbol *texelFetchSymbol = symbolTable->findBuiltIn(newName, shaderVersion);
ASSERT(texelFetchSymbol);
@@ -98,8 +99,8 @@
// Create new node that represents the call of function texelFetch.
// Its argument list will be: texelFetch(sampler, Position+offset, lod).
TIntermAggregate *texelFetchNode = new TIntermAggregate(EOpFunctionCall);
- texelFetchNode->setName(newName);
- texelFetchNode->setFunctionId(uniqueId);
+ texelFetchNode->getFunctionSymbolInfo()->setName(newName);
+ texelFetchNode->getFunctionSymbolInfo()->setId(uniqueId);
texelFetchNode->setType(node->getType());
texelFetchNode->setLine(node->getLine());