Implement GL_OES_texture_storage_multisample_2d_array.
authorJohn Kessenich <cepheus@frii.com>
Mon, 17 Aug 2015 03:10:38 +0000 (21:10 -0600)
committerJohn Kessenich <cepheus@frii.com>
Mon, 17 Aug 2015 03:10:38 +0000 (21:10 -0600)
Test/310.vert
Test/baseResults/310.vert.out
glslang/Include/revision.h
glslang/MachineIndependent/Initialize.cpp
glslang/MachineIndependent/Scan.cpp
glslang/MachineIndependent/Versions.cpp

index 53f5461..5b25f3f 100644 (file)
@@ -305,3 +305,37 @@ void CAT()
     highp ivec3 s2 = imageSize(CA2);\r
     highp ivec3 s3 = imageSize(CA3);\r
 }\r
+\r
+uniform sampler2DMSArray  bad2DMS;    // ERROR, reserved\r
+uniform isampler2DMSArray bad2DMSi;   // ERROR, reserved\r
+uniform usampler2DMSArray bad2DMSu;   // ERROR, reserved\r
+\r
+#extension GL_OES_texture_storage_multisample_2d_array : enable\r
+\r
+#ifdef GL_OES_texture_storage_multisample_2d_array\r
+\r
+uniform sampler2DMSArray  noPrec2DMS;    // ERROR, no default\r
+uniform isampler2DMSArray noPrec2DMSi;   // ERROR, no default\r
+uniform usampler2DMSArray noPrec2DMSu;   // ERROR, no default\r
+\r
+#endif\r
+\r
+precision highp sampler2DMSArray;\r
+precision highp isampler2DMSArray;\r
+precision highp usampler2DMSArray;\r
+\r
+uniform sampler2DMSArray  samp2DMSA;\r
+uniform isampler2DMSArray samp2DMSAi;\r
+uniform usampler2DMSArray samp2DMSAu;\r
+\r
+void MSA()\r
+{\r
+    vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2);\r
+    ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2);\r
+    uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2);\r
+    \r
+    ivec3 tfs = textureSize(samp2DMSA);\r
+    ivec3 tfsi = textureSize(samp2DMSAi);\r
+    ivec3 tfsb = textureSize(samp2DMSAi, 4);  // ERROR, no lod\r
+    ivec3 tfsu = textureSize(samp2DMSAu);\r
+}\r
index 208cd56..315c6b0 100644 (file)
@@ -79,7 +79,18 @@ ERROR: 0:250: 'sampler/image' : type requires declaration of default precision q
 ERROR: 0:251: 'sampler/image' : type requires declaration of default precision qualifier \r
 ERROR: 0:252: 'sampler/image' : type requires declaration of default precision qualifier \r
 ERROR: 0:253: 'sampler/image' : type requires declaration of default precision qualifier \r
-ERROR: 75 compilation errors.  No code generated.\r
+ERROR: 0:309: 'sampler2DMSArray' : Reserved word. \r
+ERROR: 0:309: 'sampler/image' : type requires declaration of default precision qualifier \r
+ERROR: 0:310: 'isampler2DMSArray' : Reserved word. \r
+ERROR: 0:310: 'sampler/image' : type requires declaration of default precision qualifier \r
+ERROR: 0:311: 'usampler2DMSArray' : Reserved word. \r
+ERROR: 0:311: 'sampler/image' : type requires declaration of default precision qualifier \r
+ERROR: 0:317: 'sampler/image' : type requires declaration of default precision qualifier \r
+ERROR: 0:318: 'sampler/image' : type requires declaration of default precision qualifier \r
+ERROR: 0:319: 'sampler/image' : type requires declaration of default precision qualifier \r
+ERROR: 0:339: 'textureSize' : no matching overloaded function found \r
+ERROR: 0:339: '=' :  cannot convert from 'const float' to 'temp highp 3-component vector of int'\r
+ERROR: 86 compilation errors.  No code generated.\r
 \r
 \r
 Shader version: 310\r
