Track whether a name is internal to ANGLE in a separate class
The AST contains identifiers in a few different places: besides symbols,
there are also function names, which show up in function signatures
and function calls. Any of these can be coming either from the original
shader or from inside ANGLE. A class that encapsulates a string and its
internalness will be useful for implementing a unified way of handling
all names in shader translation. Start implementing this by splitting
the functionality out of TSymbol.
TEST=angle_unittests
BUG=angleproject:1116
Change-Id: I0a1b5936dcccd0d5fc1c0c13c712102fbfff2a79
Reviewed-on: https://chromium-review.googlesource.com/291280
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
diff --git a/src/compiler/translator/UtilsHLSL.h b/src/compiler/translator/UtilsHLSL.h
index 9800a3b..e6a4664 100644
--- a/src/compiler/translator/UtilsHLSL.h
+++ b/src/compiler/translator/UtilsHLSL.h
@@ -15,6 +15,8 @@
#include "angle_gl.h"
+class TName;
+
namespace sh
{
@@ -22,6 +24,7 @@
TString SamplerString(const TType &type);
// Prepends an underscore to avoid naming clashes
TString Decorate(const TString &string);
+TString DecorateIfNeeded(const TName &name);
TString DecorateUniform(const TString &string, const TType &type);
TString DecorateField(const TString &string, const TStructure &structure);
TString DecoratePrivate(const TString &privateText);