Add basic intra-stage linking validation for matching types and qualification of uniforms/ins/outs/globals, function body duplication, and mixing ES/non-ES shaders.

Still need to handle arrays and built-in redeclarations, and many more rules, but this puts the basics in place.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23225 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-09-24 21:18:46 +00:00
parent f5ebfb5f27
commit 337dbc7d8c
37 changed files with 657 additions and 196 deletions

View file

@ -56,7 +56,7 @@ class TVariable;
//
class TIntermediate {
public:
explicit TIntermediate(int v = 0, EProfile p = ENoProfile) : treeRoot(0), profile(p), version(v), numMains(0), numErrors(0) { }
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), treeRoot(0), profile(p), version(v), numMains(0), numErrors(0) { }
void setVersion(int v) { version = v; }
int getVersion() const { return version; }
@ -95,20 +95,24 @@ public:
TIntermBranch* addBranch(TOperator, TIntermTyped*, TSourceLoc);
TIntermTyped* addSwizzle(TVectorFields&, TSourceLoc);
bool postProcess(TIntermNode*, EShLanguage);
void addSymbolLinkageNodes(TIntermNode* root, TIntermAggregate*& linkage, EShLanguage, TSymbolTable&);
void addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguage, TSymbolTable&);
void addSymbolLinkageNode(TIntermAggregate*& linkage, TSymbolTable&, const TString&);
void addSymbolLinkageNode(TIntermAggregate*& linkage, const TVariable&);
void merge(TIntermediate&);
void errorCheck(TInfoSink& infoSink);
void merge(TInfoSink&, TIntermediate&);
void errorCheck(TInfoSink&);
void outputTree(TInfoSink& infoSink);
void outputTree(TInfoSink&);
void removeTree();
protected:
void mergeBodies(TInfoSink&, TIntermSequence& globals, const TIntermSequence& unitGlobals);
void mergeLinkerObjects(TInfoSink&, TIntermSequence& linkerObjects, const TIntermSequence& unitLinkerObjects);
void error(TInfoSink& infoSink, const char*);
void linkErrorCheck(TInfoSink&, const TIntermSymbol&, const TIntermSymbol&, bool crossStage);
protected:
EShLanguage language;
TIntermNode* treeRoot;
EProfile profile;
int version;