Support GL_ARB_texture_cube_map_array extension for desktop.
authorJohn Kessenich <cepheus@frii.com>
Sun, 26 Jan 2014 22:22:54 +0000 (22:22 +0000)
committerJohn Kessenich <cepheus@frii.com>
Sun, 26 Jan 2014 22:22:54 +0000 (22:22 +0000)
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25025 e7fa87d3-cd2b-0410-9028-fcbf551c1848

Test/130.frag
Test/baseResults/130.frag.out
glslang/Include/revision.h
glslang/MachineIndependent/Initialize.cpp
glslang/MachineIndependent/Scan.cpp
glslang/MachineIndependent/Versions.cpp
glslang/MachineIndependent/Versions.h

index 251b756..3569cf2 100644 (file)
@@ -96,3 +96,23 @@ void bar234()
     s = textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1));
     s = textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2);
 }
+
+#extension GL_ARB_texture_cube_map_array : enable
+
+uniform  samplerCubeArray Sca;
+uniform isamplerCubeArray Isca;
+uniform usamplerCubeArray Usca;
+uniform samplerCubeArrayShadow Scas;
+
+void bar235()
+{
+    ivec3 a = textureSize(Sca, 3);
+    vec4 b = texture(Sca, i);
+    ivec4 c = texture(Isca, i, 0.7);
+    uvec4 d = texture(Usca, i);
+    
+    b = textureLod(Sca, i, 1.7);
+    a = textureSize(Scas, a.x);
+    float f = texture(Scas, i, b.y);
+    c = textureGrad(Isca, i, vec3(0.1), vec3(0.2));
+}
index 2dcb99e..10f8680 100644 (file)
@@ -216,6 +216,74 @@ ERROR: node is still EOpNull!
 0:97            1 (const int)\r
 0:97          Constant:\r
 0:97            2 (const int)\r
