Commit 23bdb29e by John Kessenich

Move the complex pieces of C++ code from glslang.y to ParseHelper.cpp. Updated some tests.

parent d46b31fd
...@@ -4,6 +4,46 @@ ERROR: 0:7: '' : vertex input cannot be further qualified ...@@ -4,6 +4,46 @@ ERROR: 0:7: '' : vertex input cannot be further qualified
ERROR: 0:11: '' : can only have one interpolation qualifier (flat, smooth, noperspective) ERROR: 0:11: '' : can only have one interpolation qualifier (flat, smooth, noperspective)
ERROR: 0:12: '' : can only have one auxiliary qualifier (centroid, patch, and sample) ERROR: 0:12: '' : can only have one auxiliary qualifier (centroid, patch, and sample)
ERROR: 0:13: 'uniform' : too many storage qualifiers ERROR: 0:13: 'uniform' : too many storage qualifiers
ERROR: 5 compilation errors. No code generated. ERROR: 0:21: 'j' : undeclared identifier
ERROR: 0:21: '=' : cannot convert from 'float' to 'int'
ERROR: 0:22: 'k' : undeclared identifier
ERROR: 0:22: '=' : cannot convert from 'float' to 'int'
ERROR: 0:23: 'j' : undeclared identifier
ERROR: 0:23: '=' : cannot convert from 'float' to 'int'
ERROR: 0:27: 'jj' : undeclared identifier
ERROR: 0:27: '=' : cannot convert from 'float' to 'int'
ERROR: 13 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:15 Function Definition: main( (void)
0:15 Function Parameters:
0:? Sequence
0:18 Test condition and select (void)
0:18 Condition
0:18 Compare Equal (bool)
0:18 'i' (int)
0:18 3 (const int)
0:18 true case
0:19 Sequence
0:19 move second child to first child (int)
0:19 'j' (int)
0:19 'i' (int)
0:25 Loop with condition tested first
0:25 Loop Condition
0:25 true (const bool)
0:25 No loop body
0:30 Function Definition: bar(vf4; (void)
0:30 Function Parameters:
0:30 'v' (in 4-component vector of float)
0:? Linker Objects
0:? 'v2' (smooth out 2-component vector of float)
0:? 'badorder' (in 4-component vector of float)
0:? 'badorder2' (invariant smooth out 4-component vector of float)
0:? 'badorder4' (centroid in 4-component vector of float)
0:? 'badorder3' (flat out 4-component vector of float)
0:? 'rep' (smooth flat out 4-component vector of float)
0:? 'rep2' (centroid smooth sample out 4-component vector of float)
0:? 'rep3' (in 4-component vector of float)
0:? 'gl_VertexID' (gl_VertexId int)
0:? 'gl_InstanceID' (gl_InstanceId int)
...@@ -22,7 +22,11 @@ ERROR: node is still EOpNull! ...@@ -22,7 +22,11 @@ ERROR: node is still EOpNull!
0:21 'm23' (2X3 matrix of float) 0:21 'm23' (2X3 matrix of float)
0:21 'm32' (uniform 3X2 matrix of float) 0:21 'm32' (uniform 3X2 matrix of float)
0:21 'v3' (in 3-component vector of float) 0:21 'v3' (in 3-component vector of float)
0:21 'm24' (float) 0:21 direct index (float)
0:21 direct index (4-component vector of float)
0:21 'm24' (2X4 matrix of float)
0:21 2 (const int)
0:21 4 (const int)
0:? Linker Objects 0:? Linker Objects
0:? 'v3' (in 3-component vector of float) 0:? 'v3' (in 3-component vector of float)
0:? 'm32' (uniform 3X2 matrix of float) 0:? 'm32' (uniform 3X2 matrix of float)
......
...@@ -7,16 +7,16 @@ uniform mat3x2 m32; ...@@ -7,16 +7,16 @@ uniform mat3x2 m32;
const mat2x4 m24 = mat2x4(1.0, 2.0, const mat2x4 m24 = mat2x4(1.0, 2.0,
3.0, 4.0, 3.0, 4.0,
3.0, 4.0, 3.0, 4.0,
3.0, 4.0, 5.0); 3.0, 4.0, 5.0); // ERROR, too many arguments
void main() void main()
{ {
mat2x3 m23; mat2x3 m23;
vec3 a, b; vec3 a, b;
a = v3 * m23; a = v3 * m23; // ERROR, type mismatch
b = m32 * v3; b = m32 * v3; // ERROR, type mismatch
m23.xy; m23.xy; // ERROR, can't use .
gl_Position = vec4(m23 * m32 * v3, m24[2][4]); gl_Position = vec4(m23 * m32 * v3, m24[2][4]); // ERROR, 2 and 4 are out of range
} }
...@@ -122,6 +122,12 @@ public: ...@@ -122,6 +122,12 @@ public:
bool reservedErrorCheck(TSourceLoc, const TString& identifier); bool reservedErrorCheck(TSourceLoc, const TString& identifier);
TIntermTyped* handleVariable(TSourceLoc, TSymbol* symbol, TString* string); TIntermTyped* handleVariable(TSourceLoc, TSymbol* symbol, TString* string);
TIntermTyped* handleBracketDereference(TSourceLoc, TIntermTyped* base, TIntermTyped* index);
TIntermTyped* handleDotDereference(TSourceLoc, TIntermTyped* base, TString& field);
TIntermAggregate* handleFunctionPrototype(TSourceLoc, TFunction&);
TIntermTyped* handleFunctionCall(TSourceLoc, TFunction*, TIntermNode*, TIntermAggregate*);
TFunction* handleConstructorCall(TSourceLoc, TPublicType&);
bool parseVectorFields(TSourceLoc, const TString&, int vecSize, TVectorFields&); bool parseVectorFields(TSourceLoc, const TString&, int vecSize, TVectorFields&);
void assignError(TSourceLoc, const char* op, TString left, TString right); void assignError(TSourceLoc, const char* op, TString left, TString right);
void unaryOpError(TSourceLoc, const char* op, TString operand); void unaryOpError(TSourceLoc, const char* op, TString operand);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment