Correct which versions can support the extensions GL_ARB_separate_shader_objects...
authorJohn Kessenich <cepheus@frii.com>
Wed, 12 Feb 2014 05:15:49 +0000 (05:15 +0000)
committerJohn Kessenich <cepheus@frii.com>
Wed, 12 Feb 2014 05:15:49 +0000 (05:15 +0000)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25314 e7fa87d3-cd2b-0410-9028-fcbf551c1848

Test/130.frag
Test/140.frag
Test/400.tese
Test/baseResults/120.frag.out
Test/baseResults/130.frag.out
Test/baseResults/140.frag.out
glslang/Include/revision.h
glslang/MachineIndependent/ParseHelper.cpp
glslang/MachineIndependent/Scan.cpp
glslang/MachineIndependent/glslang.y

index 3569cf2..7c63075 100644 (file)
@@ -116,3 +116,18 @@ void bar235()
     float f = texture(Scas, i, b.y);
     c = textureGrad(Isca, i, vec3(0.1), vec3(0.2));
 }
+
+#extension GL_ARB_shading_language_420pack : enable
+
+const int ai[3] = { 10, 23, 32 };
+layout(binding=0) uniform blockname { int a; } instanceName;  // ERROR
+uniform layout(binding=0) sampler2D bounds;
+
+void bar23444()
+{
+    mat4x3 m43;
+    float a1 = m43[3].y;
+    int a2 = m43.length();  // ERROR until shading_language_420pack is fully implemented
+    const float b = 2 * a1;
+    a.x = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset;    // ERROR until shading_language_420pack is fully implemented
+}
index 1e29d4d..a252c2d 100644 (file)
@@ -19,4 +19,10 @@ void main()
 
 in struct S { float f; } s; // ERROR
 
-float patch = 3.1;
\ No newline at end of file
+float patch = 3.1;
+
+layout(location=3) in vec4 vl;  // ERROR
+
+#extension GL_ARB_separate_shader_objects : enable
+
+layout(location=4) in vec4 vl2;
index 42e3c4c..e953ab5 100644 (file)
@@ -51,16 +51,16 @@ patch sample in vec3 badp4;         // ERROR
 \r
 #extension GL_ARB_separate_shader_objects : enable\r
 \r
-in gl_PerVertex
-{
-float gl_ClipDistance[1];
-} gl_in[];                          // ERROR, no size
-\r
-in gl_PerVertex
-{
-float gl_ClipDistance[1];
-} gl_in[];
-
+in gl_PerVertex\r
+{\r
+float gl_ClipDistance[1];\r
+} gl_in[];                          // ERROR, no size\r
+\r
+in gl_PerVertex\r
+{\r
+float gl_ClipDistance[1];\r
+} gl_in[];\r
+\r
 layout(quads, cw) out;     // ERROR\r
 layout(triangles) out;     // ERROR\r
 layout(isolines) out;      // ERROR\r
index 77e44d0..898015d 100644 (file)
@@ -17,7 +17,7 @@ ERROR: 0:79: ':' :  wrong operand types: no operation ':' exists that takes a le
 ERROR: 0:79: 'assign' :  cannot convert from '4X4 matrix of float' to 'fragColor 4-component vector of float'\r
 ERROR: 0:82: 'xr' : illegal - vector component fields not from the same set \r
 ERROR: 0:83: 'xyxyx' : illegal vector field selection \r
-ERROR: 0:83: 'scalar swizzle' : not supported with this profile: none\r
+ERROR: 0:83: 'scalar swizzle' : not supported for this version or the enabled extensions \r
 ERROR: 0:83: 'xy' : vector field selection out of range \r
 ERROR: 0:84: 'z' : vector field selection out of range \r
 ERROR: 0:85: 'assign' :  l-value required \r
index 10f8680..52be463 100644 (file)
@@ -14,7 +14,14 @@ ERROR: 0:81: 'textureGatherOffset(...)' : not supported for this version or the
 ERROR: 0:84: 'textureGatherOffset(...)' : not supported for this version or the enabled extensions \r
 ERROR: 0:85: 'textureGatherOffset(...)' : not supported for this version or the enabled extensions \r
 WARNING: 0:88: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5\r
