From e96ee859a822ff991b25fe0925195624af5e1c0c Mon Sep 17 00:00:00 2001
From: John Kessenich <cepheus@frii.com>
Date: Mon, 14 Apr 2014 22:08:16 +0000
Subject: [PATCH] Establish desktop completeness through version 1.50. 
 (gl_MaxVaryingFloats, implicit-cconversion safety, cube-sampler-array fix,
 add tests)

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26253 e7fa87d3-cd2b-0410-9028-fcbf551c1848
---
 Test/150.frag                                |  29 ++-
 Test/baseResults/130.frag.out                |  20 +--
 Test/baseResults/150.frag.out                | 177 ++++++++++++++++++-
 Test/baseResults/150.geom.out                |   1 -
 Test/baseResults/150.tesc.out                |   2 -
 Test/baseResults/150.vert.out                |   1 -
 Test/baseResults/mains1.frag.out             |   2 -
 Test/baseResults/matrix2.frag.out            |   1 -
 Test/baseResults/simpleFunctionCall.frag.out |   1 -
 Todo.txt                                     |   6 +-
 glslang/MachineIndependent/Initialize.cpp    |   8 +-
 glslang/MachineIndependent/Intermediate.cpp  |  11 +-
 glslang/MachineIndependent/ParseHelper.cpp   |  12 +-
 glslang/MachineIndependent/ShaderLang.cpp    |   9 +-
 glslang/MachineIndependent/glslang.y         |   2 +-
 15 files changed, 246 insertions(+), 36 deletions(-)

diff --git a/Test/150.frag b/Test/150.frag
index 6225aa7a7..de0905c11 100644
--- a/Test/150.frag
+++ b/Test/150.frag
@@ -15,4 +15,31 @@ layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord;  // ERROR,
 
 in struct S { float f; } s;
 
-float patch = 3.1;
\ No newline at end of file
+float patch = 3.1;
+
+uniform sampler2DMS sms;
+uniform isampler2DMS isms;
+uniform usampler2DMS usms;
+uniform sampler2DMSArray smsa;
+uniform isampler2DMSArray ismsa;
+uniform usampler2DMSArray usmsa;
+
+flat in ivec2 p2;
+flat in ivec3 p3;
+flat in int samp;
+
+void barWxyz()
+{
+    ivec2 t11 = textureSize( sms);
+    ivec2 t12 = textureSize(isms);
+    ivec2 t13 = textureSize(usms);
+    ivec3 t21 = textureSize( smsa);
+    ivec3 t22 = textureSize(ismsa);
+    ivec3 t23 = textureSize(usmsa);
+     vec4 t31 = texelFetch( sms, p2, samp);
+    ivec4 t32 = texelFetch(isms, p2, samp);
+    uvec4 t33 = texelFetch(usms, p2, 3);
+     vec4 t41 = texelFetch( smsa, p3, samp);
+    ivec4 t42 = texelFetch(ismsa, ivec3(2), samp);
+    uvec4 t43 = texelFetch(usmsa, p3, samp);
+}
diff --git a/Test/baseResults/130.frag.out b/Test/baseResults/130.frag.out
index 9e0139e73..8e0748887 100644
--- a/Test/baseResults/130.frag.out
+++ b/Test/baseResults/130.frag.out
@@ -247,8 +247,8 @@ ERROR: node is still EOpNull!
 0:111      Sequence
 0:111        move second child to first child (4-component vector of int)
 0:111          'c' (4-component vector of int)
