Redesign HLSL scoped structures to a unique ID.
A unique ID gives a more flexible renaming scheme than our
current method of using nested scope identifiers. The reduced
complexity allows for fewer points of breakage and fixes an
outstanding bug with scoped structures (with added test).
BUG=angle:618
Change-Id: I6551248bb9fa2d185ab67248721f898dd50151f0
Reviewed-on: https://chromium-review.googlesource.com/202183
Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index 8ff9d30..eac8f2c 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -2567,6 +2567,8 @@
TStructure* structure = new TStructure(structName, fieldList);
TType* structureType = new TType(structure);
+ structure->setUniqueId(TSymbolTable::nextUniqueId());
+
if (!structName->empty())
{
if (reservedErrorCheck(nameLine, *structName))