Remove the pack/unpack languages and bring grammar up from 1.1 to 4.2 and fix the affected 1.1 productions and semantics to still work correctly for 1.1 shaders.

For 4.2, largely, it is only the grammar that is working.  Productions and semantics are mostly missing.  Lexical analysis is mostly done, but not in the preprocessor, which still can't handle uint and double literals.

The grammar and token names are reorganized to match the specification, to allow easier comparison between the specification and the working grammar.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@19946 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2012-12-12 21:23:55 +00:00
parent 200b2734d7
commit e320a1854b
13 changed files with 3254 additions and 2402 deletions

View file

@ -118,6 +118,8 @@ enum TOperator {
EOpVectorSwizzle,
EOpMethod,
//
// Built-in functions potentially mapped to operators
//
@ -168,17 +170,7 @@ enum TOperator {
EOpAny,
EOpAll,
EOpItof, // pack/unpack only
EOpFtoi, // pack/unpack only
EOpSkipPixels, // pack/unpack only
EOpReadInput, // unpack only
EOpWritePixel, // unpack only
EOpBitmapLsb, // unpack only
EOpBitmapMsb, // unpack only
EOpWriteOutput, // pack only
EOpReadPixel, // pack only
//
// Branch
//
@ -242,6 +234,7 @@ class TIntermBinary;
class TIntermConstantUnion;
class TIntermSelection;
class TIntermTyped;
class TIntermMethod;
class TIntermSymbol;
class TInfoSink;
@ -261,6 +254,7 @@ public:
virtual TIntermAggregate* getAsAggregate() { return 0; }
virtual TIntermBinary* getAsBinaryNode() { return 0; }
virtual TIntermSelection* getAsSelectionNode() { return 0; }
virtual TIntermMethod* getAsMethodNode() { return 0; }
virtual TIntermSymbol* getAsSymbolNode() { return 0; }
virtual ~TIntermNode() { }
protected:
@ -342,6 +336,23 @@ protected:
TIntermTyped* expression; // non-zero except for "return exp;" statements
};
//
// Represent method names before seeing their calling signature
// or resolving them to operations. Just an expression as the base object
// and a textural name.
//
class TIntermMethod : public TIntermTyped {
public:
TIntermMethod(TIntermTyped* o, const TType& t, const TString& m) : TIntermTyped(t), object(o), method(m) { }
virtual TIntermMethod* getAsMethodNode() { return this; }
virtual const TString& getMethodName() const { return method; }
virtual TIntermTyped* getObject() const { return object; }
virtual void traverse(TIntermTraverser*);
protected:
TIntermTyped* object;
TString method;
};
//
// Nodes that correspond to symbols or constants in the source code.
//