diff --git a/Test/baseResults/120.vert.out b/Test/baseResults/120.vert.out index 6c63744fedc6a5b1b0f7d2bdc7fece5019602990..a6e833a3eaaee85a5da15d01ee32c6c5c9f07884 100644 --- a/Test/baseResults/120.vert.out +++ b/Test/baseResults/120.vert.out @@ -44,7 +44,7 @@ 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: 0:121: 'gl_TexCoord array size' : must be less than gl_MaxTextureCoords (32) +ERROR: 0:121: 'gl_TexCoord array size' : must be less than or equal to gl_MaxTextureCoords (32) ERROR: 0:165: 'switch' : Reserved word. ERROR: 0:171: 'default' : Reserved word. ERROR: 0:165: 'switch statements' : not supported for this version or the enabled extensions diff --git a/Test/baseResults/430.vert.out b/Test/baseResults/430.vert.out index 8cfd20c03cb74b35603361e8b361ff9e652cae91..4b7825bd31904cb377ab9031a0b8fd59d10a8ac8 100644 --- a/Test/baseResults/430.vert.out +++ b/Test/baseResults/430.vert.out @@ -14,7 +14,7 @@ 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' : overlapping use of location 53 -ERROR: 0:47: 'gl_ClipDistance array size' : must be less than gl_MaxClipDistances (8) +ERROR: 0:47: 'gl_ClipDistance array size' : must be less than or equal to gl_MaxClipDistances (8) ERROR: 0:51: 'start' : undeclared identifier ERROR: 0:51: '' : constant expression required ERROR: 0:51: 'layout-id value' : scalar integer expression required diff --git a/Test/baseResults/maxClipDistances.vert.out b/Test/baseResults/maxClipDistances.vert.out new file mode 100644 index 0000000000000000000000000000000000000000..5d44a663176c5aa0bc16fe50b43ec13991ea3080 --- /dev/null +++ b/Test/baseResults/maxClipDistances.vert.out @@ -0,0 +1,23 @@ +maxClipDistances.vert +Shader version: 130 +0:? Sequence +0:5 Function Definition: main( (global void) +0:5 Function Parameters: +0:? Linker Objects +0:? 'gl_ClipDistance' (smooth out 8-element array of float ClipDistance) +0:? 'gl_ClipDistance' (smooth out 8-element array of float ClipDistance) +0:? 'gl_VertexID' (gl_VertexId int VertexId) + + +Linked vertex stage: + + +Shader version: 130 +0:? Sequence +0:5 Function Definition: main( (global void) +0:5 Function Parameters: +0:? Linker Objects +0:? 'gl_ClipDistance' (smooth out 8-element array of float ClipDistance) +0:? 'gl_ClipDistance' (smooth out 8-element array of float ClipDistance) +0:? 'gl_VertexID' (gl_VertexId int VertexId) + diff --git a/Test/maxClipDistances.vert b/Test/maxClipDistances.vert new file mode 100644 index 0000000000000000000000000000000000000000..62ddfeb995ac8a4041af2fd3b658b0ea251b30bc --- /dev/null +++ b/Test/maxClipDistances.vert @@ -0,0 +1,7 @@ +#version 130 + +out float gl_ClipDistance[8]; // OK, 8 is gl_MaxClipDistances + +void main() +{ +} diff --git a/Test/testlist b/Test/testlist index dd682b2d0a8bc05d94b5dd58ab7422909ef11926..09f8fd8de4ff83ee624578d364c58ae16f38db5d 100644 --- a/Test/testlist +++ b/Test/testlist @@ -132,3 +132,4 @@ negativeArraySize.comp spv.atomic.comp precise.tesc precise_struct_block.vert +maxClipDistances.vert diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 8d7ecdec568dd3448ff0f637fd2c69e9d2b4cf4b..a7f91ad107971932ca0a6abd0fe638e1d6826133 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -3824,7 +3824,7 @@ void TParseContext::arrayLimitCheck(const TSourceLoc& loc, const TString& identi limitCheck(loc, size, "gl_MaxCullDistances", "gl_CullDistance array size"); } -// See if the provided value is less than the symbol indicated by limit, +// See if the provided value is less than or equal to the symbol indicated by limit, // which should be a constant in the symbol table. void TParseContext::limitCheck(const TSourceLoc& loc, int value, const char* limit, const char* feature) { @@ -3832,8 +3832,8 @@ void TParseContext::limitCheck(const TSourceLoc& loc, int value, const char* lim 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()); + if (value > constArray[0].getIConst()) + error(loc, "must be less than or equal to", feature, "%s (%d)", limit, constArray[0].getIConst()); } //