-0:111          Function Call: texture(isA31;vf4;f1; (4-component vector of int)
-0:111            'Isca' (uniform isampler3DArray)
+0:111          Function Call: texture(isAC1;vf4;f1; (4-component vector of int)
+0:111            'Isca' (uniform isamplerCubeArray)
 0:111            'i' (smooth in 4-component vector of float)
 0:111            Constant:
 0:111              0.700000
@@ -285,8 +285,8 @@ ERROR: node is still EOpNull!
 0:116                1 (const int)
 0:117      move second child to first child (4-component vector of int)
 0:117        'c' (4-component vector of int)
-0:117        Function Call: textureGrad(isA31;vf4;vf3;vf3; (4-component vector of int)
-0:117          'Isca' (uniform isampler3DArray)
+0:117        Function Call: textureGrad(isAC1;vf4;vf3;vf3; (4-component vector of int)
+0:117          'Isca' (uniform isamplerCubeArray)
 0:117          'i' (smooth in 4-component vector of float)
 0:117          Constant:
 0:117            0.100000
@@ -342,7 +342,7 @@ ERROR: node is still EOpNull!
 0:?     'samp2DR' (uniform sampler2DRect)
 0:?     'samp2DA' (uniform sampler2DArray)
 0:?     'Sca' (uniform samplerCubeArray)
-0:?     'Isca' (uniform isampler3DArray)
+0:?     'Isca' (uniform isamplerCubeArray)
 0:?     'Usca' (uniform usamplerCubeArray)
 0:?     'Scas' (uniform samplerCubeArrayShadow)
 0:?     'ai' (const 3-element array of int)
@@ -580,8 +580,8 @@ ERROR: node is still EOpNull!
 0:111      Sequence
 0:111        move second child to first child (4-component vector of int)
 0:111          'c' (4-component vector of int)
-0:111          Function Call: texture(isA31;vf4;f1; (4-component vector of int)
-0:111            'Isca' (uniform isampler3DArray)
+0:111          Function Call: texture(isAC1;vf4;f1; (4-component vector of int)
+0:111            'Isca' (uniform isamplerCubeArray)
 0:111            'i' (smooth in 4-component vector of float)
 0:111            Constant:
 0:111              0.700000
@@ -618,8 +618,8 @@ ERROR: node is still EOpNull!
 0:116                1 (const int)
 0:117      move second child to first child (4-component vector of int)
 0:117        'c' (4-component vector of int)
-0:117        Function Call: textureGrad(isA31;vf4;vf3;vf3; (4-component vector of int)
-0:117          'Isca' (uniform isampler3DArray)
+0:117        Function Call: textureGrad(isAC1;vf4;vf3;vf3; (4-component vector of int)
+0:117          'Isca' (uniform isamplerCubeArray)
 0:117          'i' (smooth in 4-component vector of float)
 0:117          Constant:
 0:117            0.100000
@@ -675,7 +675,7 @@ ERROR: node is still EOpNull!
 0:?     'samp2DR' (uniform sampler2DRect)
 0:?     'samp2DA' (uniform sampler2DArray)
 0:?     'Sca' (uniform samplerCubeArray)
-0:?     'Isca' (uniform isampler3DArray)
+0:?     'Isca' (uniform isamplerCubeArray)
 0:?     'Usca' (uniform usamplerCubeArray)
 0:?     'Scas' (uniform samplerCubeArrayShadow)
 0:?     'ai' (const 3-element array of int)
diff --git a/Test/baseResults/150.frag.out b/Test/baseResults/150.frag.out
index 6795551e0..5039c0a22 100644
--- a/Test/baseResults/150.frag.out
+++ b/Test/baseResults/150.frag.out
@@ -1,5 +1,4 @@
 150.frag
-Warning, version 150 is not yet complete; most version-specific features are present, but some are missing.
 ERROR: 0:4: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord
 ERROR: 0:5: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord
 ERROR: 0:6: 'layout qualifier' : can only apply origin_upper_left and pixel_center_origin to gl_FragCoord 
@@ -23,12 +22,100 @@ ERROR: node is still EOpNull!
 0:18      'patch' (float)
 0:18      Constant:
 0:18        3.100000
+0:31  Function Definition: barWxyz( (void)
+0:31    Function Parameters: 
+0:33    Sequence
+0:33      Sequence
+0:33        move second child to first child (2-component vector of int)
+0:33          't11' (2-component vector of int)
+0:33          Function Call: textureSize(s21; (2-component vector of int)
+0:33            'sms' (uniform sampler2DMS)
+0:34      Sequence
+0:34        move second child to first child (2-component vector of int)
+0:34          't12' (2-component vector of int)
+0:34          Function Call: textureSize(is21; (2-component vector of int)
+0:34            'isms' (uniform isampler2DMS)
+0:35      Sequence
+0:35        move second child to first child (2-component vector of int)
+0:35          't13' (2-component vector of int)
+0:35          Function Call: textureSize(us21; (2-component vector of int)
+0:35            'usms' (uniform usampler2DMS)
+0:36      Sequence
+0:36        move second child to first child (3-component vector of int)
+0:36          't21' (3-component vector of int)
+0:36          Function Call: textureSize(sA21; (3-component vector of int)
+0:36            'smsa' (uniform sampler2DMSArray)
+0:37      Sequence
+0:37        move second child to first child (3-component vector of int)
+0:37          't22' (3-component vector of int)
+0:37          Function Call: textureSize(isA21; (3-component vector of int)
+0:37            'ismsa' (uniform isampler2DMSArray)
+0:38      Sequence
+0:38        move second child to first child (3-component vector of int)
+0:38          't23' (3-component vector of int)
+0:38          Function Call: textureSize(usA21; (3-component vector of int)
+0:38            'usmsa' (uniform usampler2DMSArray)
+0:39      Sequence
+0:39        move second child to first child (4-component vector of float)
+0:39          't31' (4-component vector of float)
+0:39          Function Call: texelFetch(s21;vi2;i1; (4-component vector of float)
+0:39            'sms' (uniform sampler2DMS)
+0:39            'p2' (flat in 2-component vector of int)
+0:39            'samp' (flat in int)
+0:40      Sequence
+0:40        move second child to first child (4-component vector of int)
+0:40          't32' (4-component vector of int)
+0:40          Function Call: texelFetch(is21;vi2;i1; (4-component vector of int)
+0:40            'isms' (uniform isampler2DMS)
+0:40            'p2' (flat in 2-component vector of int)
+0:40            'samp' (flat in int)
+0:41      Sequence
+0:41        move second child to first child (4-component vector of uint)
+0:41          't33' (4-component vector of uint)
+0:41          Function Call: texelFetch(us21;vi2;i1; (4-component vector of uint)
+0:41            'usms' (uniform usampler2DMS)
+0:41            'p2' (flat in 2-component vector of int)
+0:41            Constant:
+0:41              3 (const int)
+0:42      Sequence
+0:42        move second child to first child (4-component vector of float)
+0:42          't41' (4-component vector of float)
+0:42          Function Call: texelFetch(sA21;vi3;i1; (4-component vector of float)
+0:42            'smsa' (uniform sampler2DMSArray)
+0:42            'p3' (flat in 3-component vector of int)
+0:42            'samp' (flat in int)
+0:43      Sequence
+0:43        move second child to first child (4-component vector of int)
+0:43          't42' (4-component vector of int)
+0:43          Function Call: texelFetch(isA21;vi3;i1; (4-component vector of int)
+0:43            'ismsa' (uniform isampler2DMSArray)
+0:43            Constant:
+0:43              2 (const int)
+0:43              2 (const int)
+0:43              2 (const int)
+0:43            'samp' (flat in int)
+0:44      Sequence
+0:44        move second child to first child (4-component vector of uint)
+0:44          't43' (4-component vector of uint)
+0:44          Function Call: texelFetch(usA21;vi3;i1; (4-component vector of uint)
+0:44            'usmsa' (uniform usampler2DMSArray)
+0:44            'p3' (flat in 3-component vector of int)
+0:44            'samp' (flat in int)
 0:?   Linker Objects
 0:?     'gl_FragCoord' (gl_FragCoord 4-component vector of float)
 0:?     'gl_FragCoord' (gl_FragCoord 4-component vector of float)
 0:?     'foo' (smooth in 4-component vector of float)
 0:?     's' (smooth in structure{float f})
 0:?     'patch' (float)
+0:?     'sms' (uniform sampler2DMS)
+0:?     'isms' (uniform isampler2DMS)
+0:?     'usms' (uniform usampler2DMS)
+0:?     'smsa' (uniform sampler2DMSArray)
+0:?     'ismsa' (uniform isampler2DMSArray)
+0:?     'usmsa' (uniform usampler2DMSArray)
+0:?     'p2' (flat in 2-component vector of int)
+0:?     'p3' (flat in 3-component vector of int)
+0:?     'samp' (flat in int)
 
 
 Linked fragment stage:
@@ -50,10 +137,98 @@ ERROR: node is still EOpNull!
 0:18      'patch' (float)
 0:18      Constant:
 0:18        3.100000
+0:31  Function Definition: barWxyz( (void)
+0:31    Function Parameters: 
+0:33    Sequence
+0:33      Sequence
+0:33        move second child to first child (2-component vector of int)
+0:33          't11' (2-component vector of int)
+0:33          Function Call: textureSize(s21; (2-component vector of int)
+0:33            'sms' (uniform sampler2DMS)
+0:34      Sequence
+0:34        move second child to first child (2-component vector of int)
+0:34          't12' (2-component vector of int)
+0:34          Function Call: textureSize(is21; (2-component vector of int)
+0:34            'isms' (uniform isampler2DMS)
+0:35      Sequence
+0:35        move second child to first child (2-component vector of int)
+0:35          't13' (2-component vector of int)
+0:35          Function Call: textureSize(us21; (2-component vector of int)
+0:35            'usms' (uniform usampler2DMS)
+0:36      Sequence
+0:36        move second child to first child (3-component vector of int)
+0:36          't21' (3-component vector of int)
+0:36          Function Call: textureSize(sA21; (3-component vector of int)
+0:36            'smsa' (uniform sampler2DMSArray)
+0:37      Sequence
+0:37        move second child to first child (3-component vector of int)
+0:37          't22' (3-component vector of int)
+0:37          Function Call: textureSize(isA21; (3-component vector of int)
+0:37            'ismsa' (uniform isampler2DMSArray)
+0:38      Sequence
+0:38        move second child to first child (3-component vector of int)
+0:38          't23' (3-component vector of int)
+0:38          Function Call: textureSize(usA21; (3-component vector of int)
+0:38            'usmsa' (uniform usampler2DMSArray)
+0:39      Sequence
+0:39        move second child to first child (4-component vector of float)
+0:39          't31' (4-component vector of float)
+0:39          Function Call: texelFetch(s21;vi2;i1; (4-component vector of float)
+0:39            'sms' (uniform sampler2DMS)
+0:39            'p2' (flat in 2-component vector of int)
+0:39            'samp' (flat in int)
+0:40      Sequence
+0:40        move second child to first child (4-component vector of int)
+0:40          't32' (4-component vector of int)
+0:40          Function Call: texelFetch(is21;vi2;i1; (4-component vector of int)
+0:40            'isms' (uniform isampler2DMS)
+0:40            'p2' (flat in 2-component vector of int)
+0:40            'samp' (flat in int)
+0:41      Sequence
+0:41        move second child to first child (4-component vector of uint)
+0:41          't33' (4-component vector of uint)
+0:41          Function Call: texelFetch(us21;vi2;i1; (4-component vector of uint)
+0:41            'usms' (uniform usampler2DMS)
+0:41            'p2' (flat in 2-component vector of int)
+0:41            Constant:
+0:41              3 (const int)
+0:42      Sequence
+0:42        move second child to first child (4-component vector of float)
+0:42          't41' (4-component vector of float)
+0:42          Function Call: texelFetch(sA21;vi3;i1; (4-component vector of float)
+0:42            'smsa' (uniform sampler2DMSArray)
+0:42            'p3' (flat in 3-component vector of int)
+0:42            'samp' (flat in int)
+0:43      Sequence
+0:43        move second child to first child (4-component vector of int)
+0:43          't42' (4-component vector of int)
+0:43          Function Call: texelFetch(isA21;vi3;i1; (4-component vector of int)
+0:43            'ismsa' (uniform isampler2DMSArray)
+0:43            Constant:
+0:43              2 (const int)
+0:43              2 (const int)
+0:43              2 (const int)
+0:43            'samp' (flat in int)
+0:44      Sequence
+0:44        move second child to first child (4-component vector of uint)
+0:44          't43' (4-component vector of uint)
+0:44          Function Call: texelFetch(usA21;vi3;i1; (4-component vector of uint)
+0:44            'usmsa' (uniform usampler2DMSArray)
+0:44            'p3' (flat in 3-component vector of int)
+0:44            'samp' (flat in int)
 0:?   Linker Objects
 0:?     'gl_FragCoord' (gl_FragCoord 4-component vector of float)
 0:?     'gl_FragCoord' (gl_FragCoord 4-component vector of float)
 0:?     'foo' (smooth in 4-component vector of float)
 0:?     's' (smooth in structure{float f})
 0:?     'patch' (float)
+0:?     'sms' (uniform sampler2DMS)
+0:?     'isms' (uniform isampler2DMS)
+0:?     'usms' (uniform usampler2DMS)
+0:?     'smsa' (uniform sampler2DMSArray)
+0:?     'ismsa' (uniform isampler2DMSArray)
+0:?     'usmsa' (uniform usampler2DMSArray)
+0:?     'p2' (flat in 2-component vector of int)
+0:?     'p3' (flat in 3-component vector of int)
+0:?     'samp' (flat in int)
 
diff --git a/Test/baseResults/150.geom.out b/Test/baseResults/150.geom.out
index 8646ebfce..abda93b71 100644
--- a/Test/baseResults/150.geom.out
+++ b/Test/baseResults/150.geom.out
@@ -1,5 +1,4 @@
 150.geom
-Warning, version 150 is not yet complete; most version-specific features are present, but some are missing.
 ERROR: 0:15: 'fromVertex' : block instance name redefinition 
 ERROR: 0:19: 'fromVertex' : redefinition 
 ERROR: 0:21: 'fooC' : block instance name redefinition 
diff --git a/Test/baseResults/150.tesc.out b/Test/baseResults/150.tesc.out
index 6de33cb99..35c0848dd 100644
--- a/Test/baseResults/150.tesc.out
+++ b/Test/baseResults/150.tesc.out
@@ -1,5 +1,4 @@
 150.tesc
-Warning, version 150 is not yet complete; most version-specific features are present, but some are missing.
 
 Shader version: 150
 Requested GL_ARB_tessellation_shader
@@ -109,7 +108,6 @@ vertices = 4
 0:?     'patchOut' (patch out 4-component vector of float)
 
 150.tese
-Warning, version 150 is not yet complete; most version-specific features are present, but some are missing.
 ERROR: 0:12: 'barrier' : no matching overloaded function found 
 ERROR: 1 compilation errors.  No code generated.
 
diff --git a/Test/baseResults/150.vert.out b/Test/baseResults/150.vert.out
index 2db24a708..85f7e43b1 100644
--- a/Test/baseResults/150.vert.out
+++ b/Test/baseResults/150.vert.out
@@ -1,5 +1,4 @@
 150.vert
-Warning, version 150 is not yet complete; most version-specific features are present, but some are missing.
 ERROR: 0:22: 'a' : cannot redeclare a user-block member array 
 ERROR: 1 compilation errors.  No code generated.
 
diff --git a/Test/baseResults/mains1.frag.out b/Test/baseResults/mains1.frag.out
index caac12aad..8b2532266 100644
--- a/Test/baseResults/mains1.frag.out
+++ b/Test/baseResults/mains1.frag.out
@@ -16,7 +16,6 @@ Shader version: 110
 
 noMain1.geom
 ERROR: #version: geometry shaders require non-es profile and version 150 or above
-Warning, version 150 is not yet complete; most version-specific features are present, but some are missing.
 ERROR: 1 compilation errors.  No code generated.
 
 
@@ -31,7 +30,6 @@ ERROR: node is still EOpNull!
 0:?   Linker Objects
 
 noMain2.geom
-Warning, version 150 is not yet complete; most version-specific features are present, but some are missing.
 
 Shader version: 150
 invocations = 0
diff --git a/Test/baseResults/matrix2.frag.out b/Test/baseResults/matrix2.frag.out
index 02ce43fb8..54f40ef49 100644
--- a/Test/baseResults/matrix2.frag.out
+++ b/Test/baseResults/matrix2.frag.out
@@ -1,5 +1,4 @@
 ../../LunarGLASS/test/matrix2.frag
-Warning, version 150 is not yet complete; most version-specific features are present, but some are missing.
 WARNING: 0:4: varying deprecated in version 130; may be removed in future release
 WARNING: 0:13: varying deprecated in version 130; may be removed in future release
 WARNING: 0:15: varying deprecated in version 130; may be removed in future release
diff --git a/Test/baseResults/simpleFunctionCall.frag.out b/Test/baseResults/simpleFunctionCall.frag.out
index fa432697d..b479fea68 100644
--- a/Test/baseResults/simpleFunctionCall.frag.out
+++ b/Test/baseResults/simpleFunctionCall.frag.out
@@ -1,5 +1,4 @@
 ../../LunarGLASS/test/simpleFunctionCall.frag
-Warning, version 150 is not yet complete; most version-specific features are present, but some are missing.
 WARNING: 0:4: varying deprecated in version 130; may be removed in future release
 
 Shader version: 150
diff --git a/Todo.txt b/Todo.txt
index 68ab159ab..f8aff2409 100644
--- a/Todo.txt
+++ b/Todo.txt
@@ -1,4 +1,4 @@
-Current functionality level: ESSL 3.0
+Current functionality level: ESSL 3.0, GLSL 1.5
 
 + create version system
 
@@ -91,13 +91,13 @@ Shader Functionality to Implement/Finish
         + Fixed functionality for a programmable stage. 
         + ftransform().  Use invariant outputs instead.
     GLSL 1.5 (Non-ES)
-      - Deprecated gl_MaxVaryingComponents
+      + Deprecated gl_MaxVaryingComponents
       + Add new minimum maximums for gl_MaxVertexOutputComponents, gl_MaxGeometryInputComponents, gl_MaxGeometryOutputComponents, and gl_MaxFragmentInputComponents, 
                 rather than relying on gl_MaxVaryingComponents.  Also, corrected gl_MaxVaryingComponents to be 60 instead of 64.
       + Added gl_PrimitiveID as an input to fragment shaders.
       + Added gl_FragCoord qualifiers origin_upper_left, and pixel_center_integer to modify the values returned by gl_FragCoord (and have no affect on any other aspect of the pipeline or language).
         + including redeclaration of gl_FragCoord that adds nothing
-      - Added support for multi-sample textures through sampler2DMS and sampler2DMSArray support in texelFetch() and textureSize().
+      + Added support for multi-sample textures through sampler2DMS and sampler2DMSArray support in texelFetch() and textureSize().
       + Broadened interface blocks from just uniforms to in and out interfaces as well.
       + Broaden array usage to include vertex shader inputs (vertex in).
       + Added geometry shaders.  This includes targeting layers in FBO rendering.
diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp
index fb62f4e1c..9e01cdfec 100644
--- a/glslang/MachineIndependent/Initialize.cpp
+++ b/glslang/MachineIndependent/Initialize.cpp
@@ -1423,7 +1423,7 @@ void TBuiltIns::initialize(int version, EProfile profile)
     if (version >= 130)
         add2ndGenerationSamplingImaging(version, profile);
 
-    //printf("%s\n", commonBuiltins.c_str();
+    // printf("%s\n", commonBuiltins.c_str());
 }
 
 //
@@ -1914,8 +1914,10 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
         snprintf(builtInConstant, maxSize, "const int  gl_MaxVertexUniformComponents = %d;", resources.maxVertexUniformComponents);
         s.append(builtInConstant);
 
-        snprintf(builtInConstant, maxSize, "const int  gl_MaxVaryingFloats = %d;", resources.maxVaryingFloats);
-        s.append(builtInConstant);
+        if (version < 150 || ARBCompatibility) {
+            snprintf(builtInConstant, maxSize, "const int  gl_MaxVaryingFloats = %d;", resources.maxVaryingFloats);
+            s.append(builtInConstant);
+        }
 
         snprintf(builtInConstant, maxSize, "const int  gl_MaxFragmentUniformComponents = %d;", resources.maxFragmentUniformComponents);
         s.append(builtInConstant);
diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp
index 62ff0c5ce..f02e12040 100644
--- a/glslang/MachineIndependent/Intermediate.cpp
+++ b/glslang/MachineIndependent/Intermediate.cpp
@@ -368,7 +368,7 @@ TIntermTyped* TIntermediate::setAggregateOperator(TIntermNode* node, TOperator o
 }
 
 //
-// Convert the node's type to the given type, as allowed by the operation involved 'op'.
+// Convert the node's type to the given type, as allowed by the operation involved: 'op'.
 // For implicit conversions, 'op' is not the requested conversion, it is the explicit 
 // operation requiring the implicit conversion.
 //
@@ -384,9 +384,13 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
     //
     switch (node->getBasicType()) {
     case EbtVoid:
-    case EbtSampler:
         return 0;
-    default: break;
+    case EbtSampler:
+        if (op != EOpFunctionCall)
+            return 0;
+        break;
+    default:
+        break;
     }
 
     //
@@ -450,6 +454,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
     case EOpMatrixTimesVector:
     case EOpMatrixTimesScalar:
 
+    case EOpFunctionCall:
     case EOpAssign:
     case EOpAddAssign:
     case EOpSubAssign:
diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp
index 3fcdbaf72..070eb3545 100644
--- a/glslang/MachineIndependent/ParseHelper.cpp
+++ b/glslang/MachineIndependent/ParseHelper.cpp
@@ -1078,11 +1078,13 @@ void TParseContext::addInputArgumentConversions(const TFunction& function, TInte
             if (function[i].type->getQualifier().isParamInput()) {
                 // In-qualified arguments just need an extra node added above the argument to
                 // convert to the correct type.
-                arg = intermediate.addConversion(EOpAssign, *function[i].type, arg);
-                if (aggregate)
-                    aggregate->getSequence()[i] = arg;
-                else
-                    arguments = arg;
+                arg = intermediate.addConversion(EOpFunctionCall, *function[i].type, arg);
+                if (arg) {
+                    if (aggregate)
+                        aggregate->getSequence()[i] = arg;
+                    else
+                        arguments = arg;
+                }
             }
         }
     }
diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp
index e307b75dd..943ede00d 100644
--- a/glslang/MachineIndependent/ShaderLang.cpp
+++ b/glslang/MachineIndependent/ShaderLang.cpp
@@ -377,17 +377,24 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
         infoSink.info.message(EPrefixError, "#version: statement must appear first in es-profile shader; before comments or newlines");
     }
 
-    // A metecheck on the condition of the compiler itself...
+    // A metacheck on the condition of the compiler itself...
     switch (version) {
+
+    // ES versions
     case 100:
     case 300:
+        // versions are complete
+        break;
 
+    // Desktop versions
     case 110:
     case 120:
     case 130:
     case 140:
+    case 150:
         // versions are complete
         break;
+
     default:
         infoSink.info << "Warning, version " << version << " is not yet complete; most version-specific features are present, but some are missing.\n";
         break;
diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y
index f4dc901f6..a2157bcb1 100644
--- a/glslang/MachineIndependent/glslang.y
+++ b/glslang/MachineIndependent/glslang.y
@@ -1679,7 +1679,7 @@ type_specifier_nonarray
     | ISAMPLERCUBEARRAY {
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, Esd3D, true);
+        $$.sampler.set(EbtInt, EsdCube, true);
     }
     | USAMPLER1D {
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-- 
GitLab