diff --git a/Test/400.tese b/Test/400.tese index e953ab5f..3e913e87 100644 --- a/Test/400.tese +++ b/Test/400.tese @@ -97,3 +97,5 @@ layout(location = 24) in vec4 ivlc[]; // ERROR layout(location = 23) out vec4 ovla[2]; layout(location = 24) out vec4 ovlb[2]; // ERROR + +in float gl_TessLevelOuter[4]; // ERROR diff --git a/Test/baseResults/150.tesc.out b/Test/baseResults/150.tesc.out index 35c0848d..003179ec 100644 --- a/Test/baseResults/150.tesc.out +++ b/Test/baseResults/150.tesc.out @@ -388,7 +388,8 @@ ERROR: 0:78: 'in' : type must be an array: bla ERROR: 0:86: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized ERROR: 0:96: 'location' : overlapping use of location 24 ERROR: 0:99: 'location' : overlapping use of location 24 -ERROR: 29 compilation errors. No code generated. +ERROR: 0:101: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved +ERROR: 30 compilation errors. No code generated. Shader version: 400 diff --git a/Test/baseResults/400.tese.out b/Test/baseResults/400.tese.out index 6cad8dd9..1b436625 100644 --- a/Test/baseResults/400.tese.out +++ b/Test/baseResults/400.tese.out @@ -29,7 +29,8 @@ ERROR: 0:78: 'in' : type must be an array: bla ERROR: 0:86: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized ERROR: 0:96: 'location' : overlapping use of location 24 ERROR: 0:99: 'location' : overlapping use of location 24 -ERROR: 29 compilation errors. No code generated. +ERROR: 0:101: 'gl_TessLevelOuter' : identifiers starting with "gl_" are reserved +ERROR: 30 compilation errors. No code generated. Shader version: 400 diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index b778d18e..ab9938bf 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -2213,6 +2213,11 @@ void TParseContext::declareArray(TSourceLoc loc, TString& identifier, const TTyp if (! symbol) { bool currentScope; symbol = symbolTable.find(identifier, 0, ¤tScope); + + if (symbol && builtInName(identifier) && ! symbolTable.atBuiltInLevel()) { + // bad shader (errors already reported) trying to redeclare a built-in name as an array + return; + } if (symbol == 0 || ! currentScope) { // // Successfully process a new definition.