diff --git a/Test/120.vert b/Test/120.vert index 752318c7cf78bec0302a10287cfd774d88692a6a..3981b2c79f042c84e32d89b607824b8ec33cea05 100644 --- a/Test/120.vert +++ b/Test/120.vert @@ -117,3 +117,5 @@ void foo() overloadF(1, 1); // ERROR overloadF(1); } + +varying vec4 gl_TexCoord[35]; // ERROR, size too big diff --git a/Test/430.vert b/Test/430.vert index 25c17a26b57c342d332985dcae35f4f7d5fada62..4a6b5c81468d21ed515f4d6da6c75be049473706 100644 --- a/Test/430.vert +++ b/Test/430.vert @@ -40,3 +40,5 @@ struct S { layout(location = 10) out S cs[2]; // 10 through 10 + 2 * 22 - 1 = 53 layout(location = 54) out float cf; layout(location = 53) out float cg; // ERROR, collision at 31 + +float gl_ClipDistance[17]; // ERROR, size too big \ No newline at end of file diff --git a/Test/baseResults/120.vert.out b/Test/baseResults/120.vert.out index 1f3f800c947841a904d44c9f3e6e27f1713c1b0d..9948a0eaa829fce6566a10e3c79b9a5c7c4b6246 100644 --- a/Test/baseResults/120.vert.out +++ b/Test/baseResults/120.vert.out @@ -43,7 +43,8 @@ ERROR: 0:107: 'overloadE' : no matching overloaded function found ERROR: 0:108: 'overloadE' : no matching overloaded function found ERROR: 0:111: 'overloadE' : no matching overloaded function found ERROR: 0:117: 'overloadF' : no matching overloaded function found -ERROR: 44 compilation errors. No code generated. +ERROR: 0:121: 'gl_TexCoord array size' : must be less than gl_MaxTextureCoords (32) +ERROR: 45 compilation errors. No code generated. ERROR: node is still EOpNull! @@ -201,6 +202,8 @@ ERROR: node is still EOpNull! 0:? 3.400000 0:? 'concall' (const float) 0:? 0.295520 +0:? 'gl_TexCoord' (smooth out 35-element array of 4-component vector of float) +0:? 'gl_TexCoord' (smooth out 35-element array of 4-component vector of float) Linked vertex stage: diff --git a/Test/baseResults/430.vert.out b/Test/baseResults/430.vert.out index 5b7a5aa221625afb52aa8919ce6ef931f42ba27a..20418023572cf847c9692e8d579fb42fba71f05a 100644 --- a/Test/baseResults/430.vert.out +++ b/Test/baseResults/430.vert.out @@ -12,7 +12,8 @@ ERROR: 0:28: '' : cannot use invariant qualifier on a function parameter ERROR: 0:30: '' : cannot use layout qualifiers on a function parameter ERROR: 0:31: '' : cannot use auxiliary or interpolation qualifiers on a function parameter ERROR: 0:42: 'location' : repeated use of location 53 -ERROR: 12 compilation errors. No code generated. +ERROR: 0:44: 'gl_ClipDistance array size' : must be less than gl_MaxClipDistances (8) +ERROR: 13 compilation errors. No code generated. ERROR: node is still EOpNull! @@ -21,7 +22,7 @@ ERROR: node is still EOpNull! 0:16 Sequence 0:16 move second child to first child (float) 0:16 direct index (float) -0:16 gl_ClipDistance: direct index for structure (unsized array of float) +0:16 gl_ClipDistance: direct index for structure (17-element array of float) 0:16 '__anon__0' (out block{gl_ClipDistance}) 0:16 Constant: 0:16 0 (const uint) diff --git a/Todo.txt b/Todo.txt index 95d4d083e74daae0b5adccd8161ea2ed9e1dbba8..6d6fdbe7218a29c77bba2f7a0480e6f130ab9fb0 100644 --- a/Todo.txt +++ b/Todo.txt @@ -1,6 +1,6 @@ Current functionality level: ESSL 3.0 -- create version system ++ create version system Link Validation + provide input config file for setting limits @@ -28,13 +28,14 @@ Link Validation - number of input/output compononents - tessellation limits - tessellation primitive array sizing consistency - - Non ES: gl_TexCoord can only have a max array size of up to gl_MaxTextureCoords + + Non ES: gl_TexCoord can only have a max array size of up to gl_MaxTextureCoords + + Non ES: gl_ClipDistance ... - ... + exactly one main + ES 3.0: fragment outputs all have locations, if more than one - ES 3.0: location aliasing/overlap (except desktop vertex shader inputs) - Non ES: binding overlap - - location overlap + + location overlap + Non ES: geometry shader input array sizes and input layout qualifier declaration + Non ES: read or write to both gl_ClipVertex and gl_ClipDistance + Non ES: write to only one of gl_FragColor, gl_FragData, or user-declared diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 396267d04dc682cb4d76206173799ddbbe06589a..c2ee21950959b3bdeca50a5ff6ea2f6259790006 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -9,5 +9,5 @@ // source have to figure out how to create revision.h just to get a build // going. However, if it is not updated, it can be a version behind. -#define GLSLANG_REVISION "24391" -#define GLSLANG_DATE "2013/12/06 11:24:47" +#define GLSLANG_REVISION "24396" +#define GLSLANG_DATE "2013/12/06 14:45:15" diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index cd15136d9d5d6633caefe0b05cc17417046a2bd3..af6265d82924528ae3b6ad5cbe6c63c0c29decd8 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -1410,6 +1410,8 @@ void TParseContext::reservedPpErrorCheck(TSourceLoc loc, const char* identifier, // // See if this version/profile allows use of the line-continuation character '\'. // +// Returns true if a line continuation should be done. +// bool TParseContext::lineContinuationCheck(TSourceLoc loc, bool endOfComment) { const char* message = "line continuation"; @@ -1433,6 +1435,8 @@ bool TParseContext::lineContinuationCheck(TSourceLoc loc, bool endOfComment) profileRequires(loc, EEsProfile, 300, 0, message); profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, 0, message); } + + return lineContinuationAllowed; } bool TParseContext::builtInName(const TString& identifier) @@ -1988,6 +1992,11 @@ void TParseContext::declareArray(TSourceLoc loc, TString& identifier, const TTyp return; } + if (identifier.compare("gl_TexCoord") == 0) + limitCheck(loc, type.getArraySize(), "gl_MaxTextureCoords", "gl_TexCoord array size"); + else if (identifier.compare("gl_ClipDistance") == 0) + limitCheck(loc, type.getArraySize(), "gl_MaxClipDistances", "gl_ClipDistance array size"); + newType.shareArraySizes(type); if (language == EShLangGeometry && type.getQualifier().storage == EvqVaryingIn) @@ -2442,6 +2451,18 @@ void TParseContext::inductiveLoopCheck(TSourceLoc loc, TIntermNode* init, TInter inductiveLoopBodyCheck(loop->getBody(), loopIndex, symbolTable); } +// See if the provide value is less than the symbol indicated by limit, +// which should be a constant in the symbol table. +void TParseContext::limitCheck(TSourceLoc loc, int value, const char* limit, const char* feature) +{ + TSymbol* symbol = symbolTable.find(limit); + assert(symbol->getAsVariable()); + const TConstUnionArray& constArray = symbol->getAsVariable()->getConstArray(); + assert(! constArray.empty()); + if (value >= constArray[0].getIConst()) + error(loc, "must be less than", feature, "%s (%d)", limit, constArray[0].getIConst()); +} + // // Do any additional error checking, etc., once we know the parsing is done. // diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index ddbf0f75bd808cfcdf1b7027d051f0f158fe4aaf..f4c0fc2154071a872a9c7711f9a7bfa6721073f7 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -134,6 +134,8 @@ public: void opaqueCheck(TSourceLoc, const TType&, const char* op); void structTypeCheck(TSourceLoc, TPublicType&); void inductiveLoopCheck(TSourceLoc, TIntermNode* init, TIntermLoop* loop); + void limitCheck(TSourceLoc, int value, const char* limit, const char* feature); + void inductiveLoopBodyCheck(TIntermNode*, int loopIndexId, TSymbolTable&); void constantIndexExpressionCheck(TIntermNode*);