Implement scoped structure declarations
TRAC# 12110
Signed-off-by: Shannon Woods
Singed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@310 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/OutputHLSL.h b/src/compiler/OutputHLSL.h
index 3980b54..dc3c482 100644
--- a/src/compiler/OutputHLSL.h
+++ b/src/compiler/OutputHLSL.h
@@ -27,8 +27,8 @@
TInfoSinkBase &getBodyStream();
+ TString typeString(const TType &type);
static TString qualifierString(TQualifier qualifier);
- static TString typeString(const TType &type);
static TString arrayString(const TType &type);
static TString initializer(const TType &type);
static TString decorate(const TString &string); // Prepend an underscore to avoid naming clashes
@@ -55,6 +55,10 @@
void addConstructor(const TType &type, const TString &name, const TIntermSequence *parameters);
const ConstantUnion *writeConstantUnion(const TType &type, const ConstantUnion *constUnion);
+ TString scopeString(unsigned int depthLimit);
+ TString scopedStruct(const TString &typeName);
+ TString structLookup(const TString &typeName);
+
TParseContext &mContext;
UnfoldSelect *mUnfoldSelect;
bool mInsideFunction;
@@ -103,25 +107,18 @@
bool mUsesEqualBVec4;
bool mUsesAtan2;
- struct Constructor // Describes a constructor signature
- {
- TType type;
- TString name;
+ typedef std::set<TString> Constructors;
+ Constructors mConstructors;
- typedef std::vector<TType> ParameterArray;
- ParameterArray parameters;
- };
+ typedef std::set<TString> StructNames;
+ StructNames mStructNames;
- struct CompareConstructor
- {
- bool operator()(const Constructor &x, const Constructor &y) const;
- };
+ typedef std::list<TString> StructDeclarations;
+ StructDeclarations mStructDeclarations;
- typedef std::set<Constructor, CompareConstructor> ConstructorSet;
- ConstructorSet mConstructors;
-
- typedef std::list<TType> StructureArray;
- StructureArray mStructures;
+ typedef std::vector<int> ScopeBracket;
+ ScopeBracket mScopeBracket;
+ unsigned int mScopeDepth;
int mArgumentIndex; // For creating unique argument names
};