diff --git a/Test/330.frag b/Test/330.frag new file mode 100644 index 0000000000000000000000000000000000000000..b81b79b21d555e75cf76b210a9b9d540b20ae509 --- /dev/null +++ b/Test/330.frag @@ -0,0 +1,12 @@ +#version 330 + +in vec4 inVar; +out vec4 outVar; + +varying vec4 varyingVar; + +void main() +{ + gl_FragColor = varyingVar; + gl_FragData[1] = inVar; +} diff --git a/Test/330comp.frag b/Test/330comp.frag new file mode 100644 index 0000000000000000000000000000000000000000..50b037da66a798eee1bfc050f7dfa9bf21e3d8db --- /dev/null +++ b/Test/330comp.frag @@ -0,0 +1,12 @@ +#version 330 compatibility + +in vec4 inVar; +out vec4 outVar; + +varying vec4 varyingVar; + +void main() +{ + gl_FragColor = varyingVar; + gl_FragData[1] = inVar * gl_ModelViewMatrix; +} diff --git a/Test/testlist b/Test/testlist index dd697584afe4d9e7257c7266f07db6bf1c40b7f7..0921ddd6a3372d40713bcb5dce3609db15aa7577 100644 --- a/Test/testlist +++ b/Test/testlist @@ -22,3 +22,5 @@ array100.frag comment.frag 300.vert 300.frag +330.frag +330comp.frag diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index bf2fecc8ceea1bab59e94bf5cb66aadd25a863a4..0cc4e4f04995a77d69dd98c886487c38fdbf1095 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -44,6 +44,7 @@ #include "Initialize.h" const int FirstProfileVersion = 150; +const bool ForwardCompatibility = false; TBuiltIns::TBuiltIns() { @@ -1284,7 +1285,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb symbolTable.insert(*new TVariable(NewPoolTString("gl_PointCoord"), TType(EbtFloat, EvqPointCoord, pq, 2))); } - if (version < FirstProfileVersion || profile == ECompatibilityProfile) { + if (version < FirstProfileVersion || profile == ECompatibilityProfile || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { pq = profile == EEsProfile ? EpqMedium : EpqNone; symbolTable.insert(*new TVariable(NewPoolTString("gl_FragColor"), TType(EbtFloat, EvqFragColor, pq, 4))); } @@ -1413,7 +1414,7 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb case EShLangFragment: // Set up gl_FragData based on current array size. - if (version < FirstProfileVersion || profile == ECompatibilityProfile) { + if (version < FirstProfileVersion || profile == ECompatibilityProfile || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { TPrecisionQualifier pq = profile == EEsProfile ? EpqMedium : EpqNone; TType fragData(EbtFloat, EvqFragColor, 4); TArraySizes arraySizes = NewPoolTArraySizes(); diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 81ceb4803ce6026534f3b7921e688434d90e80ab..b807650f89da95226fdfed69c11893d08cfabb5b 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -1699,7 +1699,7 @@ storage_qualifier } | ATTRIBUTE { parseContext.requireStage($1.line, EShLangVertexMask, "attribute"); - + parseContext.checkDeprecated($1.line, ECoreProfile, 150, "attribute"); parseContext.checkDeprecated($1.line, ENoProfile, 140, "attribute"); parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "attribute"); parseContext.requireNotRemoved($1.line, EEsProfile, 300, "attribute"); @@ -1712,6 +1712,7 @@ storage_qualifier } | VARYING { parseContext.checkDeprecated($1.line, ENoProfile, 140, "varying"); + parseContext.checkDeprecated($1.line, ECoreProfile, 150, "varying"); parseContext.requireNotRemoved($1.line, ECoreProfile, 420, "varying"); parseContext.requireNotRemoved($1.line, EEsProfile, 300, "varying");