@@ -88,6 +99,7 @@ Requested GL_OES_gpu_shader5
 Requested GL_OES_shader_io_blocks\r
 Requested GL_OES_texture_buffer\r
 Requested GL_OES_texture_cube_map_array\r
+Requested GL_OES_texture_storage_multisample_2d_array\r
 ERROR: node is still EOpNull!\r
 0:12  Function Definition: main( (global void)\r
 0:12    Function Parameters: \r
@@ -713,6 +725,57 @@ ERROR: node is still EOpNull!
 0:306          's3' (temp highp 3-component vector of int)\r
 0:306          Function Call: imageSize(uIAC1; (global highp 3-component vector of int)\r
 0:306            'CA3' (writeonly uniform highp uimageCubeArray)\r
+0:331  Function Definition: MSA( (global void)\r
+0:331    Function Parameters: \r
+0:333    Sequence\r
+0:333      Sequence\r
+0:333        move second child to first child (temp highp 4-component vector of float)\r
+0:333          'tf' (temp highp 4-component vector of float)\r
+0:333          Function Call: texelFetch(sA2M1;vi3;i1; (global highp 4-component vector of float)\r
+0:333            'samp2DMSA' (uniform highp sampler2DMSArray)\r
+0:333            Constant:\r
+0:333              5 (const int)\r
+0:333              5 (const int)\r
+0:333              5 (const int)\r
+0:333            Constant:\r
+0:333              2 (const int)\r
+0:334      Sequence\r
+0:334        move second child to first child (temp highp 4-component vector of int)\r
+0:334          'tfi' (temp highp 4-component vector of int)\r
+0:334          Function Call: texelFetch(isA2M1;vi3;i1; (global highp 4-component vector of int)\r
+0:334            'samp2DMSAi' (uniform highp isampler2DMSArray)\r
+0:334            Constant:\r
+0:334              5 (const int)\r
+0:334              5 (const int)\r
+0:334              5 (const int)\r
+0:334            Constant:\r
+0:334              2 (const int)\r
+0:335      Sequence\r
+0:335        move second child to first child (temp highp 4-component vector of uint)\r
+0:335          'tfu' (temp highp 4-component vector of uint)\r
+0:335          Function Call: texelFetch(usA2M1;vi3;i1; (global highp 4-component vector of uint)\r
+0:335            'samp2DMSAu' (uniform highp usampler2DMSArray)\r
+0:335            Constant:\r
+0:335              5 (const int)\r
+0:335              5 (const int)\r
+0:335              5 (const int)\r
+0:335            Constant:\r
+0:335              2 (const int)\r
+0:337      Sequence\r
+0:337        move second child to first child (temp highp 3-component vector of int)\r
+0:337          'tfs' (temp highp 3-component vector of int)\r
+0:337          Function Call: textureSize(sA2M1; (global highp 3-component vector of int)\r
+0:337            'samp2DMSA' (uniform highp sampler2DMSArray)\r
+0:338      Sequence\r
+0:338        move second child to first child (temp highp 3-component vector of int)\r
+0:338          'tfsi' (temp highp 3-component vector of int)\r
+0:338          Function Call: textureSize(isA2M1; (global highp 3-component vector of int)\r
+0:338            'samp2DMSAi' (uniform highp isampler2DMSArray)\r
+0:340      Sequence\r
+0:340        move second child to first child (temp highp 3-component vector of int)\r
+0:340          'tfsu' (temp highp 3-component vector of int)\r
+0:340          Function Call: textureSize(usA2M1; (global highp 3-component vector of int)\r
+0:340            'samp2DMSAu' (uniform highp usampler2DMSArray)\r
 0:?   Linker Objects\r
 0:?     's' (shared highp 4-component vector of float)\r
 0:?     'v' (buffer highp 4-component vector of float)\r
@@ -801,6 +864,15 @@ ERROR: node is still EOpNull!
 0:?     'CA5' (uniform highp samplerCubeArrayShadow)\r
 0:?     'CA6' (uniform highp isamplerCubeArray)\r
 0:?     'CA7' (uniform highp usamplerCubeArray)\r
+0:?     'bad2DMS' (uniform mediump sampler2DMSArray)\r
+0:?     'bad2DMSi' (uniform mediump isampler2DMSArray)\r
+0:?     'bad2DMSu' (uniform mediump usampler2DMSArray)\r
+0:?     'noPrec2DMS' (uniform mediump sampler2DMSArray)\r
+0:?     'noPrec2DMSi' (uniform mediump isampler2DMSArray)\r
+0:?     'noPrec2DMSu' (uniform mediump usampler2DMSArray)\r
+0:?     'samp2DMSA' (uniform highp sampler2DMSArray)\r
+0:?     'samp2DMSAi' (uniform highp isampler2DMSArray)\r
+0:?     'samp2DMSAu' (uniform highp usampler2DMSArray)\r
 0:?     'gl_VertexID' (gl_VertexId highp int VertexId)\r
 0:?     'gl_InstanceID' (gl_InstanceId highp int InstanceId)\r
 \r
@@ -814,6 +886,7 @@ Requested GL_OES_gpu_shader5
 Requested GL_OES_shader_io_blocks\r
 Requested GL_OES_texture_buffer\r
 Requested GL_OES_texture_cube_map_array\r
+Requested GL_OES_texture_storage_multisample_2d_array\r
 ERROR: node is still EOpNull!\r
 0:12  Function Definition: main( (global void)\r
 0:12    Function Parameters: \r
@@ -1439,6 +1512,57 @@ ERROR: node is still EOpNull!
 0:306          's3' (temp highp 3-component vector of int)\r
 0:306          Function Call: imageSize(uIAC1; (global highp 3-component vector of int)\r
 0:306            'CA3' (writeonly uniform highp uimageCubeArray)\r
+0:331  Function Definition: MSA( (global void)\r
+0:331    Function Parameters: \r
+0:333    Sequence\r
+0:333      Sequence\r
+0:333        move second child to first child (temp highp 4-component vector of float)\r
+0:333          'tf' (temp highp 4-component vector of float)\r
+0:333          Function Call: texelFetch(sA2M1;vi3;i1; (global highp 4-component vector of float)\r
+0:333            'samp2DMSA' (uniform highp sampler2DMSArray)\r
+0:333            Constant:\r
+0:333              5 (const int)\r
+0:333              5 (const int)\r
+0:333              5 (const int)\r
+0:333            Constant:\r
+0:333              2 (const int)\r
+0:334      Sequence\r
+0:334        move second child to first child (temp highp 4-component vector of int)\r
+0:334          'tfi' (temp highp 4-component vector of int)\r
+0:334          Function Call: texelFetch(isA2M1;vi3;i1; (global highp 4-component vector of int)\r
+0:334            'samp2DMSAi' (uniform highp isampler2DMSArray)\r
+0:334            Constant:\r
+0:334              5 (const int)\r
+0:334              5 (const int)\r
+0:334              5 (const int)\r
+0:334            Constant:\r
+0:334              2 (const int)\r
+0:335      Sequence\r
+0:335        move second child to first child (temp highp 4-component vector of uint)\r
+0:335          'tfu' (temp highp 4-component vector of uint)\r
+0:335          Function Call: texelFetch(usA2M1;vi3;i1; (global highp 4-component vector of uint)\r
+0:335            'samp2DMSAu' (uniform highp usampler2DMSArray)\r
+0:335            Constant:\r
+0:335              5 (const int)\r
+0:335              5 (const int)\r
+0:335              5 (const int)\r
+0:335            Constant:\r
+0:335              2 (const int)\r
+0:337      Sequence\r
+0:337        move second child to first child (temp highp 3-component vector of int)\r
+0:337          'tfs' (temp highp 3-component vector of int)\r
+0:337          Function Call: textureSize(sA2M1; (global highp 3-component vector of int)\r
+0:337            'samp2DMSA' (uniform highp sampler2DMSArray)\r
+0:338      Sequence\r
+0:338        move second child to first child (temp highp 3-component vector of int)\r
+0:338          'tfsi' (temp highp 3-component vector of int)\r
+0:338          Function Call: textureSize(isA2M1; (global highp 3-component vector of int)\r
+0:338            'samp2DMSAi' (uniform highp isampler2DMSArray)\r
+0:340      Sequence\r
+0:340        move second child to first child (temp highp 3-component vector of int)\r
+0:340          'tfsu' (temp highp 3-component vector of int)\r
+0:340          Function Call: textureSize(usA2M1; (global highp 3-component vector of int)\r
+0:340            'samp2DMSAu' (uniform highp usampler2DMSArray)\r
 0:?   Linker Objects\r
 0:?     's' (shared highp 4-component vector of float)\r
 0:?     'v' (buffer highp 4-component vector of float)\r
@@ -1527,6 +1651,15 @@ ERROR: node is still EOpNull!
 0:?     'CA5' (uniform highp samplerCubeArrayShadow)\r
 0:?     'CA6' (uniform highp isamplerCubeArray)\r
 0:?     'CA7' (uniform highp usamplerCubeArray)\r
+0:?     'bad2DMS' (uniform mediump sampler2DMSArray)\r
+0:?     'bad2DMSi' (uniform mediump isampler2DMSArray)\r
+0:?     'bad2DMSu' (uniform mediump usampler2DMSArray)\r
+0:?     'noPrec2DMS' (uniform mediump sampler2DMSArray)\r
+0:?     'noPrec2DMSi' (uniform mediump isampler2DMSArray)\r
+0:?     'noPrec2DMSu' (uniform mediump usampler2DMSArray)\r
+0:?     'samp2DMSA' (uniform highp sampler2DMSArray)\r
+0:?     'samp2DMSAi' (uniform highp isampler2DMSArray)\r
+0:?     'samp2DMSAu' (uniform highp usampler2DMSArray)\r
 0:?     'gl_VertexID' (gl_VertexId highp int VertexId)\r
 0:?     'gl_InstanceID' (gl_InstanceId highp int InstanceId)\r
 \r
index 981beeb..d5dfc84 100644 (file)
@@ -2,5 +2,5 @@
 // For the version, it uses the latest git tag followed by the number of commits.
 // For the date, it uses the current date (when then script is run).
 
-#define GLSLANG_REVISION "2.3.717"
+#define GLSLANG_REVISION "2.3.718"
 #define GLSLANG_DATE "16-Aug-2015"
index 7330106..06e522e 100644 (file)
@@ -1862,7 +1862,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile)
                             continue;
                         if (dim == EsdBuffer && (shadow || arrayed || ms))
                             continue;
-                        if (ms && arrayed && profile == EEsProfile)
+                        if (ms && arrayed && profile == EEsProfile && version < 310)
                             continue;
 
                         for (int bType = 0; bType < 3; ++bType) { // float, int, uint results
index 3c26155..4a4cd47 100644 (file)
@@ -900,6 +900,8 @@ int TScanContext::tokenizeIdentifier()
     case ISAMPLER2DMSARRAY:
     case USAMPLER2DMSARRAY:
         afterType = true;
+        if (parseContext.extensionsTurnedOn(1, &E_GL_OES_texture_storage_multisample_2d_array))
+            return keyword;
         return es30ReservedFromGLSL(150);
 
     case SAMPLER1D:
index 504110b..dbd37cc 100644 (file)
@@ -184,7 +184,7 @@ void TParseContext::initializeExtensionBehavior()
     extensionBehavior[E_GL_OES_sample_variables]                     = EBhDisablePartial;
     extensionBehavior[E_GL_OES_shader_image_atomic]                  = EBhDisablePartial;
     extensionBehavior[E_GL_OES_shader_multisample_interpolation]     = EBhDisablePartial;
-    extensionBehavior[E_GL_OES_texture_storage_multisample_2d_array] = EBhDisablePartial;
+    extensionBehavior[E_GL_OES_texture_storage_multisample_2d_array] = EBhDisable;
     extensionBehavior[E_GL_EXT_geometry_shader]                      = EBhDisable;
     extensionBehavior[E_GL_EXT_geometry_point_size]                  = EBhDisable;
     extensionBehavior[E_GL_EXT_gpu_shader5]                          = EBhDisable;