From 6373574b134a1ef2e1d2cced8c9abb371543bb38 Mon Sep 17 00:00:00 2001
From: John Kessenich <cepheus@frii.com>
Date: Thu, 1 Oct 2015 12:40:48 -0600
Subject: [PATCH] Front-end: Fix: Cubemap arrays only use 3-component coord
 when accessed as an image.

4 components are needed when used a texture, but not an image, which multiplies
layers and faces into the same coordinate.  This fixes it from using 4 everywhere,
to only using 4 for textures and 3 for images.
---
 Test/310.vert                             |   12 +
 Test/baseResults/310.vert.out             | 1248 +++++++++++----------
 Test/baseResults/spv.image.frag.out       |  499 ++++----
 Test/spv.image.frag                       |    4 +-
 glslang/Include/revision.h                |    4 +-
 glslang/MachineIndependent/Initialize.cpp |    6 +-
 6 files changed, 940 insertions(+), 833 deletions(-)

diff --git a/Test/310.vert b/Test/310.vert
index 3ea0e6d92..1782938ed 100644
--- a/Test/310.vert
+++ b/Test/310.vert
@@ -265,6 +265,10 @@ uniform writeonly imageCubeArray  CA1;
 uniform writeonly iimageCubeArray CA2;
 uniform writeonly uimageCubeArray CA3;
 
+layout(rgba16f) uniform readonly imageCubeArray  rCA1;
+layout(rgba32i) uniform readonly iimageCubeArray rCA2;
+layout(r32ui) uniform readonly uimageCubeArray rCA3;
+
 #ifdef GL_OES_texture_cube_map_array
 uniform samplerCubeArray          CA4;
 uniform samplerCubeArrayShadow    CA5;
@@ -304,6 +308,14 @@ void CAT()
     highp ivec3 s1 = imageSize(CA1);
     highp ivec3 s2 = imageSize(CA2);
     highp ivec3 s3 = imageSize(CA3);
+
+    imageStore(CA1, s3, vec4(1));
+    imageStore(CA2, s3, ivec4(1));
+    imageStore(CA3, s3, uvec4(1));
+
+    highp vec4 cl1 = imageLoad(rCA1, s3);
+    highp ivec4 cl2 = imageLoad(rCA2, s3);
+    highp uvec4 cl3 = imageLoad(rCA3, s3);
 }
 
 uniform sampler2DMSArray  bad2DMS;    // ERROR, reserved
diff --git a/Test/baseResults/310.vert.out b/Test/baseResults/310.vert.out
index c03ee82bb..95770ced5 100644
--- a/Test/baseResults/310.vert.out
+++ b/Test/baseResults/310.vert.out
@@ -79,21 +79,21 @@ ERROR: 0:250: 'sampler/image' : type requires declaration of default precision q
 ERROR: 0:251: 'sampler/image' : type requires declaration of default precision qualifier 
 ERROR: 0:252: 'sampler/image' : type requires declaration of default precision qualifier 
 ERROR: 0:253: 'sampler/image' : type requires declaration of default precision qualifier 
-ERROR: 0:309: 'sampler2DMSArray' : Reserved word. 
-ERROR: 0:309: 'sampler/image' : type requires declaration of default precision qualifier 
-ERROR: 0:310: 'isampler2DMSArray' : Reserved word. 
-ERROR: 0:310: 'sampler/image' : type requires declaration of default precision qualifier 
-ERROR: 0:311: 'usampler2DMSArray' : Reserved word. 
-ERROR: 0:311: 'sampler/image' : type requires declaration of default precision qualifier 
-ERROR: 0:317: 'sampler/image' : type requires declaration of default precision qualifier 
-ERROR: 0:318: 'sampler/image' : type requires declaration of default precision qualifier 
-ERROR: 0:319: 'sampler/image' : type requires declaration of default precision qualifier 
-ERROR: 0:339: 'textureSize' : no matching overloaded function found 
-ERROR: 0:339: '=' :  cannot convert from 'const float' to 'temp highp 3-component vector of int'
-ERROR: 0:377: 'sample' : Reserved word. 
-ERROR: 0:388: 'interpolateAtCentroid' : no matching overloaded function found 
-ERROR: 0:389: 'interpolateAtSample' : no matching overloaded function found 
-ERROR: 0:390: 'interpolateAtOffset' : no matching overloaded function found 
+ERROR: 0:321: 'sampler2DMSArray' : Reserved word. 
+ERROR: 0:321: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:322: 'isampler2DMSArray' : Reserved word. 
+ERROR: 0:322: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:323: 'usampler2DMSArray' : Reserved word. 
+ERROR: 0:323: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:329: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:330: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:331: 'sampler/image' : type requires declaration of default precision qualifier 
+ERROR: 0:351: 'textureSize' : no matching overloaded function found 
+ERROR: 0:351: '=' :  cannot convert from 'const float' to 'temp highp 3-component vector of int'
+ERROR: 0:389: 'sample' : Reserved word. 
+ERROR: 0:400: 'interpolateAtCentroid' : no matching overloaded function found 
+ERROR: 0:401: 'interpolateAtSample' : no matching overloaded function found 
+ERROR: 0:402: 'interpolateAtOffset' : no matching overloaded function found 
 ERROR: 90 compilation errors.  No code generated.
 
 
@@ -475,119 +475,83 @@ ERROR: node is still EOpNull!
 0:232          textureFetch (global highp 4-component vector of uint)
 0:232            'bufSamp3' (uniform highp usamplerBuffer)
 0:232            's3' (temp highp int)