+0:107  Function Definition: bar235( (void)\r
+0:107    Function Parameters: \r
+0:109    Sequence\r
+0:109      Sequence\r
+0:109        move second child to first child (3-component vector of int)\r
+0:109          'a' (3-component vector of int)\r
+0:109          Function Call: textureSize(sAC1;i1; (3-component vector of int)\r
+0:109            'Sca' (uniform samplerCubeArray)\r
+0:109            Constant:\r
+0:109              3 (const int)\r
+0:110      Sequence\r
+0:110        move second child to first child (4-component vector of float)\r
+0:110          'b' (4-component vector of float)\r
+0:110          Function Call: texture(sAC1;vf4; (4-component vector of float)\r
+0:110            'Sca' (uniform samplerCubeArray)\r
+0:110            'i' (smooth in 4-component vector of float)\r
+0:111      Sequence\r
+0:111        move second child to first child (4-component vector of int)\r
+0:111          'c' (4-component vector of int)\r
+0:111          Function Call: texture(isA31;vf4;f1; (4-component vector of int)\r
+0:111            'Isca' (uniform isampler3DArray)\r
+0:111            'i' (smooth in 4-component vector of float)\r
+0:111            Constant:\r
+0:111              0.700000\r
+0:112      Sequence\r
+0:112        move second child to first child (4-component vector of uint)\r
+0:112          'd' (4-component vector of uint)\r
+0:112          Function Call: texture(usAC1;vf4; (4-component vector of uint)\r
+0:112            'Usca' (uniform usamplerCubeArray)\r
+0:112            'i' (smooth in 4-component vector of float)\r
+0:114      move second child to first child (4-component vector of float)\r
+0:114        'b' (4-component vector of float)\r
+0:114        Function Call: textureLod(sAC1;vf4;f1; (4-component vector of float)\r
+0:114          'Sca' (uniform samplerCubeArray)\r
+0:114          'i' (smooth in 4-component vector of float)\r
+0:114          Constant:\r
+0:114            1.700000\r
+0:115      move second child to first child (3-component vector of int)\r
+0:115        'a' (3-component vector of int)\r
+0:115        Function Call: textureSize(sASC1;i1; (3-component vector of int)\r
+0:115          'Scas' (uniform samplerCubeArrayShadow)\r
+0:115          direct index (int)\r
+0:115            'a' (3-component vector of int)\r
+0:115            Constant:\r
+0:115              0 (const int)\r
+0:116      Sequence\r
+0:116        move second child to first child (float)\r
+0:116          'f' (float)\r
+0:116          Function Call: texture(sASC1;vf4;f1; (float)\r
+0:116            'Scas' (uniform samplerCubeArrayShadow)\r
+0:116            'i' (smooth in 4-component vector of float)\r
+0:116            direct index (float)\r
+0:116              'b' (4-component vector of float)\r
+0:116              Constant:\r
+0:116                1 (const int)\r
+0:117      move second child to first child (4-component vector of int)\r
+0:117        'c' (4-component vector of int)\r
+0:117        Function Call: textureGrad(isA31;vf4;vf3;vf3; (4-component vector of int)\r
+0:117          'Isca' (uniform isampler3DArray)\r
+0:117          'i' (smooth in 4-component vector of float)\r
+0:117          Constant:\r
+0:117            0.100000\r
+0:117            0.100000\r
+0:117            0.100000\r
+0:117          Constant:\r
+0:117            0.200000\r
+0:117            0.200000\r
+0:117            0.200000\r
 0:?   Linker Objects\r
 0:?     'a' (3-component vector of float)\r
 0:?     'b' (float)\r
@@ -233,6 +301,10 @@ ERROR: node is still EOpNull!
 0:?     'samp2DS' (uniform sampler2DShadow)\r
 0:?     'samp2DR' (uniform sampler2DRect)\r
 0:?     'samp2DA' (uniform sampler2DArray)\r
+0:?     'Sca' (uniform samplerCubeArray)\r
+0:?     'Isca' (uniform isampler3DArray)\r
+0:?     'Usca' (uniform usamplerCubeArray)\r
+0:?     'Scas' (uniform samplerCubeArrayShadow)\r
 \r
 \r
 Linked fragment stage:\r
index 4898dee..2b295b5 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 "25015"\r
-#define GLSLANG_DATE     "2014/01/25 18:44:34"\r
+#define GLSLANG_REVISION "25018"\r
+#define GLSLANG_DATE     "2014/01/26 00:56:43"\r
index a421c0e..728599e 100644 (file)
@@ -1464,7 +1464,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile)
                             continue;
                         if (dim == Esd3D && shadow)
                             continue;
-                        if (dim == EsdCube && arrayed && version < 400)
+                        if (dim == EsdCube && arrayed && (profile == EEsProfile || version < 130))
                             continue;
                         if (dim == EsdBuffer && (profile == EEsProfile || version < 140))
                             continue;
index 9fb381b..8f528a5 100644 (file)
@@ -735,12 +735,17 @@ int TScanContext::tokenizeIdentifier()
     case DVEC2:
     case DVEC3:
     case DVEC4:
+        afterType = true;
+        if (parseContext.profile == EEsProfile || parseContext.version < 400)
+            reservedWord();
+        return keyword;
+
     case SAMPLERCUBEARRAY:
     case SAMPLERCUBEARRAYSHADOW:
     case ISAMPLERCUBEARRAY:
     case USAMPLERCUBEARRAY:
         afterType = true;
-        if (parseContext.profile == EEsProfile || parseContext.version < 400)
+        if (parseContext.profile == EEsProfile || (parseContext.version < 400 && ! parseContext.extensionsTurnedOn(1, &GL_ARB_texture_cube_map_array)))
             reservedWord();
         return keyword;
 
index 5fe2de3..93ac47e 100644 (file)
@@ -163,6 +163,7 @@ void TParseContext::initializeExtensionBehavior()
     extensionBehavior[GL_ARB_separate_shader_objects]  = EBhDisable;
     extensionBehavior[GL_ARB_tessellation_shader]      = EBhDisable;
     extensionBehavior[GL_ARB_enhanced_layouts]         = EBhDisable;
+    extensionBehavior[GL_ARB_texture_cube_map_array]   = EBhDisable;
 }
 
 // Get code that is not part of a shared symbol table, is specific to this shader,
@@ -186,7 +187,8 @@ const char* TParseContext::getPreamble()
             "#define GL_ARB_gpu_shader5 1\n"
             "#define GL_ARB_separate_shader_objects 1\n"
             "#define GL_ARB_tessellation_shader 1\n"
-            "#define GL_ARB_enhanced_layouts 1\n";
+            "#define GL_ARB_enhanced_layouts 1\n"
+            "#define GL_ARB_texture_cube_map_array 1\n";
     }
 }
 
index e7ccd2e..8f844d1 100644 (file)
@@ -87,6 +87,7 @@ const char* const GL_ARB_gpu_shader5              = "GL_ARB_gpu_shader5";
 const char* const GL_ARB_separate_shader_objects  = "GL_ARB_separate_shader_objects";
 const char* const GL_ARB_tessellation_shader      = "GL_ARB_tessellation_shader";
 const char* const GL_ARB_enhanced_layouts         = "GL_ARB_enhanced_layouts";
+const char* const GL_ARB_texture_cube_map_array   = "GL_ARB_texture_cube_map_array";
 
 } // end namespace glslang