diff --git a/Test/pre150.frag b/Test/pre150.frag new file mode 100644 index 00000000..31e75848 --- /dev/null +++ b/Test/pre150.frag @@ -0,0 +1,3 @@ +varying vec4 v; +in vec4 i; +out vec4 o; diff --git a/Test/specExamples.vert b/Test/specExamples.vert index 55559307..c8eb75f9 100644 --- a/Test/specExamples.vert +++ b/Test/specExamples.vert @@ -1,4 +1,4 @@ -#version 110 +#version 150 #extension GL_3DL_array_objects : enable @@ -61,13 +61,13 @@ layout(row_major, column_major) layout(shared, row_major) uniform; // default is now shared and row_major -layout(std140) uniform Transform { // layout of this block is std140 +layout(std140) uniform Transform { // layout of this block is std140 mat4 M1; // row_major layout(column_major) mat4 M2; // column major mat3 N1; // row_major }; -layout(column_major) uniform T3 { // shared and column_major +layout(column_major) uniform T3 { // shared and column_major mat4 M3; // column_major layout(row_major) mat4 m4; // row major mat3 N2; // column_major @@ -178,7 +178,7 @@ void main() light lightVar = light(3.0, vec3(1.0, 2.0, 3.0)); } { - const float c[3] = float[3](5.0, 7.2, 1.1); + const float c[3] = float[3](5.0, 7.2, 1.1); const float d[3] = float[](5.0, 7.2, 1.1); float g; diff --git a/Test/testlist b/Test/testlist index 6911e50c..208ca683 100644 --- a/Test/testlist +++ b/Test/testlist @@ -6,3 +6,4 @@ versionsClean.frag versionsClean.vert versionsErrors.frag versionsErrors.vert +pre150.frag diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 05575a09..e643a6be 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -623,14 +623,19 @@ bool TParseContext::globalQualifierFixAndErrorCheck(int line, TQualifier& qualif { switch (qualifier) { case EvqIn: + profileRequires(line, ENoProfile, 130, 0, "in for stage inputs"); + profileRequires(line, EEsProfile, 300, 0, "in for stage inputs"); qualifier = EvqVaryingIn; - return false; + break; case EvqOut: + profileRequires(line, ENoProfile, 130, 0, "out for stage outputs"); + profileRequires(line, EEsProfile, 300, 0, "out for stage outputs"); qualifier = EvqVaryingOut; - return false; + break; case EvqInOut: qualifier = EvqVaryingIn; - error(line, "cannot use both 'in' and 'out' at global scope", "", ""); + error(line, "cannot use 'inout' at global scope", "", ""); + return true; } diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index c1341b70..0178ae6b 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -122,7 +122,7 @@ void TParseContext::profileRequires(int line, EProfile callingProfile, int minVe // one that takes a single extension void TParseContext::profileRequires(int line, EProfile callingProfile, int minVersion, const char* extension, const char *featureDesc) { - profileRequires(line, callingProfile, minVersion, 1, &extension, featureDesc); + profileRequires(line, callingProfile, minVersion, extension ? 1 : 0, &extension, featureDesc); } // diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 4d004fc6..fc6ad836 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -1417,6 +1417,9 @@ single_declaration : fully_specified_type { $$.type = $1; $$.intermAggregate = 0; + + if (parseContext.globalQualifierFixAndErrorCheck($1.line, $1.qualifier)) + parseContext.recover(); } | fully_specified_type IDENTIFIER { $$.intermAggregate = 0; @@ -1437,6 +1440,10 @@ single_declaration } | fully_specified_type IDENTIFIER array_specifier { $$.intermAggregate = 0; + + if (parseContext.globalQualifierFixAndErrorCheck($1.line, $1.qualifier)) + parseContext.recover(); + if (parseContext.structQualifierErrorCheck($2.line, $1)) parseContext.recover(); diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h index 46fc90f8..e3ff76d0 100644 --- a/glslang/Public/ShaderLang.h +++ b/glslang/Public/ShaderLang.h @@ -213,7 +213,8 @@ enum TDebugOptions { EDebugOpIntermediate = 0x001, EDebugOpAssembly = 0x002, EDebugOpObjectCode = 0x004, - EDebugOpLinkMaps = 0x008 + EDebugOpLinkMaps = 0x008, + EDebugSuppressInfolog = 0x010 }; #ifdef __cplusplus }