-ERROR: 12 compilation errors.  No code generated.\r
+WARNING: 0:120: '#extension' : extension is only partially supported: GL_ARB_shading_language_420pack\r
+ERROR: 0:123: 'uniform block' : not supported for this version or the enabled extensions \r
+ERROR: 0:130: '.' : field selection not allowed on matrix \r
+ERROR: 0:130: 'm43' : can't use function syntax on variable \r
+ERROR: 0:130: '=' :  cannot convert from 'const float' to 'int'\r
+ERROR: 0:132: 'gl_MinProgramTexelOffset' : undeclared identifier \r
+ERROR: 0:132: 'gl_MaxProgramTexelOffset' : undeclared identifier \r
+ERROR: 18 compilation errors.  No code generated.\r
 \r
 \r
 ERROR: node is still EOpNull!\r
@@ -284,6 +291,34 @@ ERROR: node is still EOpNull!
 0:117            0.200000\r
 0:117            0.200000\r
 0:117            0.200000\r
+0:126  Function Definition: bar23444( (void)\r
+0:126    Function Parameters: \r
+0:?     Sequence\r
+0:129      Sequence\r
+0:129        move second child to first child (float)\r
+0:129          'a1' (float)\r
+0:129          direct index (float)\r
+0:129            direct index (3-component vector of float)\r
+0:129              'm43' (4X3 matrix of float)\r
+0:129              Constant:\r
+0:129                3 (const int)\r
+0:129            Constant:\r
+0:129              1 (const int)\r
+0:131      Sequence\r
+0:131        move second child to first child (float)\r
+0:131          'b' (const (read only) float)\r
+0:131          component-wise multiply (float)\r
+0:131            Constant:\r
+0:131              2.000000\r
+0:131            'a1' (float)\r
+0:132      move second child to first child (float)\r
+0:132        direct index (float)\r
+0:132          'a' (3-component vector of float)\r
+0:132          Constant:\r
+0:132            0 (const int)\r
+0:132        add (float)\r
+0:132          'gl_MinProgramTexelOffset' (float)\r
+0:132          'gl_MaxProgramTexelOffset' (float)\r
 0:?   Linker Objects\r
 0:?     'a' (3-component vector of float)\r
 0:?     'b' (float)\r
@@ -305,6 +340,12 @@ ERROR: node is still EOpNull!
 0:?     'Isca' (uniform isampler3DArray)\r
 0:?     'Usca' (uniform usamplerCubeArray)\r
 0:?     'Scas' (uniform samplerCubeArrayShadow)\r
+0:?     'ai' (const 3-element array of int)\r
+0:?       10 (const int)\r
+0:?       23 (const int)\r
+0:?       32 (const int)\r
+0:?     'instanceName' (layout(binding=0 column_major shared ) uniform block{layout(column_major shared ) uniform int a})\r
+0:?     'bounds' (layout(binding=0 ) uniform sampler2D)\r
 \r
 \r
 Linked fragment stage:\r
index 6beb4c5..ba04a4e 100644 (file)
@@ -3,7 +3,9 @@ Warning, version 140 is not yet complete; most features are present, but a few a
 WARNING: 0:3: varying deprecated in version 130; may be removed in future release\r
 ERROR: 0:17: '#error' : GL_ES is not set  \r
 ERROR: 0:20: 'fragment-shader struct input' : not supported for this version or the enabled extensions \r
-ERROR: 2 compilation errors.  No code generated.\r
+ERROR: 0:24: 'location' : not supported for this version or the enabled extensions \r
+ERROR: 0:24: 'location qualifier on input' : not supported for this version or the enabled extensions \r
+ERROR: 4 compilation errors.  No code generated.\r
 \r
 \r
 ERROR: node is still EOpNull!\r
@@ -30,6 +32,8 @@ ERROR: node is still EOpNull!
 0:?     'gl_ClipDistance' (smooth in 5-element array of float)\r
 0:?     's' (smooth in structure{float f})\r
 0:?     'patch' (float)\r
+0:?     'vl' (layout(location=3 ) smooth in 4-component vector of float)\r
+0:?     'vl2' (layout(location=4 ) smooth in 4-component vector of float)\r
 \r
 \r
 Linked fragment stage:\r
index 2084b06..8e56eb8 100644 (file)
@@ -9,5 +9,5 @@
 // source have to figure out how to create revision.h just to get a build\r
 // going.  However, if it is not updated, it can be a version behind.\r
 \r
-#define GLSLANG_REVISION "25175"\r
-#define GLSLANG_DATE     "2014/01/30 19:42:25"\r
+#define GLSLANG_REVISION "25220"\r
+#define GLSLANG_DATE     "2014/02/03 09:28:23"\r
index baf6e00..bb4560e 100644 (file)
@@ -691,8 +691,8 @@ TIntermTyped* TParseContext::handleDotDereference(TSourceLoc loc, TIntermTyped*
     } else if (base->isVector() || base->isScalar()) {
         if (base->isScalar()) {
             const char* dotFeature = "scalar swizzle";
-            requireProfile(loc, ECoreProfile | ECompatibilityProfile, dotFeature);
-            profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, GL_ARB_shading_language_420pack, dotFeature);
+            requireProfile(loc, ~EEsProfile, dotFeature);
+            profileRequires(loc, ~EEsProfile, 420, GL_ARB_shading_language_420pack, dotFeature);
         }
 
         TVectorFields fields;
@@ -1863,7 +1863,7 @@ void TParseContext::mergeQualifiers(TSourceLoc loc, TQualifier& dst, const TQual
         error(loc, "can only have one interpolation qualifier (flat, smooth, noperspective)", "", "");
 
     // Ordering
-    if (! force && version < 420) {
+    if (! force && version < 420 && ! extensionsTurnedOn(1, &GL_ARB_shading_language_420pack)) {
         // non-function parameters
         if (src.invariant && (dst.isInterpolation() || dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone))
             error(loc, "invariant qualifier must appear first", "", "");
@@ -2317,8 +2317,8 @@ TSymbol* TParseContext::redeclareBuiltinVariable(TSourceLoc loc, const TString&
 void TParseContext::redeclareBuiltinBlock(TSourceLoc loc, TTypeList& newTypeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes)
 {
     const char* feature = "built-in block redeclaration";
-    requireProfile(loc, ECoreProfile | ECompatibilityProfile, feature);
-    profileRequires(loc, ECoreProfile | ECompatibilityProfile, 410, GL_ARB_separate_shader_objects, feature);
+    requireProfile(loc, ~EEsProfile, feature);
+    profileRequires(loc, ~EEsProfile, 410, GL_ARB_separate_shader_objects, feature);
 
     if (blockName != "gl_PerVertex" && blockName != "gl_PerFragment") {
         error(loc, "cannot redeclare block: ", "block declaration", blockName.c_str());
@@ -2863,16 +2863,16 @@ void TParseContext::setLayoutQualifier(TSourceLoc loc, TPublicType& publicType,
             publicType.qualifier.layoutAlign = value;
         return;
     } else if (id == "location") {
-        requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "location");
-        profileRequires(loc, ECoreProfile | ECompatibilityProfile, 330, 0, "location");
+        profileRequires(loc, EEsProfile, 300, 0, "location");
+        profileRequires(loc, ~EEsProfile, 330, GL_ARB_separate_shader_objects, "location");
         if ((unsigned int)value >= TQualifier::layoutLocationEnd)
             error(loc, "location is too large", id.c_str(), "");
         else
             publicType.qualifier.layoutLocation = value;
         return;
     } else if (id == "binding") {
-        requireProfile(loc, ECoreProfile | ECompatibilityProfile, "binding");
-        profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, GL_ARB_shading_language_420pack, "binding");
+        requireProfile(loc, ~EEsProfile, "binding");
+        profileRequires(loc, ~EEsProfile, 420, GL_ARB_shading_language_420pack, "binding");
         if ((unsigned int)value >= TQualifier::layoutBindingEnd)
             error(loc, "binding is too large", id.c_str(), "");
         else
@@ -3182,9 +3182,9 @@ void TParseContext::layoutQualifierCheck(TSourceLoc loc, const TQualifier& quali
                 requireStage(loc, EShLangVertex, feature);
             requireStage(loc, (EShLanguageMask)~EShLangComputeMask, feature);
             if (language == EShLangVertex)
-                profileRequires(loc, ECoreProfile | ECompatibilityProfile, 330, 0, feature);
+                profileRequires(loc, ~EEsProfile, 330, GL_ARB_separate_shader_objects, feature);
             else
-                profileRequires(loc, ECoreProfile | ECompatibilityProfile, 410, GL_ARB_separate_shader_objects, feature);
+                profileRequires(loc, ~EEsProfile, 410, GL_ARB_separate_shader_objects, feature);
             break;
         }
         case EvqVaryingOut:
@@ -3194,9 +3194,9 @@ void TParseContext::layoutQualifierCheck(TSourceLoc loc, const TQualifier& quali
                 requireStage(loc, EShLangFragment, feature);
             requireStage(loc, (EShLanguageMask)~EShLangComputeMask, feature);
             if (language == EShLangFragment)
-                profileRequires(loc, ECoreProfile | ECompatibilityProfile, 330, 0, feature);
+                profileRequires(loc, ~EEsProfile, 330, GL_ARB_separate_shader_objects, feature);
             else
-                profileRequires(loc, ECoreProfile | ECompatibilityProfile, 410, GL_ARB_separate_shader_objects, feature);
+                profileRequires(loc, ~EEsProfile, 410, GL_ARB_separate_shader_objects, feature);
             break;
         }
         case EvqUniform:
@@ -3542,8 +3542,8 @@ TIntermNode* TParseContext::executeInitializer(TSourceLoc loc, TString& identifi
     if (qualifier == EvqConst) {
         if (initializer->getType().getQualifier().storage != EvqConst) {
             const char* initFeature = "non-constant initializer";
-            requireProfile(loc, ECoreProfile | ECompatibilityProfile, initFeature);
-            profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, GL_ARB_shading_language_420pack, initFeature);
+            requireProfile(loc, ~EEsProfile, initFeature);
+            profileRequires(loc, ~EEsProfile, 420, GL_ARB_shading_language_420pack, initFeature);
             variable->getWritableType().getQualifier().storage = EvqConstReadOnly;
             qualifier = EvqConstReadOnly;
         }
@@ -3855,10 +3855,12 @@ void TParseContext::declareBlock(TSourceLoc loc, TTypeList& typeList, const TStr
         profileRequires(loc, ENoProfile, 140, 0, "uniform block");
         break;
     case EvqVaryingIn:
-        requireProfile(loc, ECoreProfile | ECompatibilityProfile, "input block");
+        requireProfile(loc, ~EEsProfile, "input block");
+        profileRequires(loc, ~EEsProfile, 150, GL_ARB_separate_shader_objects, "input block");
         break;
     case EvqVaryingOut:
-        requireProfile(loc, ECoreProfile | ECompatibilityProfile, "output block");
+        requireProfile(loc, ~EEsProfile, "output block");
+        profileRequires(loc, ~EEsProfile, 150, GL_ARB_separate_shader_objects, "output block");
         break;
     default:
         error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), "");
index 8f528a5..fa2dd5b 100644 (file)
@@ -647,6 +647,12 @@ int TScanContext::tokenizeIdentifier()
         return keyword;
 
     case LAYOUT:
+        if ((parseContext.profile == EEsProfile && parseContext.version < 300) ||
+            (parseContext.profile != EEsProfile && parseContext.version < 140 &&
+            ! parseContext.extensionsTurnedOn(1, &GL_ARB_shading_language_420pack)))
+            return identifierOrType();
+        return keyword;
+
     case SHARED:
         if ((parseContext.profile == EEsProfile && parseContext.version < 300) ||
             (parseContext.profile != EEsProfile && parseContext.version < 140))
index 11d6038..6b36fa4 100644 (file)
@@ -2099,14 +2099,14 @@ initializer
     }\r
     | LEFT_BRACE initializer_list RIGHT_BRACE {\r
         const char* initFeature = "{ } style initializers";\r
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, initFeature);\r
-        parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 420, GL_ARB_shading_language_420pack, initFeature);\r
+        parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);\r
+        parseContext.profileRequires($1.loc, ~EEsProfile, 420, GL_ARB_shading_language_420pack, initFeature);\r
         $$ = $2;\r
     }\r
     | LEFT_BRACE initializer_list COMMA RIGHT_BRACE {\r
         const char* initFeature = "{ } style initializers";\r
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, initFeature);\r
-        parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 420, GL_ARB_shading_language_420pack, initFeature);\r
+        parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);\r
+        parseContext.profileRequires($1.loc, ~EEsProfile, 420, GL_ARB_shading_language_420pack, initFeature);\r
         $$ = $2;\r
     }\r
     ;\r