-0:275  Function Definition: CAT( (global void)
-0:275    Function Parameters: 
-0:277    Sequence
-0:277      Sequence
-0:277        move second child to first child (temp highp 3-component vector of int)
-0:277          's4' (temp highp 3-component vector of int)
-0:277          textureSize (global highp 3-component vector of int)
-0:277            'CA4' (uniform highp samplerCubeArray)
-0:277            Constant:
-0:277              1 (const int)
-0:278      Sequence
-0:278        move second child to first child (temp highp 3-component vector of int)
-0:278          's5' (temp highp 3-component vector of int)
-0:278          textureSize (global highp 3-component vector of int)
-0:278            'CA5' (uniform highp samplerCubeArrayShadow)
-0:278            Constant:
-0:278              1 (const int)
-0:279      Sequence
-0:279        move second child to first child (temp highp 3-component vector of int)
-0:279          's6' (temp highp 3-component vector of int)
-0:279          textureSize (global highp 3-component vector of int)
-0:279            'CA6' (uniform highp isamplerCubeArray)
-0:279            Constant:
-0:279              1 (const int)
-0:280      Sequence
-0:280        move second child to first child (temp highp 3-component vector of int)
-0:280          's7' (temp highp 3-component vector of int)
-0:280          textureSize (global highp 3-component vector of int)
-0:280            'CA7' (uniform highp usamplerCubeArray)
-0:280            Constant:
-0:280              1 (const int)
+0:279  Function Definition: CAT( (global void)
+0:279    Function Parameters: 
+0:281    Sequence
+0:281      Sequence
+0:281        move second child to first child (temp highp 3-component vector of int)
+0:281          's4' (temp highp 3-component vector of int)
+0:281          textureSize (global highp 3-component vector of int)
+0:281            'CA4' (uniform highp samplerCubeArray)
+0:281            Constant:
+0:281              1 (const int)
 0:282      Sequence
-0:282        move second child to first child (temp highp 4-component vector of float)
-0:282          't4' (temp highp 4-component vector of float)
-0:282          texture (global highp 4-component vector of float)
-0:282            'CA4' (uniform highp samplerCubeArray)
+0:282        move second child to first child (temp highp 3-component vector of int)
+0:282          's5' (temp highp 3-component vector of int)
+0:282          textureSize (global highp 3-component vector of int)
+0:282            'CA5' (uniform highp samplerCubeArrayShadow)
 0:282            Constant:
-0:282              0.500000
-0:282              0.500000
-0:282              0.500000
-0:282              0.500000
+0:282              1 (const int)
 0:283      Sequence
-0:283        move second child to first child (temp highp float)
-0:283          't5' (temp highp float)
-0:283          texture (global highp float)
-0:283            'CA5' (uniform highp samplerCubeArrayShadow)
+0:283        move second child to first child (temp highp 3-component vector of int)
+0:283          's6' (temp highp 3-component vector of int)
+0:283          textureSize (global highp 3-component vector of int)
+0:283            'CA6' (uniform highp isamplerCubeArray)
 0:283            Constant:
-0:283              0.500000
-0:283              0.500000
-0:283              0.500000
-0:283              0.500000
-0:283            Constant:
-0:283              3.000000
+0:283              1 (const int)
 0:284      Sequence
-0:284        move second child to first child (temp highp 4-component vector of int)
-0:284          't6' (temp highp 4-component vector of int)
-0:284          texture (global highp 4-component vector of int)
-0:284            'CA6' (uniform highp isamplerCubeArray)
+0:284        move second child to first child (temp highp 3-component vector of int)
+0:284          's7' (temp highp 3-component vector of int)
+0:284          textureSize (global highp 3-component vector of int)
+0:284            'CA7' (uniform highp usamplerCubeArray)
 0:284            Constant:
-0:284              0.500000
-0:284              0.500000
-0:284              0.500000
-0:284              0.500000
-0:285      Sequence
-0:285        move second child to first child (temp highp 4-component vector of uint)
-0:285          't7' (temp highp 4-component vector of uint)
-0:285          texture (global highp 4-component vector of uint)
-0:285            'CA7' (uniform highp usamplerCubeArray)
-0:285            Constant:
-0:285              0.500000
-0:285              0.500000
-0:285              0.500000
-0:285              0.500000
+0:284              1 (const int)
+0:286      Sequence
+0:286        move second child to first child (temp highp 4-component vector of float)
+0:286          't4' (temp highp 4-component vector of float)
+0:286          texture (global highp 4-component vector of float)
+0:286            'CA4' (uniform highp samplerCubeArray)
+0:286            Constant:
+0:286              0.500000
+0:286              0.500000
+0:286              0.500000
+0:286              0.500000
 0:287      Sequence
-0:287        move second child to first child (temp highp 4-component vector of float)
-0:287          'L4' (temp highp 4-component vector of float)
-0:287          textureLod (global highp 4-component vector of float)
-0:287            'CA4' (uniform highp samplerCubeArray)
+0:287        move second child to first child (temp highp float)
+0:287          't5' (temp highp float)
+0:287          texture (global highp float)
+0:287            'CA5' (uniform highp samplerCubeArrayShadow)
 0:287            Constant:
 0:287              0.500000
 0:287              0.500000
 0:287              0.500000
 0:287              0.500000
 0:287            Constant:
-0:287              0.240000
+0:287              3.000000
 0:288      Sequence
 0:288        move second child to first child (temp highp 4-component vector of int)
-0:288          'L6' (temp highp 4-component vector of int)
-0:288          textureLod (global highp 4-component vector of int)
+0:288          't6' (temp highp 4-component vector of int)
+0:288          texture (global highp 4-component vector of int)
 0:288            'CA6' (uniform highp isamplerCubeArray)
 0:288            Constant:
 0:288              0.500000
 0:288              0.500000
 0:288              0.500000
 0:288              0.500000
-0:288            Constant:
-0:288              0.260000
 0:289      Sequence
 0:289        move second child to first child (temp highp 4-component vector of uint)
-0:289          'L7' (temp highp 4-component vector of uint)
-0:289          textureLod (global highp 4-component vector of uint)
+0:289          't7' (temp highp 4-component vector of uint)
+0:289          texture (global highp 4-component vector of uint)
 0:289            'CA7' (uniform highp usamplerCubeArray)
 0:289            Constant:
 0:289              0.500000
 0:289              0.500000
 0:289              0.500000
 0:289              0.500000
-0:289            Constant:
-0:289              0.270000
 0:291      Sequence
 0:291        move second child to first child (temp highp 4-component vector of float)
-0:291          'g4' (temp highp 4-component vector of float)
-0:291          textureGrad (global highp 4-component vector of float)
+0:291          'L4' (temp highp 4-component vector of float)
+0:291          textureLod (global highp 4-component vector of float)
 0:291            'CA4' (uniform highp samplerCubeArray)
 0:291            Constant:
 0:291              0.500000
@@ -595,17 +559,11 @@ ERROR: node is still EOpNull!
 0:291              0.500000
 0:291              0.500000
 0:291            Constant:
-0:291              0.100000
-0:291              0.100000
-0:291              0.100000
-0:291            Constant:
-0:291              0.200000
-0:291              0.200000
-0:291              0.200000
+0:291              0.240000
 0:292      Sequence
 0:292        move second child to first child (temp highp 4-component vector of int)
-0:292          'g6' (temp highp 4-component vector of int)
-0:292          textureGrad (global highp 4-component vector of int)
+0:292          'L6' (temp highp 4-component vector of int)
+0:292          textureLod (global highp 4-component vector of int)
 0:292            'CA6' (uniform highp isamplerCubeArray)
 0:292            Constant:
 0:292              0.500000
@@ -613,17 +571,11 @@ ERROR: node is still EOpNull!
 0:292              0.500000
 0:292              0.500000
 0:292            Constant:
-0:292              0.100000
-0:292              0.100000
-0:292              0.100000
-0:292            Constant:
-0:292              0.200000
-0:292              0.200000
-0:292              0.200000
+0:292              0.260000
 0:293      Sequence
 0:293        move second child to first child (temp highp 4-component vector of uint)
-0:293          'g7' (temp highp 4-component vector of uint)
-0:293          textureGrad (global highp 4-component vector of uint)
+0:293          'L7' (temp highp 4-component vector of uint)
+0:293          textureLod (global highp 4-component vector of uint)
 0:293            'CA7' (uniform highp usamplerCubeArray)
 0:293            Constant:
 0:293              0.500000
@@ -631,241 +583,331 @@ ERROR: node is still EOpNull!
 0:293              0.500000
 0:293              0.500000
 0:293            Constant:
-0:293              0.100000
-0:293              0.100000
-0:293              0.100000
-0:293            Constant:
-0:293              0.200000
-0:293              0.200000
-0:293              0.200000
+0:293              0.270000
 0:295      Sequence
 0:295        move second child to first child (temp highp 4-component vector of float)
-0:295          'gath4' (temp highp 4-component vector of float)
-0:295          textureGather (global highp 4-component vector of float)
+0:295          'g4' (temp highp 4-component vector of float)
+0:295          textureGrad (global highp 4-component vector of float)
 0:295            'CA4' (uniform highp samplerCubeArray)
 0:295            Constant:
 0:295              0.500000
 0:295              0.500000
 0:295              0.500000
 0:295              0.500000
+0:295            Constant:
+0:295              0.100000
+0:295              0.100000
+0:295              0.100000
+0:295            Constant:
+0:295              0.200000
+0:295              0.200000
+0:295              0.200000
 0:296      Sequence
-0:296        move second child to first child (temp highp 4-component vector of float)
-0:296          'gathC4' (temp highp 4-component vector of float)
-0:296          textureGather (global highp 4-component vector of float)
-0:296            'CA4' (uniform highp samplerCubeArray)
+0:296        move second child to first child (temp highp 4-component vector of int)
+0:296          'g6' (temp highp 4-component vector of int)
+0:296          textureGrad (global highp 4-component vector of int)
+0:296            'CA6' (uniform highp isamplerCubeArray)
 0:296            Constant:
 0:296              0.500000
 0:296              0.500000
 0:296              0.500000
 0:296              0.500000
 0:296            Constant:
-0:296              2 (const int)
+0:296              0.100000
+0:296              0.100000
+0:296              0.100000
+0:296            Constant:
+0:296              0.200000
+0:296              0.200000
+0:296              0.200000
 0:297      Sequence
-0:297        move second child to first child (temp highp 4-component vector of int)
-0:297          'gath6' (temp highp 4-component vector of int)
-0:297          textureGather (global highp 4-component vector of int)
-0:297            'CA6' (uniform highp isamplerCubeArray)
+0:297        move second child to first child (temp highp 4-component vector of uint)
+0:297          'g7' (temp highp 4-component vector of uint)
+0:297          textureGrad (global highp 4-component vector of uint)
+0:297            'CA7' (uniform highp usamplerCubeArray)
 0:297            Constant:
 0:297              0.500000
 0:297              0.500000
 0:297              0.500000
 0:297              0.500000
-0:298      Sequence
-0:298        move second child to first child (temp highp 4-component vector of int)
-0:298          'gathC6' (temp highp 4-component vector of int)
-0:298          textureGather (global highp 4-component vector of int)
-0:298            'CA6' (uniform highp isamplerCubeArray)
-0:298            Constant:
-0:298              0.500000
-0:298              0.500000
-0:298              0.500000
-0:298              0.500000
-0:298            Constant:
-0:298              1 (const int)
+0:297            Constant:
+0:297              0.100000
+0:297              0.100000
+0:297              0.100000
+0:297            Constant:
+0:297              0.200000
+0:297              0.200000
+0:297              0.200000
 0:299      Sequence
-0:299        move second child to first child (temp highp 4-component vector of uint)
-0:299          'gath7' (temp highp 4-component vector of uint)
-0:299          textureGather (global highp 4-component vector of uint)
-0:299            'CA7' (uniform highp usamplerCubeArray)
+0:299        move second child to first child (temp highp 4-component vector of float)
+0:299          'gath4' (temp highp 4-component vector of float)
+0:299          textureGather (global highp 4-component vector of float)
+0:299            'CA4' (uniform highp samplerCubeArray)
 0:299            Constant:
 0:299              0.500000
 0:299              0.500000
 0:299              0.500000
 0:299              0.500000
 0:300      Sequence
-0:300        move second child to first child (temp highp 4-component vector of uint)
-0:300          'gathC7' (temp highp 4-component vector of uint)
-0:300          textureGather (global highp 4-component vector of uint)
-0:300            'CA7' (uniform highp usamplerCubeArray)
+0:300        move second child to first child (temp highp 4-component vector of float)
+0:300          'gathC4' (temp highp 4-component vector of float)
+0:300          textureGather (global highp 4-component vector of float)
+0:300            'CA4' (uniform highp samplerCubeArray)
 0:300            Constant:
 0:300              0.500000
 0:300              0.500000
 0:300              0.500000
 0:300              0.500000
 0:300            Constant:
-0:300              0 (const int)
+0:300              2 (const int)
+0:301      Sequence
+0:301        move second child to first child (temp highp 4-component vector of int)
+0:301          'gath6' (temp highp 4-component vector of int)
+0:301          textureGather (global highp 4-component vector of int)
+0:301            'CA6' (uniform highp isamplerCubeArray)
+0:301            Constant:
+0:301              0.500000
+0:301              0.500000
+0:301              0.500000
+0:301              0.500000
 0:302      Sequence
-0:302        move second child to first child (temp highp 4-component vector of float)
-0:302          'gath5' (temp highp 4-component vector of float)
-0:302          textureGather (global highp 4-component vector of float)
-0:302            'CA5' (uniform highp samplerCubeArrayShadow)
+0:302        move second child to first child (temp highp 4-component vector of int)
+0:302          'gathC6' (temp highp 4-component vector of int)
+0:302          textureGather (global highp 4-component vector of int)
+0:302            'CA6' (uniform highp isamplerCubeArray)
 0:302            Constant:
 0:302              0.500000
 0:302              0.500000
 0:302              0.500000
 0:302              0.500000
 0:302            Constant:
-0:302              2.500000
+0:302              1 (const int)
+0:303      Sequence
+0:303        move second child to first child (temp highp 4-component vector of uint)
+0:303          'gath7' (temp highp 4-component vector of uint)
+0:303          textureGather (global highp 4-component vector of uint)
+0:303            'CA7' (uniform highp usamplerCubeArray)
+0:303            Constant:
+0:303              0.500000
+0:303              0.500000
+0:303              0.500000
+0:303              0.500000
 0:304      Sequence
-0:304        move second child to first child (temp highp 3-component vector of int)
-0:304          's1' (temp highp 3-component vector of int)
-0:304          imageQuerySize (global highp 3-component vector of int)
-0:304            'CA1' (writeonly uniform highp imageCubeArray)
-0:305      Sequence
-0:305        move second child to first child (temp highp 3-component vector of int)
-0:305          's2' (temp highp 3-component vector of int)
-0:305          imageQuerySize (global highp 3-component vector of int)
-0:305            'CA2' (writeonly uniform highp iimageCubeArray)
+0:304        move second child to first child (temp highp 4-component vector of uint)
+0:304          'gathC7' (temp highp 4-component vector of uint)
+0:304          textureGather (global highp 4-component vector of uint)
+0:304            'CA7' (uniform highp usamplerCubeArray)
+0:304            Constant:
+0:304              0.500000
+0:304              0.500000
+0:304              0.500000
+0:304              0.500000
+0:304            Constant:
+0:304              0 (const int)
 0:306      Sequence
-0:306        move second child to first child (temp highp 3-component vector of int)
-0:306          's3' (temp highp 3-component vector of int)
-0:306          imageQuerySize (global highp 3-component vector of int)
-0:306            'CA3' (writeonly uniform highp uimageCubeArray)
-0:331  Function Definition: MSA( (global void)
-0:331    Function Parameters: 
-0:333    Sequence
-0:333      Sequence
-0:333        move second child to first child (temp highp 4-component vector of float)
-0:333          'tf' (temp highp 4-component vector of float)
-0:333          textureFetch (global highp 4-component vector of float)
-0:333            'samp2DMSA' (uniform highp sampler2DMSArray)
-0:333            Constant:
-0:333              5 (const int)
-0:333              5 (const int)
-0:333              5 (const int)
-0:333            Constant:
-0:333              2 (const int)
-0:334      Sequence
-0:334        move second child to first child (temp highp 4-component vector of int)
-0:334          'tfi' (temp highp 4-component vector of int)
-0:334          textureFetch (global highp 4-component vector of int)
-0:334            'samp2DMSAi' (uniform highp isampler2DMSArray)
-0:334            Constant:
-0:334              5 (const int)
-0:334              5 (const int)
-0:334              5 (const int)
-0:334            Constant:
-0:334              2 (const int)
-0:335      Sequence
-0:335        move second child to first child (temp highp 4-component vector of uint)
-0:335          'tfu' (temp highp 4-component vector of uint)
-0:335          textureFetch (global highp 4-component vector of uint)
-0:335            'samp2DMSAu' (uniform highp usampler2DMSArray)
-0:335            Constant:
-0:335              5 (const int)
-0:335              5 (const int)
-0:335              5 (const int)
-0:335            Constant:
-0:335              2 (const int)
-0:337      Sequence
-0:337        move second child to first child (temp highp 3-component vector of int)
-0:337          'tfs' (temp highp 3-component vector of int)
-0:337          textureSize (global highp 3-component vector of int)
-0:337            'samp2DMSA' (uniform highp sampler2DMSArray)
-0:338      Sequence
-0:338        move second child to first child (temp highp 3-component vector of int)
-0:338          'tfsi' (temp highp 3-component vector of int)
-0:338          textureSize (global highp 3-component vector of int)
-0:338            'samp2DMSAi' (uniform highp isampler2DMSArray)
-0:340      Sequence
-0:340        move second child to first child (temp highp 3-component vector of int)
-0:340          'tfsu' (temp highp 3-component vector of int)
-0:340          textureSize (global highp 3-component vector of int)
-0:340            'samp2DMSAu' (uniform highp usampler2DMSArray)
-0:352  Function Definition: goodImageAtom( (global void)
-0:352    Function Parameters: 
+0:306        move second child to first child (temp highp 4-component vector of float)
+0:306          'gath5' (temp highp 4-component vector of float)
+0:306          textureGather (global highp 4-component vector of float)
+0:306            'CA5' (uniform highp samplerCubeArrayShadow)
+0:306            Constant:
+0:306              0.500000
+0:306              0.500000
+0:306              0.500000
+0:306              0.500000
+0:306            Constant:
+0:306              2.500000
+0:308      Sequence
+0:308        move second child to first child (temp highp 3-component vector of int)
+0:308          's1' (temp highp 3-component vector of int)
+0:308          imageQuerySize (global highp 3-component vector of int)
+0:308            'CA1' (writeonly uniform highp imageCubeArray)
+0:309      Sequence
+0:309        move second child to first child (temp highp 3-component vector of int)
+0:309          's2' (temp highp 3-component vector of int)
+0:309          imageQuerySize (global highp 3-component vector of int)
+0:309            'CA2' (writeonly uniform highp iimageCubeArray)
+0:310      Sequence
+0:310        move second child to first child (temp highp 3-component vector of int)
+0:310          's3' (temp highp 3-component vector of int)
+0:310          imageQuerySize (global highp 3-component vector of int)
+0:310            'CA3' (writeonly uniform highp uimageCubeArray)
+0:312      imageStore (global highp void)
+0:312        'CA1' (writeonly uniform highp imageCubeArray)
+0:312        's3' (temp highp 3-component vector of int)
+0:312        Constant:
+0:312          1.000000
+0:312          1.000000
+0:312          1.000000
+0:312          1.000000
+0:313      imageStore (global highp void)
+0:313        'CA2' (writeonly uniform highp iimageCubeArray)
+0:313        's3' (temp highp 3-component vector of int)
+0:313        Constant:
+0:313          1 (const int)
+0:313          1 (const int)
+0:313          1 (const int)
+0:313          1 (const int)
+0:314      imageStore (global highp void)
+0:314        'CA3' (writeonly uniform highp uimageCubeArray)
+0:314        's3' (temp highp 3-component vector of int)
+0:314        Constant:
+0:314          1 (const uint)
+0:314          1 (const uint)
+0:314          1 (const uint)
+0:314          1 (const uint)
+0:316      Sequence
+0:316        move second child to first child (temp highp 4-component vector of float)
+0:316          'cl1' (temp highp 4-component vector of float)
+0:316          imageLoad (global highp 4-component vector of float)
+0:316            'rCA1' (layout(rgba16f ) readonly uniform highp imageCubeArray)
+0:316            's3' (temp highp 3-component vector of int)
+0:317      Sequence
+0:317        move second child to first child (temp highp 4-component vector of int)
+0:317          'cl2' (temp highp 4-component vector of int)
+0:317          imageLoad (global highp 4-component vector of int)
+0:317            'rCA2' (layout(rgba32i ) readonly uniform highp iimageCubeArray)
+0:317            's3' (temp highp 3-component vector of int)
+0:318      Sequence
+0:318        move second child to first child (temp highp 4-component vector of uint)
+0:318          'cl3' (temp highp 4-component vector of uint)
+0:318          imageLoad (global highp 4-component vector of uint)
+0:318            'rCA3' (layout(r32ui ) readonly uniform highp uimageCubeArray)
+0:318            's3' (temp highp 3-component vector of int)
+0:343  Function Definition: MSA( (global void)
+0:343    Function Parameters: 
+0:345    Sequence
+0:345      Sequence
+0:345        move second child to first child (temp highp 4-component vector of float)
+0:345          'tf' (temp highp 4-component vector of float)
+0:345          textureFetch (global highp 4-component vector of float)
+0:345            'samp2DMSA' (uniform highp sampler2DMSArray)
+0:345            Constant:
+0:345              5 (const int)
+0:345              5 (const int)
+0:345              5 (const int)
+0:345            Constant:
+0:345              2 (const int)
+0:346      Sequence
+0:346        move second child to first child (temp highp 4-component vector of int)
+0:346          'tfi' (temp highp 4-component vector of int)
+0:346          textureFetch (global highp 4-component vector of int)
+0:346            'samp2DMSAi' (uniform highp isampler2DMSArray)
+0:346            Constant:
+0:346              5 (const int)
+0:346              5 (const int)
+0:346              5 (const int)
+0:346            Constant:
+0:346              2 (const int)
+0:347      Sequence
+0:347        move second child to first child (temp highp 4-component vector of uint)
+0:347          'tfu' (temp highp 4-component vector of uint)
+0:347          textureFetch (global highp 4-component vector of uint)
+0:347            'samp2DMSAu' (uniform highp usampler2DMSArray)
+0:347            Constant:
+0:347              5 (const int)
+0:347              5 (const int)
+0:347              5 (const int)
+0:347            Constant:
+0:347              2 (const int)
+0:349      Sequence
+0:349        move second child to first child (temp highp 3-component vector of int)
+0:349          'tfs' (temp highp 3-component vector of int)
+0:349          textureSize (global highp 3-component vector of int)
+0:349            'samp2DMSA' (uniform highp sampler2DMSArray)
+0:350      Sequence
+0:350        move second child to first child (temp highp 3-component vector of int)
+0:350          'tfsi' (temp highp 3-component vector of int)
+0:350          textureSize (global highp 3-component vector of int)
+0:350            'samp2DMSAi' (uniform highp isampler2DMSArray)
+0:352      Sequence
+0:352        move second child to first child (temp highp 3-component vector of int)
+0:352          'tfsu' (temp highp 3-component vector of int)
+0:352          textureSize (global highp 3-component vector of int)
+0:352            'samp2DMSAu' (uniform highp usampler2DMSArray)
+0:364  Function Definition: goodImageAtom( (global void)
+0:364    Function Parameters: 
 0:?     Sequence
-0:358      imageAtomicAdd (global highp int)
-0:358        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:358        'P' (uniform highp 2-component vector of int)
-0:358        'dati' (temp highp int)
-0:359      imageAtomicAdd (global highp uint)
-0:359        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:359        'P' (uniform highp 2-component vector of int)
-0:359        'datu' (temp highp uint)
-0:360      imageAtomicMin (global highp int)
-0:360        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:360        'P' (uniform highp 2-component vector of int)
-0:360        'dati' (temp highp int)
-0:361      imageAtomicMin (global highp uint)
-0:361        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:361        'P' (uniform highp 2-component vector of int)
-0:361        'datu' (temp highp uint)
-0:362      imageAtomicMax (global highp int)
-0:362        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:362        'P' (uniform highp 2-component vector of int)
-0:362        'dati' (temp highp int)
-0:363      imageAtomicMax (global highp uint)
-0:363        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:363        'P' (uniform highp 2-component vector of int)
-0:363        'datu' (temp highp uint)
-0:364      imageAtomicAnd (global highp int)
-0:364        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:364        'P' (uniform highp 2-component vector of int)
-0:364        'dati' (temp highp int)
-0:365      imageAtomicAnd (global highp uint)
-0:365        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:365        'P' (uniform highp 2-component vector of int)
-0:365        'datu' (temp highp uint)
-0:366      imageAtomicOr (global highp int)
-0:366        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:366        'P' (uniform highp 2-component vector of int)
-0:366        'dati' (temp highp int)
-0:367      imageAtomicOr (global highp uint)
-0:367        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:367        'P' (uniform highp 2-component vector of int)
-0:367        'datu' (temp highp uint)
-0:368      imageAtomicXor (global highp int)
-0:368        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:368        'P' (uniform highp 2-component vector of int)
-0:368        'dati' (temp highp int)
-0:369      imageAtomicXor (global highp uint)
-0:369        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:369        'P' (uniform highp 2-component vector of int)
-0:369        'datu' (temp highp uint)
-0:370      imageAtomicExchange (global highp int)
+0:370      imageAtomicAdd (global highp int)
 0:370        'im2Di' (layout(r32i ) uniform highp iimage2D)
 0:370        'P' (uniform highp 2-component vector of int)
 0:370        'dati' (temp highp int)
-0:371      imageAtomicExchange (global highp uint)
+0:371      imageAtomicAdd (global highp uint)
 0:371        'im2Du' (layout(r32ui ) uniform highp uimage2D)
 0:371        'P' (uniform highp 2-component vector of int)
 0:371        'datu' (temp highp uint)
-0:372      imageAtomicExchange (global highp float)
-0:372        'im2Df' (layout(r32f ) uniform highp image2D)
+0:372      imageAtomicMin (global highp int)
+0:372        'im2Di' (layout(r32i ) uniform highp iimage2D)
 0:372        'P' (uniform highp 2-component vector of int)
-0:372        'datf' (temp highp float)
-0:373      imageAtomicCompSwap (global highp int)
-0:373        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:372        'dati' (temp highp int)
+0:373      imageAtomicMin (global highp uint)
+0:373        'im2Du' (layout(r32ui ) uniform highp uimage2D)
 0:373        'P' (uniform highp 2-component vector of int)
-0:373        Constant:
-0:373          3 (const int)
-0:373        'dati' (temp highp int)
-0:374      imageAtomicCompSwap (global highp uint)
-0:374        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:373        'datu' (temp highp uint)
+0:374      imageAtomicMax (global highp int)
+0:374        'im2Di' (layout(r32i ) uniform highp iimage2D)
 0:374        'P' (uniform highp 2-component vector of int)
-0:374        Constant:
-0:374          5 (const uint)
-0:374        'datu' (temp highp uint)
-0:386  Function Definition: badInterp( (global void)
-0:386    Function Parameters: 
-0:388    Sequence
-0:388      Constant:
-0:388        0.000000
-0:389      Constant:
-0:389        0.000000
-0:390      Constant:
-0:390        0.000000
+0:374        'dati' (temp highp int)
+0:375      imageAtomicMax (global highp uint)
+0:375        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:375        'P' (uniform highp 2-component vector of int)
+0:375        'datu' (temp highp uint)
+0:376      imageAtomicAnd (global highp int)
+0:376        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:376        'P' (uniform highp 2-component vector of int)
+0:376        'dati' (temp highp int)
+0:377      imageAtomicAnd (global highp uint)
+0:377        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:377        'P' (uniform highp 2-component vector of int)
+0:377        'datu' (temp highp uint)
+0:378      imageAtomicOr (global highp int)
+0:378        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:378        'P' (uniform highp 2-component vector of int)
+0:378        'dati' (temp highp int)
+0:379      imageAtomicOr (global highp uint)
+0:379        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:379        'P' (uniform highp 2-component vector of int)
+0:379        'datu' (temp highp uint)
+0:380      imageAtomicXor (global highp int)
+0:380        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:380        'P' (uniform highp 2-component vector of int)
+0:380        'dati' (temp highp int)
+0:381      imageAtomicXor (global highp uint)
+0:381        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:381        'P' (uniform highp 2-component vector of int)
+0:381        'datu' (temp highp uint)
+0:382      imageAtomicExchange (global highp int)
+0:382        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:382        'P' (uniform highp 2-component vector of int)
+0:382        'dati' (temp highp int)
+0:383      imageAtomicExchange (global highp uint)
+0:383        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:383        'P' (uniform highp 2-component vector of int)
+0:383        'datu' (temp highp uint)
+0:384      imageAtomicExchange (global highp float)
+0:384        'im2Df' (layout(r32f ) uniform highp image2D)
+0:384        'P' (uniform highp 2-component vector of int)
+0:384        'datf' (temp highp float)
+0:385      imageAtomicCompSwap (global highp int)
+0:385        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:385        'P' (uniform highp 2-component vector of int)
+0:385        Constant:
+0:385          3 (const int)
+0:385        'dati' (temp highp int)
+0:386      imageAtomicCompSwap (global highp uint)
+0:386        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:386        'P' (uniform highp 2-component vector of int)
+0:386        Constant:
+0:386          5 (const uint)
+0:386        'datu' (temp highp uint)
+0:398  Function Definition: badInterp( (global void)
+0:398    Function Parameters: 
+0:400    Sequence
+0:400      Constant:
+0:400        0.000000
+0:401      Constant:
+0:401        0.000000
+0:402      Constant:
+0:402        0.000000
 0:?   Linker Objects
 0:?     's' (shared highp 4-component vector of float)
 0:?     'v' (buffer highp 4-component vector of float)
@@ -950,6 +992,9 @@ ERROR: node is still EOpNull!
 0:?     'CA1' (writeonly uniform highp imageCubeArray)
 0:?     'CA2' (writeonly uniform highp iimageCubeArray)
 0:?     'CA3' (writeonly uniform highp uimageCubeArray)
+0:?     'rCA1' (layout(rgba16f ) readonly uniform highp imageCubeArray)
+0:?     'rCA2' (layout(rgba32i ) readonly uniform highp iimageCubeArray)
+0:?     'rCA3' (layout(r32ui ) readonly uniform highp uimageCubeArray)
 0:?     'CA4' (uniform highp samplerCubeArray)
 0:?     'CA5' (uniform highp samplerCubeArrayShadow)
 0:?     'CA6' (uniform highp isamplerCubeArray)
@@ -1357,119 +1402,83 @@ ERROR: node is still EOpNull!
 0:232          textureFetch (global highp 4-component vector of uint)
 0:232            'bufSamp3' (uniform highp usamplerBuffer)
 0:232            's3' (temp highp int)
-0:275  Function Definition: CAT( (global void)
-0:275    Function Parameters: 
-0:277    Sequence
-0:277      Sequence
-0:277        move second child to first child (temp highp 3-component vector of int)
-0:277          's4' (temp highp 3-component vector of int)
-0:277          textureSize (global highp 3-component vector of int)
-0:277            'CA4' (uniform highp samplerCubeArray)
-0:277            Constant:
-0:277              1 (const int)
-0:278      Sequence
-0:278        move second child to first child (temp highp 3-component vector of int)
-0:278          's5' (temp highp 3-component vector of int)
-0:278          textureSize (global highp 3-component vector of int)
-0:278            'CA5' (uniform highp samplerCubeArrayShadow)
-0:278            Constant:
-0:278              1 (const int)
-0:279      Sequence
-0:279        move second child to first child (temp highp 3-component vector of int)
-0:279          's6' (temp highp 3-component vector of int)
-0:279          textureSize (global highp 3-component vector of int)
-0:279            'CA6' (uniform highp isamplerCubeArray)
-0:279            Constant:
-0:279              1 (const int)
-0:280      Sequence
-0:280        move second child to first child (temp highp 3-component vector of int)
-0:280          's7' (temp highp 3-component vector of int)
-0:280          textureSize (global highp 3-component vector of int)
-0:280            'CA7' (uniform highp usamplerCubeArray)
-0:280            Constant:
-0:280              1 (const int)
+0:279  Function Definition: CAT( (global void)
+0:279    Function Parameters: 
+0:281    Sequence
+0:281      Sequence
+0:281        move second child to first child (temp highp 3-component vector of int)
+0:281          's4' (temp highp 3-component vector of int)
+0:281          textureSize (global highp 3-component vector of int)
+0:281            'CA4' (uniform highp samplerCubeArray)
+0:281            Constant:
+0:281              1 (const int)
 0:282      Sequence
-0:282        move second child to first child (temp highp 4-component vector of float)
-0:282          't4' (temp highp 4-component vector of float)
-0:282          texture (global highp 4-component vector of float)
-0:282            'CA4' (uniform highp samplerCubeArray)
+0:282        move second child to first child (temp highp 3-component vector of int)
+0:282          's5' (temp highp 3-component vector of int)
+0:282          textureSize (global highp 3-component vector of int)
+0:282            'CA5' (uniform highp samplerCubeArrayShadow)
 0:282            Constant:
-0:282              0.500000
-0:282              0.500000
-0:282              0.500000
-0:282              0.500000
+0:282              1 (const int)
 0:283      Sequence
-0:283        move second child to first child (temp highp float)
-0:283          't5' (temp highp float)
-0:283          texture (global highp float)
-0:283            'CA5' (uniform highp samplerCubeArrayShadow)
+0:283        move second child to first child (temp highp 3-component vector of int)
+0:283          's6' (temp highp 3-component vector of int)
+0:283          textureSize (global highp 3-component vector of int)
+0:283            'CA6' (uniform highp isamplerCubeArray)
 0:283            Constant:
-0:283              0.500000
-0:283              0.500000
-0:283              0.500000
-0:283              0.500000
-0:283            Constant:
-0:283              3.000000
+0:283              1 (const int)
 0:284      Sequence
-0:284        move second child to first child (temp highp 4-component vector of int)
-0:284          't6' (temp highp 4-component vector of int)
-0:284          texture (global highp 4-component vector of int)
-0:284            'CA6' (uniform highp isamplerCubeArray)
+0:284        move second child to first child (temp highp 3-component vector of int)
+0:284          's7' (temp highp 3-component vector of int)
+0:284          textureSize (global highp 3-component vector of int)
+0:284            'CA7' (uniform highp usamplerCubeArray)
 0:284            Constant:
-0:284              0.500000
-0:284              0.500000
-0:284              0.500000
-0:284              0.500000
-0:285      Sequence
-0:285        move second child to first child (temp highp 4-component vector of uint)
-0:285          't7' (temp highp 4-component vector of uint)
-0:285          texture (global highp 4-component vector of uint)
-0:285            'CA7' (uniform highp usamplerCubeArray)
-0:285            Constant:
-0:285              0.500000
-0:285              0.500000
-0:285              0.500000
-0:285              0.500000
+0:284              1 (const int)
+0:286      Sequence
+0:286        move second child to first child (temp highp 4-component vector of float)
+0:286          't4' (temp highp 4-component vector of float)
+0:286          texture (global highp 4-component vector of float)
+0:286            'CA4' (uniform highp samplerCubeArray)
+0:286            Constant:
+0:286              0.500000
+0:286              0.500000
+0:286              0.500000
+0:286              0.500000
 0:287      Sequence
-0:287        move second child to first child (temp highp 4-component vector of float)
-0:287          'L4' (temp highp 4-component vector of float)
-0:287          textureLod (global highp 4-component vector of float)
-0:287            'CA4' (uniform highp samplerCubeArray)
+0:287        move second child to first child (temp highp float)
+0:287          't5' (temp highp float)
+0:287          texture (global highp float)
+0:287            'CA5' (uniform highp samplerCubeArrayShadow)
 0:287            Constant:
 0:287              0.500000
 0:287              0.500000
 0:287              0.500000
 0:287              0.500000
 0:287            Constant:
-0:287              0.240000
+0:287              3.000000
 0:288      Sequence
 0:288        move second child to first child (temp highp 4-component vector of int)
-0:288          'L6' (temp highp 4-component vector of int)
-0:288          textureLod (global highp 4-component vector of int)
+0:288          't6' (temp highp 4-component vector of int)
+0:288          texture (global highp 4-component vector of int)
 0:288            'CA6' (uniform highp isamplerCubeArray)
 0:288            Constant:
 0:288              0.500000
 0:288              0.500000
 0:288              0.500000
 0:288              0.500000
-0:288            Constant:
-0:288              0.260000
 0:289      Sequence
 0:289        move second child to first child (temp highp 4-component vector of uint)
-0:289          'L7' (temp highp 4-component vector of uint)
-0:289          textureLod (global highp 4-component vector of uint)
+0:289          't7' (temp highp 4-component vector of uint)
+0:289          texture (global highp 4-component vector of uint)
 0:289            'CA7' (uniform highp usamplerCubeArray)
 0:289            Constant:
 0:289              0.500000
 0:289              0.500000
 0:289              0.500000
 0:289              0.500000
-0:289            Constant:
-0:289              0.270000
 0:291      Sequence
 0:291        move second child to first child (temp highp 4-component vector of float)
-0:291          'g4' (temp highp 4-component vector of float)
-0:291          textureGrad (global highp 4-component vector of float)
+0:291          'L4' (temp highp 4-component vector of float)
+0:291          textureLod (global highp 4-component vector of float)
 0:291            'CA4' (uniform highp samplerCubeArray)
 0:291            Constant:
 0:291              0.500000
@@ -1477,17 +1486,11 @@ ERROR: node is still EOpNull!
 0:291              0.500000
 0:291              0.500000
 0:291            Constant:
-0:291              0.100000
-0:291              0.100000
-0:291              0.100000
-0:291            Constant:
-0:291              0.200000
-0:291              0.200000
-0:291              0.200000
+0:291              0.240000
 0:292      Sequence
 0:292        move second child to first child (temp highp 4-component vector of int)
-0:292          'g6' (temp highp 4-component vector of int)
-0:292          textureGrad (global highp 4-component vector of int)
+0:292          'L6' (temp highp 4-component vector of int)
+0:292          textureLod (global highp 4-component vector of int)
 0:292            'CA6' (uniform highp isamplerCubeArray)
 0:292            Constant:
 0:292              0.500000
@@ -1495,17 +1498,11 @@ ERROR: node is still EOpNull!
 0:292              0.500000
 0:292              0.500000
 0:292            Constant:
-0:292              0.100000
-0:292              0.100000
-0:292              0.100000
-0:292            Constant:
-0:292              0.200000
-0:292              0.200000
-0:292              0.200000
+0:292              0.260000
 0:293      Sequence
 0:293        move second child to first child (temp highp 4-component vector of uint)
-0:293          'g7' (temp highp 4-component vector of uint)
-0:293          textureGrad (global highp 4-component vector of uint)
+0:293          'L7' (temp highp 4-component vector of uint)
+0:293          textureLod (global highp 4-component vector of uint)
 0:293            'CA7' (uniform highp usamplerCubeArray)
 0:293            Constant:
 0:293              0.500000
@@ -1513,241 +1510,331 @@ ERROR: node is still EOpNull!
 0:293              0.500000
 0:293              0.500000
 0:293            Constant:
-0:293              0.100000
-0:293              0.100000
-0:293              0.100000
-0:293            Constant:
-0:293              0.200000
-0:293              0.200000
-0:293              0.200000
+0:293              0.270000
 0:295      Sequence
 0:295        move second child to first child (temp highp 4-component vector of float)
-0:295          'gath4' (temp highp 4-component vector of float)
-0:295          textureGather (global highp 4-component vector of float)
+0:295          'g4' (temp highp 4-component vector of float)
+0:295          textureGrad (global highp 4-component vector of float)
 0:295            'CA4' (uniform highp samplerCubeArray)
 0:295            Constant:
 0:295              0.500000
 0:295              0.500000
 0:295              0.500000
 0:295              0.500000
+0:295            Constant:
+0:295              0.100000
+0:295              0.100000
+0:295              0.100000
+0:295            Constant:
+0:295              0.200000
+0:295              0.200000
+0:295              0.200000
 0:296      Sequence
-0:296        move second child to first child (temp highp 4-component vector of float)
-0:296          'gathC4' (temp highp 4-component vector of float)
-0:296          textureGather (global highp 4-component vector of float)
-0:296            'CA4' (uniform highp samplerCubeArray)
+0:296        move second child to first child (temp highp 4-component vector of int)
+0:296          'g6' (temp highp 4-component vector of int)
+0:296          textureGrad (global highp 4-component vector of int)
+0:296            'CA6' (uniform highp isamplerCubeArray)
 0:296            Constant:
 0:296              0.500000
 0:296              0.500000
 0:296              0.500000
 0:296              0.500000
 0:296            Constant:
-0:296              2 (const int)
+0:296              0.100000
+0:296              0.100000
+0:296              0.100000
+0:296            Constant:
+0:296              0.200000
+0:296              0.200000
+0:296              0.200000
 0:297      Sequence
-0:297        move second child to first child (temp highp 4-component vector of int)
-0:297          'gath6' (temp highp 4-component vector of int)
-0:297          textureGather (global highp 4-component vector of int)
-0:297            'CA6' (uniform highp isamplerCubeArray)
+0:297        move second child to first child (temp highp 4-component vector of uint)
+0:297          'g7' (temp highp 4-component vector of uint)
+0:297          textureGrad (global highp 4-component vector of uint)
+0:297            'CA7' (uniform highp usamplerCubeArray)
 0:297            Constant:
 0:297              0.500000
 0:297              0.500000
 0:297              0.500000
 0:297              0.500000
-0:298      Sequence
-0:298        move second child to first child (temp highp 4-component vector of int)
-0:298          'gathC6' (temp highp 4-component vector of int)
-0:298          textureGather (global highp 4-component vector of int)
-0:298            'CA6' (uniform highp isamplerCubeArray)
-0:298            Constant:
-0:298              0.500000
-0:298              0.500000
-0:298              0.500000
-0:298              0.500000
-0:298            Constant:
-0:298              1 (const int)
+0:297            Constant:
+0:297              0.100000
+0:297              0.100000
+0:297              0.100000
+0:297            Constant:
+0:297              0.200000
+0:297              0.200000
+0:297              0.200000
 0:299      Sequence
-0:299        move second child to first child (temp highp 4-component vector of uint)
-0:299          'gath7' (temp highp 4-component vector of uint)
-0:299          textureGather (global highp 4-component vector of uint)
-0:299            'CA7' (uniform highp usamplerCubeArray)
+0:299        move second child to first child (temp highp 4-component vector of float)
+0:299          'gath4' (temp highp 4-component vector of float)
+0:299          textureGather (global highp 4-component vector of float)
+0:299            'CA4' (uniform highp samplerCubeArray)
 0:299            Constant:
 0:299              0.500000
 0:299              0.500000
 0:299              0.500000
 0:299              0.500000
 0:300      Sequence
-0:300        move second child to first child (temp highp 4-component vector of uint)
-0:300          'gathC7' (temp highp 4-component vector of uint)
-0:300          textureGather (global highp 4-component vector of uint)
-0:300            'CA7' (uniform highp usamplerCubeArray)
+0:300        move second child to first child (temp highp 4-component vector of float)
+0:300          'gathC4' (temp highp 4-component vector of float)
+0:300          textureGather (global highp 4-component vector of float)
+0:300            'CA4' (uniform highp samplerCubeArray)
 0:300            Constant:
 0:300              0.500000
 0:300              0.500000
 0:300              0.500000
 0:300              0.500000
 0:300            Constant:
-0:300              0 (const int)
+0:300              2 (const int)
+0:301      Sequence
+0:301        move second child to first child (temp highp 4-component vector of int)
+0:301          'gath6' (temp highp 4-component vector of int)
+0:301          textureGather (global highp 4-component vector of int)
+0:301            'CA6' (uniform highp isamplerCubeArray)
+0:301            Constant:
+0:301              0.500000
+0:301              0.500000
+0:301              0.500000
+0:301              0.500000
 0:302      Sequence
-0:302        move second child to first child (temp highp 4-component vector of float)
-0:302          'gath5' (temp highp 4-component vector of float)
-0:302          textureGather (global highp 4-component vector of float)
-0:302            'CA5' (uniform highp samplerCubeArrayShadow)
+0:302        move second child to first child (temp highp 4-component vector of int)
+0:302          'gathC6' (temp highp 4-component vector of int)
+0:302          textureGather (global highp 4-component vector of int)
+0:302            'CA6' (uniform highp isamplerCubeArray)
 0:302            Constant:
 0:302              0.500000
 0:302              0.500000
 0:302              0.500000
 0:302              0.500000
 0:302            Constant:
-0:302              2.500000
+0:302              1 (const int)
+0:303      Sequence
+0:303        move second child to first child (temp highp 4-component vector of uint)
+0:303          'gath7' (temp highp 4-component vector of uint)
+0:303          textureGather (global highp 4-component vector of uint)
+0:303            'CA7' (uniform highp usamplerCubeArray)
+0:303            Constant:
+0:303              0.500000
+0:303              0.500000
+0:303              0.500000
+0:303              0.500000
 0:304      Sequence
-0:304        move second child to first child (temp highp 3-component vector of int)
-0:304          's1' (temp highp 3-component vector of int)
-0:304          imageQuerySize (global highp 3-component vector of int)
-0:304            'CA1' (writeonly uniform highp imageCubeArray)
-0:305      Sequence
-0:305        move second child to first child (temp highp 3-component vector of int)
-0:305          's2' (temp highp 3-component vector of int)
-0:305          imageQuerySize (global highp 3-component vector of int)
-0:305            'CA2' (writeonly uniform highp iimageCubeArray)
+0:304        move second child to first child (temp highp 4-component vector of uint)
+0:304          'gathC7' (temp highp 4-component vector of uint)
+0:304          textureGather (global highp 4-component vector of uint)
+0:304            'CA7' (uniform highp usamplerCubeArray)
+0:304            Constant:
+0:304              0.500000
+0:304              0.500000
+0:304              0.500000
+0:304              0.500000
+0:304            Constant:
+0:304              0 (const int)
 0:306      Sequence
-0:306        move second child to first child (temp highp 3-component vector of int)
-0:306          's3' (temp highp 3-component vector of int)
-0:306          imageQuerySize (global highp 3-component vector of int)
-0:306            'CA3' (writeonly uniform highp uimageCubeArray)
-0:331  Function Definition: MSA( (global void)
-0:331    Function Parameters: 
-0:333    Sequence
-0:333      Sequence
-0:333        move second child to first child (temp highp 4-component vector of float)
-0:333          'tf' (temp highp 4-component vector of float)
-0:333          textureFetch (global highp 4-component vector of float)
-0:333            'samp2DMSA' (uniform highp sampler2DMSArray)
-0:333            Constant:
-0:333              5 (const int)
-0:333              5 (const int)
-0:333              5 (const int)
-0:333            Constant:
-0:333              2 (const int)
-0:334      Sequence
-0:334        move second child to first child (temp highp 4-component vector of int)
-0:334          'tfi' (temp highp 4-component vector of int)
-0:334          textureFetch (global highp 4-component vector of int)
-0:334            'samp2DMSAi' (uniform highp isampler2DMSArray)
-0:334            Constant:
-0:334              5 (const int)
-0:334              5 (const int)
-0:334              5 (const int)
-0:334            Constant:
-0:334              2 (const int)
-0:335      Sequence
-0:335        move second child to first child (temp highp 4-component vector of uint)
-0:335          'tfu' (temp highp 4-component vector of uint)
-0:335          textureFetch (global highp 4-component vector of uint)
-0:335            'samp2DMSAu' (uniform highp usampler2DMSArray)
-0:335            Constant:
-0:335              5 (const int)
-0:335              5 (const int)
-0:335              5 (const int)
-0:335            Constant:
-0:335              2 (const int)
-0:337      Sequence
-0:337        move second child to first child (temp highp 3-component vector of int)
-0:337          'tfs' (temp highp 3-component vector of int)
-0:337          textureSize (global highp 3-component vector of int)
-0:337            'samp2DMSA' (uniform highp sampler2DMSArray)
-0:338      Sequence
-0:338        move second child to first child (temp highp 3-component vector of int)
-0:338          'tfsi' (temp highp 3-component vector of int)
-0:338          textureSize (global highp 3-component vector of int)
-0:338            'samp2DMSAi' (uniform highp isampler2DMSArray)
-0:340      Sequence
-0:340        move second child to first child (temp highp 3-component vector of int)
-0:340          'tfsu' (temp highp 3-component vector of int)
-0:340          textureSize (global highp 3-component vector of int)
-0:340            'samp2DMSAu' (uniform highp usampler2DMSArray)
-0:352  Function Definition: goodImageAtom( (global void)
-0:352    Function Parameters: 
+0:306        move second child to first child (temp highp 4-component vector of float)
+0:306          'gath5' (temp highp 4-component vector of float)
+0:306          textureGather (global highp 4-component vector of float)
+0:306            'CA5' (uniform highp samplerCubeArrayShadow)
+0:306            Constant:
+0:306              0.500000
+0:306              0.500000
+0:306              0.500000
+0:306              0.500000
+0:306            Constant:
+0:306              2.500000
+0:308      Sequence
+0:308        move second child to first child (temp highp 3-component vector of int)
+0:308          's1' (temp highp 3-component vector of int)
+0:308          imageQuerySize (global highp 3-component vector of int)
+0:308            'CA1' (writeonly uniform highp imageCubeArray)
+0:309      Sequence
+0:309        move second child to first child (temp highp 3-component vector of int)
+0:309          's2' (temp highp 3-component vector of int)
+0:309          imageQuerySize (global highp 3-component vector of int)
+0:309            'CA2' (writeonly uniform highp iimageCubeArray)
+0:310      Sequence
+0:310        move second child to first child (temp highp 3-component vector of int)
+0:310          's3' (temp highp 3-component vector of int)
+0:310          imageQuerySize (global highp 3-component vector of int)
+0:310            'CA3' (writeonly uniform highp uimageCubeArray)
+0:312      imageStore (global highp void)
+0:312        'CA1' (writeonly uniform highp imageCubeArray)
+0:312        's3' (temp highp 3-component vector of int)
+0:312        Constant:
+0:312          1.000000
+0:312          1.000000
+0:312          1.000000
+0:312          1.000000
+0:313      imageStore (global highp void)
+0:313        'CA2' (writeonly uniform highp iimageCubeArray)
+0:313        's3' (temp highp 3-component vector of int)
+0:313        Constant:
+0:313          1 (const int)
+0:313          1 (const int)
+0:313          1 (const int)
+0:313          1 (const int)
+0:314      imageStore (global highp void)
+0:314        'CA3' (writeonly uniform highp uimageCubeArray)
+0:314        's3' (temp highp 3-component vector of int)
+0:314        Constant:
+0:314          1 (const uint)
+0:314          1 (const uint)
+0:314          1 (const uint)
+0:314          1 (const uint)
+0:316      Sequence
+0:316        move second child to first child (temp highp 4-component vector of float)
+0:316          'cl1' (temp highp 4-component vector of float)
+0:316          imageLoad (global highp 4-component vector of float)
+0:316            'rCA1' (layout(rgba16f ) readonly uniform highp imageCubeArray)
+0:316            's3' (temp highp 3-component vector of int)
+0:317      Sequence
+0:317        move second child to first child (temp highp 4-component vector of int)
+0:317          'cl2' (temp highp 4-component vector of int)
+0:317          imageLoad (global highp 4-component vector of int)
+0:317            'rCA2' (layout(rgba32i ) readonly uniform highp iimageCubeArray)
+0:317            's3' (temp highp 3-component vector of int)
+0:318      Sequence
+0:318        move second child to first child (temp highp 4-component vector of uint)
+0:318          'cl3' (temp highp 4-component vector of uint)
+0:318          imageLoad (global highp 4-component vector of uint)
+0:318            'rCA3' (layout(r32ui ) readonly uniform highp uimageCubeArray)
+0:318            's3' (temp highp 3-component vector of int)
+0:343  Function Definition: MSA( (global void)
+0:343    Function Parameters: 
+0:345    Sequence
+0:345      Sequence
+0:345        move second child to first child (temp highp 4-component vector of float)
+0:345          'tf' (temp highp 4-component vector of float)
+0:345          textureFetch (global highp 4-component vector of float)
+0:345            'samp2DMSA' (uniform highp sampler2DMSArray)
+0:345            Constant:
+0:345              5 (const int)
+0:345              5 (const int)
+0:345              5 (const int)
+0:345            Constant:
+0:345              2 (const int)
+0:346      Sequence
+0:346        move second child to first child (temp highp 4-component vector of int)
+0:346          'tfi' (temp highp 4-component vector of int)
+0:346          textureFetch (global highp 4-component vector of int)
+0:346            'samp2DMSAi' (uniform highp isampler2DMSArray)
+0:346            Constant:
+0:346              5 (const int)
+0:346              5 (const int)
+0:346              5 (const int)
+0:346            Constant:
+0:346              2 (const int)
+0:347      Sequence
+0:347        move second child to first child (temp highp 4-component vector of uint)
+0:347          'tfu' (temp highp 4-component vector of uint)
+0:347          textureFetch (global highp 4-component vector of uint)
+0:347            'samp2DMSAu' (uniform highp usampler2DMSArray)
+0:347            Constant:
+0:347              5 (const int)
+0:347              5 (const int)
+0:347              5 (const int)
+0:347            Constant:
+0:347              2 (const int)
+0:349      Sequence
+0:349        move second child to first child (temp highp 3-component vector of int)
+0:349          'tfs' (temp highp 3-component vector of int)
+0:349          textureSize (global highp 3-component vector of int)
+0:349            'samp2DMSA' (uniform highp sampler2DMSArray)
+0:350      Sequence
+0:350        move second child to first child (temp highp 3-component vector of int)
+0:350          'tfsi' (temp highp 3-component vector of int)
+0:350          textureSize (global highp 3-component vector of int)
+0:350            'samp2DMSAi' (uniform highp isampler2DMSArray)
+0:352      Sequence
+0:352        move second child to first child (temp highp 3-component vector of int)
+0:352          'tfsu' (temp highp 3-component vector of int)
+0:352          textureSize (global highp 3-component vector of int)
+0:352            'samp2DMSAu' (uniform highp usampler2DMSArray)
+0:364  Function Definition: goodImageAtom( (global void)
+0:364    Function Parameters: 
 0:?     Sequence
-0:358      imageAtomicAdd (global highp int)
-0:358        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:358        'P' (uniform highp 2-component vector of int)
-0:358        'dati' (temp highp int)
-0:359      imageAtomicAdd (global highp uint)
-0:359        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:359        'P' (uniform highp 2-component vector of int)
-0:359        'datu' (temp highp uint)
-0:360      imageAtomicMin (global highp int)
-0:360        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:360        'P' (uniform highp 2-component vector of int)
-0:360        'dati' (temp highp int)
-0:361      imageAtomicMin (global highp uint)
-0:361        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:361        'P' (uniform highp 2-component vector of int)
-0:361        'datu' (temp highp uint)
-0:362      imageAtomicMax (global highp int)
-0:362        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:362        'P' (uniform highp 2-component vector of int)
-0:362        'dati' (temp highp int)
-0:363      imageAtomicMax (global highp uint)
-0:363        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:363        'P' (uniform highp 2-component vector of int)
-0:363        'datu' (temp highp uint)
-0:364      imageAtomicAnd (global highp int)
-0:364        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:364        'P' (uniform highp 2-component vector of int)
-0:364        'dati' (temp highp int)
-0:365      imageAtomicAnd (global highp uint)
-0:365        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:365        'P' (uniform highp 2-component vector of int)
-0:365        'datu' (temp highp uint)
-0:366      imageAtomicOr (global highp int)
-0:366        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:366        'P' (uniform highp 2-component vector of int)
-0:366        'dati' (temp highp int)
-0:367      imageAtomicOr (global highp uint)
-0:367        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:367        'P' (uniform highp 2-component vector of int)
-0:367        'datu' (temp highp uint)
-0:368      imageAtomicXor (global highp int)
-0:368        'im2Di' (layout(r32i ) uniform highp iimage2D)
-0:368        'P' (uniform highp 2-component vector of int)
-0:368        'dati' (temp highp int)
-0:369      imageAtomicXor (global highp uint)
-0:369        'im2Du' (layout(r32ui ) uniform highp uimage2D)
-0:369        'P' (uniform highp 2-component vector of int)
-0:369        'datu' (temp highp uint)
-0:370      imageAtomicExchange (global highp int)
+0:370      imageAtomicAdd (global highp int)
 0:370        'im2Di' (layout(r32i ) uniform highp iimage2D)
 0:370        'P' (uniform highp 2-component vector of int)
 0:370        'dati' (temp highp int)
-0:371      imageAtomicExchange (global highp uint)
+0:371      imageAtomicAdd (global highp uint)
 0:371        'im2Du' (layout(r32ui ) uniform highp uimage2D)
 0:371        'P' (uniform highp 2-component vector of int)
 0:371        'datu' (temp highp uint)
-0:372      imageAtomicExchange (global highp float)
-0:372        'im2Df' (layout(r32f ) uniform highp image2D)
+0:372      imageAtomicMin (global highp int)
+0:372        'im2Di' (layout(r32i ) uniform highp iimage2D)
 0:372        'P' (uniform highp 2-component vector of int)
-0:372        'datf' (temp highp float)
-0:373      imageAtomicCompSwap (global highp int)
-0:373        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:372        'dati' (temp highp int)
+0:373      imageAtomicMin (global highp uint)
+0:373        'im2Du' (layout(r32ui ) uniform highp uimage2D)
 0:373        'P' (uniform highp 2-component vector of int)
-0:373        Constant:
-0:373          3 (const int)
-0:373        'dati' (temp highp int)
-0:374      imageAtomicCompSwap (global highp uint)
-0:374        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:373        'datu' (temp highp uint)
+0:374      imageAtomicMax (global highp int)
+0:374        'im2Di' (layout(r32i ) uniform highp iimage2D)
 0:374        'P' (uniform highp 2-component vector of int)
-0:374        Constant:
-0:374          5 (const uint)
-0:374        'datu' (temp highp uint)
-0:386  Function Definition: badInterp( (global void)
-0:386    Function Parameters: 
-0:388    Sequence
-0:388      Constant:
-0:388        0.000000
-0:389      Constant:
-0:389        0.000000
-0:390      Constant:
-0:390        0.000000
+0:374        'dati' (temp highp int)
+0:375      imageAtomicMax (global highp uint)
+0:375        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:375        'P' (uniform highp 2-component vector of int)
+0:375        'datu' (temp highp uint)
+0:376      imageAtomicAnd (global highp int)
+0:376        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:376        'P' (uniform highp 2-component vector of int)
+0:376        'dati' (temp highp int)
+0:377      imageAtomicAnd (global highp uint)
+0:377        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:377        'P' (uniform highp 2-component vector of int)
+0:377        'datu' (temp highp uint)
+0:378      imageAtomicOr (global highp int)
+0:378        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:378        'P' (uniform highp 2-component vector of int)
+0:378        'dati' (temp highp int)
+0:379      imageAtomicOr (global highp uint)
+0:379        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:379        'P' (uniform highp 2-component vector of int)
+0:379        'datu' (temp highp uint)
+0:380      imageAtomicXor (global highp int)
+0:380        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:380        'P' (uniform highp 2-component vector of int)
+0:380        'dati' (temp highp int)
+0:381      imageAtomicXor (global highp uint)
+0:381        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:381        'P' (uniform highp 2-component vector of int)
+0:381        'datu' (temp highp uint)
+0:382      imageAtomicExchange (global highp int)
+0:382        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:382        'P' (uniform highp 2-component vector of int)
+0:382        'dati' (temp highp int)
+0:383      imageAtomicExchange (global highp uint)
+0:383        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:383        'P' (uniform highp 2-component vector of int)
+0:383        'datu' (temp highp uint)
+0:384      imageAtomicExchange (global highp float)
+0:384        'im2Df' (layout(r32f ) uniform highp image2D)
+0:384        'P' (uniform highp 2-component vector of int)
+0:384        'datf' (temp highp float)
+0:385      imageAtomicCompSwap (global highp int)
+0:385        'im2Di' (layout(r32i ) uniform highp iimage2D)
+0:385        'P' (uniform highp 2-component vector of int)
+0:385        Constant:
+0:385          3 (const int)
+0:385        'dati' (temp highp int)
+0:386      imageAtomicCompSwap (global highp uint)
+0:386        'im2Du' (layout(r32ui ) uniform highp uimage2D)
+0:386        'P' (uniform highp 2-component vector of int)
+0:386        Constant:
+0:386          5 (const uint)
+0:386        'datu' (temp highp uint)
+0:398  Function Definition: badInterp( (global void)
+0:398    Function Parameters: 
+0:400    Sequence
+0:400      Constant:
+0:400        0.000000
+0:401      Constant:
+0:401        0.000000
+0:402      Constant:
+0:402        0.000000
 0:?   Linker Objects
 0:?     's' (shared highp 4-component vector of float)
 0:?     'v' (buffer highp 4-component vector of float)
@@ -1832,6 +1919,9 @@ ERROR: node is still EOpNull!
 0:?     'CA1' (writeonly uniform highp imageCubeArray)
 0:?     'CA2' (writeonly uniform highp iimageCubeArray)
 0:?     'CA3' (writeonly uniform highp uimageCubeArray)
+0:?     'rCA1' (layout(rgba16f ) readonly uniform highp imageCubeArray)
+0:?     'rCA2' (layout(rgba32i ) readonly uniform highp iimageCubeArray)
+0:?     'rCA3' (layout(r32ui ) readonly uniform highp uimageCubeArray)
 0:?     'CA4' (uniform highp samplerCubeArray)
 0:?     'CA5' (uniform highp samplerCubeArrayShadow)
 0:?     'CA6' (uniform highp isamplerCubeArray)
diff --git a/Test/baseResults/spv.image.frag.out b/Test/baseResults/spv.image.frag.out
index f5874edaa..40258ba44 100644
--- a/Test/baseResults/spv.image.frag.out
+++ b/Test/baseResults/spv.image.frag.out
@@ -32,12 +32,12 @@ Linked fragment stage:
                               Name 133  "ic1D"
                               Name 143  "ic2D"
                               Name 153  "ic3D"
-                              Name 172  "ic4D"
-                              Name 234  "ui"
-                              Name 238  "ii1D"
-                              Name 252  "ui2D"
-                              Name 255  "value"
-                              Name 370  "fragData"
+                              Name 231  "ui"
+                              Name 235  "ii1D"
+                              Name 249  "ui2D"
+                              Name 252  "value"
+                              Name 367  "fragData"
+                              Name 382  "ic4D"
                               Decorate 15(i1D) Binding 0
                               Decorate 25(i2D) Binding 1
                               Decorate 36(i3D) Binding 2
@@ -49,8 +49,9 @@ Linked fragment stage:
                               Decorate 87(iBuffer) Binding 8
                               Decorate 97(i2DMS) Binding 9
                               Decorate 107(i2DMSArray) Binding 10
-                              Decorate 238(ii1D) Binding 11
-                              Decorate 252(ui2D) Binding 12
+                              Decorate 235(ii1D) Binding 11
+                              Decorate 249(ui2D) Binding 12
+                              Decorate 382(ic4D) NoStaticUse
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 1
@@ -103,46 +104,46 @@ Linked fragment stage:
        143(ic2D):    142(ptr) Variable UniformConstant
              152:             TypePointer UniformConstant 7(ivec3)
        153(ic3D):    152(ptr) Variable UniformConstant
-             170:             TypeVector 6(int) 4
-             171:             TypePointer UniformConstant 170(ivec4)
-       172(ic4D):    171(ptr) Variable UniformConstant
-             214:      6(int) Constant 1
-             220:      6(int) Constant 2
-             224:      6(int) Constant 3
-             230:      6(int) Constant 4
-             232:             TypeInt 32 0
-             233:             TypePointer Function 232(int)
-             235:    232(int) Constant 0
-             236:             TypeImage 6(int) 1D nonsampled format:R32i
-             237:             TypePointer UniformConstant 236
-       238(ii1D):    237(ptr) Variable UniformConstant
-             240:      6(int) Constant 10
-             241:             TypePointer Image 6(int)
-             243:    232(int) Constant 1
-             250:             TypeImage 232(int) 2D nonsampled format:R32ui
-             251:             TypePointer UniformConstant 250
-       252(ui2D):    251(ptr) Variable UniformConstant
-             254:             TypePointer UniformConstant 232(int)
-      255(value):    254(ptr) Variable UniformConstant
-             257:             TypePointer Image 232(int)
-             263:      6(int) Constant 11
-             278:      6(int) Constant 12
-             293:      6(int) Constant 13
-             308:      6(int) Constant 14
-             323:      6(int) Constant 15
-             338:      6(int) Constant 16
-             353:      6(int) Constant 18
-             354:      6(int) Constant 17
-             363:    232(int) Constant 19
-             369:             TypePointer Output 126(fvec4)
-   370(fragData):    369(ptr) Variable Output
-             376:             TypeBool
+             211:      6(int) Constant 1
+             217:      6(int) Constant 2
+             221:      6(int) Constant 3
+             227:      6(int) Constant 4
+             229:             TypeInt 32 0
+             230:             TypePointer Function 229(int)
+             232:    229(int) Constant 0
+             233:             TypeImage 6(int) 1D nonsampled format:R32i
+             234:             TypePointer UniformConstant 233
+       235(ii1D):    234(ptr) Variable UniformConstant
+             237:      6(int) Constant 10
+             238:             TypePointer Image 6(int)
+             240:    229(int) Constant 1
+             247:             TypeImage 229(int) 2D nonsampled format:R32ui
+             248:             TypePointer UniformConstant 247
+       249(ui2D):    248(ptr) Variable UniformConstant
+             251:             TypePointer UniformConstant 229(int)
+      252(value):    251(ptr) Variable UniformConstant
+             254:             TypePointer Image 229(int)
+             260:      6(int) Constant 11
+             275:      6(int) Constant 12
+             290:      6(int) Constant 13
+             305:      6(int) Constant 14
+             320:      6(int) Constant 15
+             335:      6(int) Constant 16
+             350:      6(int) Constant 18
+             351:      6(int) Constant 17
+             360:    229(int) Constant 19
+             366:             TypePointer Output 126(fvec4)
+   367(fragData):    366(ptr) Variable Output
+             373:             TypeBool
+             380:             TypeVector 6(int) 4
+             381:             TypePointer UniformConstant 380(ivec4)
+       382(ic4D):    381(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
            9(iv):      8(ptr) Variable Function
           128(v):    127(ptr) Variable Function
-         234(ui):    233(ptr) Variable Function
-             371:    127(ptr) Variable Function
+         231(ui):    230(ptr) Variable Function
+             368:    127(ptr) Variable Function
                               Store 9(iv) 11
               16:          13 Load 15(i1D)
               17:      6(int) ImageQuerySize 16
@@ -278,220 +279,220 @@ Linked fragment stage:
              168:  126(fvec4) Load 128(v)
                               ImageWrite 166 167 168
              169:          51 Load 53(iCubeArray)
-             173:  170(ivec4) Load 172(ic4D)
-             174:  126(fvec4) ImageRead 169 173
-             175:  126(fvec4) Load 128(v)
-             176:  126(fvec4) FAdd 175 174
-                              Store 128(v) 176
-             177:          51 Load 53(iCubeArray)
-             178:  170(ivec4) Load 172(ic4D)
-             179:  126(fvec4) Load 128(v)
-                              ImageWrite 177 178 179
-             180:          58 Load 60(i2DRect)
-             181:   27(ivec2) Load 143(ic2D)
-             182:  126(fvec4) ImageRead 180 181
-             183:  126(fvec4) Load 128(v)
-             184:  126(fvec4) FAdd 183 182
-                              Store 128(v) 184
-             185:          58 Load 60(i2DRect)
+             170:    7(ivec3) Load 153(ic3D)
+             171:  126(fvec4) ImageRead 169 170
+             172:  126(fvec4) Load 128(v)
+             173:  126(fvec4) FAdd 172 171
+                              Store 128(v) 173
+             174:          51 Load 53(iCubeArray)
+             175:    7(ivec3) Load 153(ic3D)
+             176:  126(fvec4) Load 128(v)
+                              ImageWrite 174 175 176
+             177:          58 Load 60(i2DRect)
+             178:   27(ivec2) Load 143(ic2D)
+             179:  126(fvec4) ImageRead 177 178
+             180:  126(fvec4) Load 128(v)
+             181:  126(fvec4) FAdd 180 179
+                              Store 128(v) 181
+             182:          58 Load 60(i2DRect)
+             183:   27(ivec2) Load 143(ic2D)
+             184:  126(fvec4) Load 128(v)
+                              ImageWrite 182 183 184
+             185:          68 Load 70(i1DArray)
              186:   27(ivec2) Load 143(ic2D)
-             187:  126(fvec4) Load 128(v)
-                              ImageWrite 185 186 187
-             188:          68 Load 70(i1DArray)
-             189:   27(ivec2) Load 143(ic2D)
-             190:  126(fvec4) ImageRead 188 189
-             191:  126(fvec4) Load 128(v)
-             192:  126(fvec4) FAdd 191 190
-                              Store 128(v) 192
-             193:          68 Load 70(i1DArray)
-             194:   27(ivec2) Load 143(ic2D)
-             195:  126(fvec4) Load 128(v)
-                              ImageWrite 193 194 195
-             196:          78 Load 80(i2DArray)
-             197:    7(ivec3) Load 153(ic3D)
-             198:  126(fvec4) ImageRead 196 197
-             199:  126(fvec4) Load 128(v)
-             200:  126(fvec4) FAdd 199 198
-                              Store 128(v) 200
-             201:          78 Load 80(i2DArray)
-             202:    7(ivec3) Load 153(ic3D)
-             203:  126(fvec4) Load 128(v)
-                              ImageWrite 201 202 203
-             204:          85 Load 87(iBuffer)
-             205:      6(int) Load 133(ic1D)
-             206:  126(fvec4) ImageRead 204 205
-             207:  126(fvec4) Load 128(v)
-             208:  126(fvec4) FAdd 207 206
-                              Store 128(v) 208
-             209:          85 Load 87(iBuffer)
-             210:      6(int) Load 133(ic1D)
-             211:  126(fvec4) Load 128(v)
-                              ImageWrite 209 210 211
-             212:          95 Load 97(i2DMS)
-             213:   27(ivec2) Load 143(ic2D)
-             215:  126(fvec4) ImageRead 212 213
-             216:  126(fvec4) Load 128(v)
-             217:  126(fvec4) FAdd 216 215
-                              Store 128(v) 217
-             218:          95 Load 97(i2DMS)
-             219:   27(ivec2) Load 143(ic2D)
-             221:  126(fvec4) Load 128(v)
-                              ImageWrite 218 219 220
-             222:         105 Load 107(i2DMSArray)
-             223:    7(ivec3) Load 153(ic3D)
-             225:  126(fvec4) ImageRead 222 223
-             226:  126(fvec4) Load 128(v)
-             227:  126(fvec4) FAdd 226 225
-                              Store 128(v) 227
-             228:         105 Load 107(i2DMSArray)
-             229:    7(ivec3) Load 153(ic3D)
-             231:  126(fvec4) Load 128(v)
-                              ImageWrite 228 229 230
-                              Store 234(ui) 235
-             239:      6(int) Load 133(ic1D)
-             242:    241(ptr) ImageTexelPointer 238(ii1D) 239 0
-             244:      6(int) AtomicIAdd 242 243 235 240
+             187:  126(fvec4) ImageRead 185 186
+             188:  126(fvec4) Load 128(v)
+             189:  126(fvec4) FAdd 188 187
+                              Store 128(v) 189
+             190:          68 Load 70(i1DArray)
+             191:   27(ivec2) Load 143(ic2D)
+             192:  126(fvec4) Load 128(v)
+                              ImageWrite 190 191 192
+             193:          78 Load 80(i2DArray)
+             194:    7(ivec3) Load 153(ic3D)
+             195:  126(fvec4) ImageRead 193 194
+             196:  126(fvec4) Load 128(v)
+             197:  126(fvec4) FAdd 196 195
+                              Store 128(v) 197
+             198:          78 Load 80(i2DArray)
+             199:    7(ivec3) Load 153(ic3D)
+             200:  126(fvec4) Load 128(v)
+                              ImageWrite 198 199 200
+             201:          85 Load 87(iBuffer)
+             202:      6(int) Load 133(ic1D)
+             203:  126(fvec4) ImageRead 201 202
+             204:  126(fvec4) Load 128(v)
+             205:  126(fvec4) FAdd 204 203
+                              Store 128(v) 205
+             206:          85 Load 87(iBuffer)
+             207:      6(int) Load 133(ic1D)
+             208:  126(fvec4) Load 128(v)
+                              ImageWrite 206 207 208
+             209:          95 Load 97(i2DMS)
+             210:   27(ivec2) Load 143(ic2D)
+             212:  126(fvec4) ImageRead 209 210
+             213:  126(fvec4) Load 128(v)
+             214:  126(fvec4) FAdd 213 212
+                              Store 128(v) 214
+             215:          95 Load 97(i2DMS)
+             216:   27(ivec2) Load 143(ic2D)
+             218:  126(fvec4) Load 128(v)
+                              ImageWrite 215 216 217
+             219:         105 Load 107(i2DMSArray)
+             220:    7(ivec3) Load 153(ic3D)
+             222:  126(fvec4) ImageRead 219 220
+             223:  126(fvec4) Load 128(v)
+             224:  126(fvec4) FAdd 223 222
+                              Store 128(v) 224
+             225:         105 Load 107(i2DMSArray)
+             226:    7(ivec3) Load 153(ic3D)
+             228:  126(fvec4) Load 128(v)
+                              ImageWrite 225 226 227
+                              Store 231(ui) 232
+             236:      6(int) Load 133(ic1D)
+             239:    238(ptr) ImageTexelPointer 235(ii1D) 236 0
+             241:      6(int) AtomicIAdd 239 240 232 237
+             242:    7(ivec3) Load 9(iv)
+             243:      6(int) CompositeExtract 242 0
+             244:      6(int) IAdd 243 241
              245:    7(ivec3) Load 9(iv)
-             246:      6(int) CompositeExtract 245 0
-             247:      6(int) IAdd 246 244
-             248:    7(ivec3) Load 9(iv)
-             249:    7(ivec3) CompositeInsert 247 248 0
-                              Store 9(iv) 249
-             253:   27(ivec2) Load 143(ic2D)
-             256:    232(int) Load 255(value)
-             258:    257(ptr) ImageTexelPointer 252(ui2D) 253 0
-             259:    232(int) AtomicIAdd 258 243 235 256
-             260:    232(int) Load 234(ui)
-             261:    232(int) IAdd 260 259
-                              Store 234(ui) 261
-             262:      6(int) Load 133(ic1D)
-             264:    241(ptr) ImageTexelPointer 238(ii1D) 262 0
-             265:      6(int) AtomicSMin 264 243 235 263
+             246:    7(ivec3) CompositeInsert 244 245 0
+                              Store 9(iv) 246
+             250:   27(ivec2) Load 143(ic2D)
+             253:    229(int) Load 252(value)
+             255:    254(ptr) ImageTexelPointer 249(ui2D) 250 0
+             256:    229(int) AtomicIAdd 255 240 232 253
+             257:    229(int) Load 231(ui)
+             258:    229(int) IAdd 257 256
+                              Store 231(ui) 258
+             259:      6(int) Load 133(ic1D)
+             261:    238(ptr) ImageTexelPointer 235(ii1D) 259 0
+             262:      6(int) AtomicSMin 261 240 232 260
+             263:    7(ivec3) Load 9(iv)
+             264:      6(int) CompositeExtract 263 0
+             265:      6(int) IAdd 264 262
              266:    7(ivec3) Load 9(iv)
-             267:      6(int) CompositeExtract 266 0
-             268:      6(int) IAdd 267 265
-             269:    7(ivec3) Load 9(iv)
-             270:    7(ivec3) CompositeInsert 268 269 0
-                              Store 9(iv) 270
-             271:   27(ivec2) Load 143(ic2D)
-             272:    232(int) Load 255(value)
-             273:    257(ptr) ImageTexelPointer 252(ui2D) 271 0
-             274:    232(int) AtomicUMin 273 243 235 272
-             275:    232(int) Load 234(ui)
-             276:    232(int) IAdd 275 274
-                              Store 234(ui) 276
-             277:      6(int) Load 133(ic1D)
-             279:    241(ptr) ImageTexelPointer 238(ii1D) 277 0
-             280:      6(int) AtomicSMax 279 243 235 278
+             267:    7(ivec3) CompositeInsert 265 266 0
+                              Store 9(iv) 267
+             268:   27(ivec2) Load 143(ic2D)
+             269:    229(int) Load 252(value)
+             270:    254(ptr) ImageTexelPointer 249(ui2D) 268 0
+             271:    229(int) AtomicUMin 270 240 232 269
+             272:    229(int) Load 231(ui)
+             273:    229(int) IAdd 272 271
+                              Store 231(ui) 273
+             274:      6(int) Load 133(ic1D)
+             276:    238(ptr) ImageTexelPointer 235(ii1D) 274 0
+             277:      6(int) AtomicSMax 276 240 232 275
+             278:    7(ivec3) Load 9(iv)
+             279:      6(int) CompositeExtract 278 0
+             280:      6(int) IAdd 279 277
              281:    7(ivec3) Load 9(iv)
-             282:      6(int) CompositeExtract 281 0
-             283:      6(int) IAdd 282 280
-             284:    7(ivec3) Load 9(iv)
-             285:    7(ivec3) CompositeInsert 283 284 0
-                              Store 9(iv) 285
-             286:   27(ivec2) Load 143(ic2D)
-             287:    232(int) Load 255(value)
-             288:    257(ptr) ImageTexelPointer 252(ui2D) 286 0
-             289:    232(int) AtomicUMax 288 243 235 287
-             290:    232(int) Load 234(ui)
-             291:    232(int) IAdd 290 289
-                              Store 234(ui) 291
-             292:      6(int) Load 133(ic1D)
-             294:    241(ptr) ImageTexelPointer 238(ii1D) 292 0
-             295:      6(int) AtomicAnd 294 243 235 293
+             282:    7(ivec3) CompositeInsert 280 281 0
+                              Store 9(iv) 282
+             283:   27(ivec2) Load 143(ic2D)
+             284:    229(int) Load 252(value)
+             285:    254(ptr) ImageTexelPointer 249(ui2D) 283 0
+             286:    229(int) AtomicUMax 285 240 232 284
+             287:    229(int) Load 231(ui)
+             288:    229(int) IAdd 287 286
+                              Store 231(ui) 288
+             289:      6(int) Load 133(ic1D)
+             291:    238(ptr) ImageTexelPointer 235(ii1D) 289 0
+             292:      6(int) AtomicAnd 291 240 232 290
+             293:    7(ivec3) Load 9(iv)
+             294:      6(int) CompositeExtract 293 0
+             295:      6(int) IAdd 294 292
              296:    7(ivec3) Load 9(iv)
-             297:      6(int) CompositeExtract 296 0
-             298:      6(int) IAdd 297 295
-             299:    7(ivec3) Load 9(iv)
-             300:    7(ivec3) CompositeInsert 298 299 0
-                              Store 9(iv) 300
-             301:   27(ivec2) Load 143(ic2D)
-             302:    232(int) Load 255(value)
-             303:    257(ptr) ImageTexelPointer 252(ui2D) 301 0
-             304:    232(int) AtomicAnd 303 243 235 302
-             305:    232(int) Load 234(ui)
-             306:    232(int) IAdd 305 304
-                              Store 234(ui) 306
-             307:      6(int) Load 133(ic1D)
-             309:    241(ptr) ImageTexelPointer 238(ii1D) 307 0
-             310:      6(int) AtomicOr 309 243 235 308
+             297:    7(ivec3) CompositeInsert 295 296 0
+                              Store 9(iv) 297
+             298:   27(ivec2) Load 143(ic2D)
+             299:    229(int) Load 252(value)
+             300:    254(ptr) ImageTexelPointer 249(ui2D) 298 0
+             301:    229(int) AtomicAnd 300 240 232 299
+             302:    229(int) Load 231(ui)
+             303:    229(int) IAdd 302 301
+                              Store 231(ui) 303
+             304:      6(int) Load 133(ic1D)
+             306:    238(ptr) ImageTexelPointer 235(ii1D) 304 0
+             307:      6(int) AtomicOr 306 240 232 305
+             308:    7(ivec3) Load 9(iv)
+             309:      6(int) CompositeExtract 308 0
+             310:      6(int) IAdd 309 307
              311:    7(ivec3) Load 9(iv)
-             312:      6(int) CompositeExtract 311 0
-             313:      6(int) IAdd 312 310
-             314:    7(ivec3) Load 9(iv)
-             315:    7(ivec3) CompositeInsert 313 314 0
-                              Store 9(iv) 315
-             316:   27(ivec2) Load 143(ic2D)
-             317:    232(int) Load 255(value)
-             318:    257(ptr) ImageTexelPointer 252(ui2D) 316 0
-             319:    232(int) AtomicOr 318 243 235 317
-             320:    232(int) Load 234(ui)
-             321:    232(int) IAdd 320 319
-                              Store 234(ui) 321
-             322:      6(int) Load 133(ic1D)
-             324:    241(ptr) ImageTexelPointer 238(ii1D) 322 0
-             325:      6(int) AtomicXor 324 243 235 323
+             312:    7(ivec3) CompositeInsert 310 311 0
+                              Store 9(iv) 312
+             313:   27(ivec2) Load 143(ic2D)
+             314:    229(int) Load 252(value)
+             315:    254(ptr) ImageTexelPointer 249(ui2D) 313 0
+             316:    229(int) AtomicOr 315 240 232 314
+             317:    229(int) Load 231(ui)
+             318:    229(int) IAdd 317 316
+                              Store 231(ui) 318
+             319:      6(int) Load 133(ic1D)
+             321:    238(ptr) ImageTexelPointer 235(ii1D) 319 0
+             322:      6(int) AtomicXor 321 240 232 320
+             323:    7(ivec3) Load 9(iv)
+             324:      6(int) CompositeExtract 323 0
+             325:      6(int) IAdd 324 322
              326:    7(ivec3) Load 9(iv)
-             327:      6(int) CompositeExtract 326 0
-             328:      6(int) IAdd 327 325
-             329:    7(ivec3) Load 9(iv)
-             330:    7(ivec3) CompositeInsert 328 329 0
-                              Store 9(iv) 330
-             331:   27(ivec2) Load 143(ic2D)
-             332:    232(int) Load 255(value)
-             333:    257(ptr) ImageTexelPointer 252(ui2D) 331 0
-             334:    232(int) AtomicXor 333 243 235 332
-             335:    232(int) Load 234(ui)
-             336:    232(int) IAdd 335 334
-                              Store 234(ui) 336
-             337:      6(int) Load 133(ic1D)
-             339:    241(ptr) ImageTexelPointer 238(ii1D) 337 0
-             340:      6(int) AtomicExchange 339 243 235 338
+             327:    7(ivec3) CompositeInsert 325 326 0
+                              Store 9(iv) 327
+             328:   27(ivec2) Load 143(ic2D)
+             329:    229(int) Load 252(value)
+             330:    254(ptr) ImageTexelPointer 249(ui2D) 328 0
+             331:    229(int) AtomicXor 330 240 232 329
+             332:    229(int) Load 231(ui)
+             333:    229(int) IAdd 332 331
+                              Store 231(ui) 333
+             334:      6(int) Load 133(ic1D)
+             336:    238(ptr) ImageTexelPointer 235(ii1D) 334 0
+             337:      6(int) AtomicExchange 336 240 232 335
+             338:    7(ivec3) Load 9(iv)
+             339:      6(int) CompositeExtract 338 0
+             340:      6(int) IAdd 339 337
              341:    7(ivec3) Load 9(iv)
-             342:      6(int) CompositeExtract 341 0
-             343:      6(int) IAdd 342 340
-             344:    7(ivec3) Load 9(iv)
-             345:    7(ivec3) CompositeInsert 343 344 0
-                              Store 9(iv) 345
-             346:   27(ivec2) Load 143(ic2D)
-             347:    232(int) Load 255(value)
-             348:    257(ptr) ImageTexelPointer 252(ui2D) 346 0
-             349:    232(int) AtomicExchange 348 243 235 347
-             350:    232(int) Load 234(ui)
-             351:    232(int) IAdd 350 349
-                              Store 234(ui) 351
-             352:      6(int) Load 133(ic1D)
-             355:    241(ptr) ImageTexelPointer 238(ii1D) 352 0
-             356:      6(int) AtomicCompareExchange 355 243 235 235 354 353
+             342:    7(ivec3) CompositeInsert 340 341 0
+                              Store 9(iv) 342
+             343:   27(ivec2) Load 143(ic2D)
+             344:    229(int) Load 252(value)
+             345:    254(ptr) ImageTexelPointer 249(ui2D) 343 0
+             346:    229(int) AtomicExchange 345 240 232 344
+             347:    229(int) Load 231(ui)
+             348:    229(int) IAdd 347 346
+                              Store 231(ui) 348
+             349:      6(int) Load 133(ic1D)
+             352:    238(ptr) ImageTexelPointer 235(ii1D) 349 0
+             353:      6(int) AtomicCompareExchange 352 240 232 232 351 350
+             354:    7(ivec3) Load 9(iv)
+             355:      6(int) CompositeExtract 354 0
+             356:      6(int) IAdd 355 353
              357:    7(ivec3) Load 9(iv)
-             358:      6(int) CompositeExtract 357 0
-             359:      6(int) IAdd 358 356
-             360:    7(ivec3) Load 9(iv)
-             361:    7(ivec3) CompositeInsert 359 360 0
-                              Store 9(iv) 361
-             362:   27(ivec2) Load 143(ic2D)
-             364:    232(int) Load 255(value)
-             365:    257(ptr) ImageTexelPointer 252(ui2D) 362 0
-             366:    232(int) AtomicCompareExchange 365 243 235 235 364 363
-             367:    232(int) Load 234(ui)
-             368:    232(int) IAdd 367 366
-                              Store 234(ui) 368
-             372:    232(int) Load 234(ui)
-             373:    7(ivec3) Load 9(iv)
-             374:      6(int) CompositeExtract 373 1
-             375:    232(int) Bitcast 374
-             377:   376(bool) INotEqual 372 375
-                              SelectionMerge 379 None
-                              BranchConditional 377 378 381
+             358:    7(ivec3) CompositeInsert 356 357 0
+                              Store 9(iv) 358
+             359:   27(ivec2) Load 143(ic2D)
+             361:    229(int) Load 252(value)
+             362:    254(ptr) ImageTexelPointer 249(ui2D) 359 0
+             363:    229(int) AtomicCompareExchange 362 240 232 232 361 360
+             364:    229(int) Load 231(ui)
+             365:    229(int) IAdd 364 363
+                              Store 231(ui) 365
+             369:    229(int) Load 231(ui)
+             370:    7(ivec3) Load 9(iv)
+             371:      6(int) CompositeExtract 370 1
+             372:    229(int) Bitcast 371
+             374:   373(bool) INotEqual 369 372
+                              SelectionMerge 376 None
+                              BranchConditional 374 375 378
+             375:               Label
+             377:  126(fvec4)   Load 128(v)
+                                Store 368 377
+                                Branch 376
              378:               Label
-             380:  126(fvec4)   Load 128(v)
-                                Store 371 380
-                                Branch 379
-             381:               Label
-                                Store 371 130
-                                Branch 379
-             379:             Label
-             382:  126(fvec4) Load 371
-                              Store 370(fragData) 382
+                                Store 368 130
+                                Branch 376
+             376:             Label
+             379:  126(fvec4) Load 368
+                              Store 367(fragData) 379
                               Return
                               FunctionEnd
diff --git a/Test/spv.image.frag b/Test/spv.image.frag
index 21269ea63..2ced0acfb 100644
--- a/Test/spv.image.frag
+++ b/Test/spv.image.frag
@@ -51,8 +51,8 @@ void main()
     imageStore(i3D, ic3D, v);
     v += imageLoad(iCube, ic3D);
     imageStore(iCube, ic3D, v);
-    v += imageLoad(iCubeArray, ic4D);
-    imageStore(iCubeArray, ic4D, v);
+    v += imageLoad(iCubeArray, ic3D);
+    imageStore(iCubeArray, ic3D, v);
     v += imageLoad(i2DRect, ic2D);
     imageStore(i2DRect, ic2D, v);
     v += imageLoad(i1DArray, ic2D);
diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h
index d3f11caaf..414cf210c 100644
--- a/glslang/Include/revision.h
+++ b/glslang/Include/revision.h
@@ -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 "3.0.776"
-#define GLSLANG_DATE "30-Sep-2015"
+#define GLSLANG_REVISION "3.0.777"
+#define GLSLANG_DATE "01-Oct-2015"
diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp
index df7ab84d8..e1676200d 100644
--- a/glslang/MachineIndependent/Initialize.cpp
+++ b/glslang/MachineIndependent/Initialize.cpp
@@ -2024,7 +2024,11 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int versi
 //
 void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int version, EProfile profile)
 {
-    int dims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0);
+    int dims = dimMap[sampler.dim];
+    // most things with an array add a dimension, except for cubemaps
+    if (sampler.arrayed && sampler.dim != EsdCube)
+        ++dims;
+
     TString imageParams = typeName;
     if (dims == 1)
         imageParams.append(", int");
-- 
GitLab