Branimir Karadžić 8 лет назад
Родитель
Сommit
5a07b3184a
55 измененных файлов с 3586 добавлено и 1690 удалено
  1. 9 5
      3rdparty/glslang/SPIRV/GlslangToSpv.cpp
  2. 6 4
      3rdparty/glslang/SPIRV/SpvBuilder.cpp
  3. 1 1
      3rdparty/glslang/SPIRV/SpvBuilder.h
  4. 4 0
      3rdparty/glslang/Test/150.vert
  5. 5 0
      3rdparty/glslang/Test/450.vert
  6. 67 67
      3rdparty/glslang/Test/baseResults/150.vert.out
  7. 4 1
      3rdparty/glslang/Test/baseResults/450.vert.out
  8. 10 2
      3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out
  9. 610 0
      3rdparty/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
  10. 784 702
      3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out
  11. 39 27
      3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out
  12. 270 270
      3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
  13. 53 22
      3rdparty/glslang/Test/baseResults/hlsl.if.frag.out
  14. 11 7
      3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out
  15. 59 55
      3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out
  16. 10 2
      3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out
  17. 10 2
      3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out
  18. 10 2
      3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out
  19. 246 0
      3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out
  20. 373 0
      3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out
  21. 199 0
      3rdparty/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out
  22. 11 2
      3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out
  23. 10 2
      3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out
  24. 92 92
      3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out
  25. 66 0
      3rdparty/glslang/Test/baseResults/spv.pushConstantAnon.vert.out
  26. 1 2
      3rdparty/glslang/Test/baseResults/vulkan.frag.out
  27. 68 65
      3rdparty/glslang/Test/hlsl.gathercmpRGBA.offset.dx10.frag
  28. 2 0
      3rdparty/glslang/Test/hlsl.if.frag
  29. 15 0
      3rdparty/glslang/Test/hlsl.semantic.geom
  30. 15 0
      3rdparty/glslang/Test/hlsl.semantic.vert
  31. 22 0
      3rdparty/glslang/Test/hlsl.staticMemberFunction.frag
  32. 5 4
      3rdparty/glslang/Test/hlsl.structbuffer.fn.frag
  33. 17 0
      3rdparty/glslang/Test/spv.pushConstantAnon.vert
  34. 1 1
      3rdparty/glslang/Test/vulkan.frag
  35. 1 0
      3rdparty/glslang/glslang/Include/BaseTypes.h
  36. 1 0
      3rdparty/glslang/glslang/Include/intermediate.h
  37. 2 2
      3rdparty/glslang/glslang/Include/revision.h
  38. 4 4
      3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
  39. 1 4
      3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
  40. 4 0
      3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
  41. 13 0
      3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
  42. 2 0
      3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp
  43. 6 0
      3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
  44. 2 0
      3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h
  45. 4 0
      3rdparty/glslang/gtests/Hlsl.FromFile.cpp
  46. 1 0
      3rdparty/glslang/gtests/Spv.FromFile.cpp
  47. 212 96
      3rdparty/glslang/hlsl/hlslGrammar.cpp
  48. 9 5
      3rdparty/glslang/hlsl/hlslGrammar.h
  49. 2 0
      3rdparty/glslang/hlsl/hlslOpMap.cpp
  50. 122 236
      3rdparty/glslang/hlsl/hlslParseHelper.cpp
  51. 7 3
      3rdparty/glslang/hlsl/hlslParseHelper.h
  52. 85 2
      3rdparty/glslang/hlsl/hlslScanContext.cpp
  53. 1 0
      3rdparty/glslang/hlsl/hlslScanContext.h
  54. 1 0
      3rdparty/glslang/hlsl/hlslTokenStream.h
  55. 1 1
      3rdparty/glslang/hlsl/hlslTokens.h

+ 9 - 5
3rdparty/glslang/SPIRV/GlslangToSpv.cpp

@@ -2922,6 +2922,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
     glslang::TCrackedTextureOp cracked;
     node->crackTexture(sampler, cracked);
 
+    const bool isUnsignedResult =
+        node->getType().getBasicType() == glslang::EbtUint64 ||
+        node->getType().getBasicType() == glslang::EbtUint;
+
     // Check for queries
     if (cracked.query) {
         // OpImageQueryLod works on a sampled image, for other queries the image has to be extracted first
@@ -2933,17 +2937,17 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
         case glslang::EOpTextureQuerySize:
             if (arguments.size() > 1) {
                 params.lod = arguments[1];
-                return builder.createTextureQueryCall(spv::OpImageQuerySizeLod, params);
+                return builder.createTextureQueryCall(spv::OpImageQuerySizeLod, params, isUnsignedResult);
             } else
-                return builder.createTextureQueryCall(spv::OpImageQuerySize, params);
+                return builder.createTextureQueryCall(spv::OpImageQuerySize, params, isUnsignedResult);
         case glslang::EOpImageQuerySamples:
         case glslang::EOpTextureQuerySamples:
-            return builder.createTextureQueryCall(spv::OpImageQuerySamples, params);
+            return builder.createTextureQueryCall(spv::OpImageQuerySamples, params, isUnsignedResult);
         case glslang::EOpTextureQueryLod:
             params.coords = arguments[1];
-            return builder.createTextureQueryCall(spv::OpImageQueryLod, params);
+            return builder.createTextureQueryCall(spv::OpImageQueryLod, params, isUnsignedResult);
         case glslang::EOpTextureQueryLevels:
-            return builder.createTextureQueryCall(spv::OpImageQueryLevels, params);
+            return builder.createTextureQueryCall(spv::OpImageQueryLevels, params, isUnsignedResult);
         case glslang::EOpSparseTexelsResident:
             return builder.createUnaryOp(spv::OpImageSparseTexelsResident, builder.makeBoolType(), arguments[0]);
         default:

+ 6 - 4
3rdparty/glslang/SPIRV/SpvBuilder.cpp

@@ -1662,7 +1662,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
 }
 
 // Comments in header
-Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters)
+Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters, bool isUnsignedResult)
 {
     // All these need a capability
     addCapability(CapabilityImageQuery);
@@ -1695,10 +1695,12 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter
         }
         if (isArrayedImageType(getImageType(parameters.sampler)))
             ++numComponents;
+
+        Id intType = isUnsignedResult ? makeUintType(32) : makeIntType(32);
         if (numComponents == 1)
-            resultType = makeIntType(32);
+            resultType = intType;
         else
-            resultType = makeVectorType(makeIntType(32), numComponents);
+            resultType = makeVectorType(intType, numComponents);
 
         break;
     }
@@ -1707,7 +1709,7 @@ Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameter
         break;
     case OpImageQueryLevels:
     case OpImageQuerySamples:
-        resultType = makeIntType(32);
+        resultType = isUnsignedResult ? makeUintType(32) : makeIntType(32);
         break;
     default:
         assert(0);

+ 1 - 1
3rdparty/glslang/SPIRV/SpvBuilder.h

@@ -335,7 +335,7 @@ public:
 
     // Emit the OpTextureQuery* instruction that was passed in.
     // Figure out the right return value and type, and return it.
-    Id createTextureQueryCall(Op, const TextureParameters&);
+    Id createTextureQueryCall(Op, const TextureParameters&, bool isUnsignedResult);
 
     Id createSamplePositionCall(Decoration precision, Id, Id);
 

+ 4 - 0
3rdparty/glslang/Test/150.vert

@@ -1,5 +1,9 @@
 #version 150 core
 
+#ifndef GL_core_profile
+#	error standard macro GL_core_profile not defined
+#endif
+
 in vec4 iv4;
 
 uniform float ps;

+ 5 - 0
3rdparty/glslang/Test/450.vert

@@ -21,3 +21,8 @@ struct SA { float f[4]; };
 out SA outSA;
 struct SS { float f; S s; };
 out SS outSS;
+
+void foo()
+{
+    SS::f;
+}

+ 67 - 67
3rdparty/glslang/Test/baseResults/150.vert.out

@@ -1,44 +1,44 @@
 150.vert
-ERROR: 0:22: 'a' : cannot redeclare a user-block member array 
+ERROR: 0:26: 'a' : cannot redeclare a user-block member array 
 ERROR: 0:3001: '#error' : line of this error should be 3001  
 ERROR: 2 compilation errors.  No code generated.
 
 
 Shader version: 150
 ERROR: node is still EOpNull!
-0:9  Function Definition: main( (global void)
-0:9    Function Parameters: 
-0:11    Sequence
-0:11      move second child to first child (temp 4-component vector of float)
-0:11        gl_Position: direct index for structure (invariant gl_Position 4-component vector of float Position)
-0:11          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
-0:11          Constant:
-0:11            0 (const uint)
-0:11        'iv4' (in 4-component vector of float)
-0:12      move second child to first child (temp float)
-0:12        gl_PointSize: direct index for structure (gl_PointSize float PointSize)
-0:12          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
-0:12          Constant:
-0:12            1 (const uint)
-0:12        'ps' (uniform float)
-0:13      move second child to first child (temp float)
-0:13        direct index (temp float ClipDistance)
-0:13          gl_ClipDistance: direct index for structure (out 4-element array of float ClipDistance)
-0:13            'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
-0:13            Constant:
-0:13              2 (const uint)
-0:13          Constant:
-0:13            2 (const int)
-0:13        direct index (temp float)
-0:13          'iv4' (in 4-component vector of float)
-0:13          Constant:
-0:13            0 (const int)
-0:14      move second child to first child (temp 4-component vector of float)
-0:14        gl_ClipVertex: direct index for structure (gl_ClipVertex 4-component vector of float ClipVertex)
-0:14          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
-0:14          Constant:
-0:14            3 (const uint)
-0:14        'iv4' (in 4-component vector of float)
+0:13  Function Definition: main( (global void)
+0:13    Function Parameters: 
+0:15    Sequence
+0:15      move second child to first child (temp 4-component vector of float)
+0:15        gl_Position: direct index for structure (invariant gl_Position 4-component vector of float Position)
+0:15          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
+0:15          Constant:
+0:15            0 (const uint)
+0:15        'iv4' (in 4-component vector of float)
+0:16      move second child to first child (temp float)
+0:16        gl_PointSize: direct index for structure (gl_PointSize float PointSize)
+0:16          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
+0:16          Constant:
+0:16            1 (const uint)
+0:16        'ps' (uniform float)
+0:17      move second child to first child (temp float)
+0:17        direct index (temp float ClipDistance)
+0:17          gl_ClipDistance: direct index for structure (out 4-element array of float ClipDistance)
+0:17            'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
+0:17            Constant:
+0:17              2 (const uint)
+0:17          Constant:
+0:17            2 (const int)
+0:17        direct index (temp float)
+0:17          'iv4' (in 4-component vector of float)
+0:17          Constant:
+0:17            0 (const int)
+0:18      move second child to first child (temp 4-component vector of float)
+0:18        gl_ClipVertex: direct index for structure (gl_ClipVertex 4-component vector of float ClipVertex)
+0:18          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
+0:18          Constant:
+0:18            3 (const uint)
+0:18        'iv4' (in 4-component vector of float)
 0:?   Linker Objects
 0:?     'iv4' (in 4-component vector of float)
 0:?     'ps' (uniform float)
@@ -53,39 +53,39 @@ ERROR: Linking vertex stage: Can only use one of gl_ClipDistance or gl_ClipVerte
 
 Shader version: 150
 ERROR: node is still EOpNull!
-0:9  Function Definition: main( (global void)
-0:9    Function Parameters: 
-0:11    Sequence
-0:11      move second child to first child (temp 4-component vector of float)
-0:11        gl_Position: direct index for structure (invariant gl_Position 4-component vector of float Position)
-0:11          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
-0:11          Constant:
-0:11            0 (const uint)
-0:11        'iv4' (in 4-component vector of float)
-0:12      move second child to first child (temp float)
-0:12        gl_PointSize: direct index for structure (gl_PointSize float PointSize)
-0:12          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
-0:12          Constant:
-0:12            1 (const uint)
-0:12        'ps' (uniform float)
-0:13      move second child to first child (temp float)
-0:13        direct index (temp float ClipDistance)
-0:13          gl_ClipDistance: direct index for structure (out 4-element array of float ClipDistance)
-0:13            'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
-0:13            Constant:
-0:13              2 (const uint)
-0:13          Constant:
-0:13            2 (const int)
-0:13        direct index (temp float)
-0:13          'iv4' (in 4-component vector of float)
-0:13          Constant:
-0:13            0 (const int)
-0:14      move second child to first child (temp 4-component vector of float)
-0:14        gl_ClipVertex: direct index for structure (gl_ClipVertex 4-component vector of float ClipVertex)
-0:14          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
-0:14          Constant:
-0:14            3 (const uint)
-0:14        'iv4' (in 4-component vector of float)
+0:13  Function Definition: main( (global void)
+0:13    Function Parameters: 
+0:15    Sequence
+0:15      move second child to first child (temp 4-component vector of float)
+0:15        gl_Position: direct index for structure (invariant gl_Position 4-component vector of float Position)
+0:15          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
+0:15          Constant:
+0:15            0 (const uint)
+0:15        'iv4' (in 4-component vector of float)
+0:16      move second child to first child (temp float)
+0:16        gl_PointSize: direct index for structure (gl_PointSize float PointSize)
+0:16          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
+0:16          Constant:
+0:16            1 (const uint)
+0:16        'ps' (uniform float)
+0:17      move second child to first child (temp float)
+0:17        direct index (temp float ClipDistance)
+0:17          gl_ClipDistance: direct index for structure (out 4-element array of float ClipDistance)
+0:17            'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
+0:17            Constant:
+0:17              2 (const uint)
+0:17          Constant:
+0:17            2 (const int)
+0:17        direct index (temp float)
+0:17          'iv4' (in 4-component vector of float)
+0:17          Constant:
+0:17            0 (const int)
+0:18      move second child to first child (temp 4-component vector of float)
+0:18        gl_ClipVertex: direct index for structure (gl_ClipVertex 4-component vector of float ClipVertex)
+0:18          'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 4-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
+0:18          Constant:
+0:18            3 (const uint)
+0:18        'iv4' (in 4-component vector of float)
 0:?   Linker Objects
 0:?     'iv4' (in 4-component vector of float)
 0:?     'ps' (uniform float)

+ 4 - 1
3rdparty/glslang/Test/baseResults/450.vert.out

@@ -2,7 +2,8 @@
 Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
 ERROR: 0:12: 'out' : cannot be bool 
 ERROR: 0:13: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: outo
-ERROR: 2 compilation errors.  No code generated.
+ERROR: 0:27: '::' : not supported 
+ERROR: 3 compilation errors.  No code generated.
 
 
 Shader version: 450
@@ -20,6 +21,8 @@ ERROR: node is still EOpNull!
 0:9            2 (const int)
 0:9        Constant:
 0:9          4.500000
+0:25  Function Definition: foo( (global void)
+0:25    Function Parameters: 
 0:?   Linker Objects
 0:?     'anon@0' (out block{out 3-element array of float CullDistance gl_CullDistance})
 0:?     'outb' (smooth out bool)

+ 10 - 2
3rdparty/glslang/Test/baseResults/hlsl.gather.basic.dx10.vert.out

@@ -105,6 +105,7 @@ Shader version: 450
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 
 
 Linked vertex stage:
@@ -216,16 +217,17 @@ Shader version: 450
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 126
+// Id's are bound by 129
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 103
+                              EntryPoint Vertex 4  "main" 103 128
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
                               MemberName 8(VS_OUTPUT) 0  "Pos"
@@ -253,6 +255,8 @@ Shader version: 450
                               Name 119  "g_tTex3df4"
                               Name 122  "g_tTex3di4"
                               Name 125  "g_tTex3du4"
+                              Name 126  "VS_OUTPUT"
+                              Name 128  "@entryPointOutput"
                               Decorate 16(g_tTex2df4) DescriptorSet 0
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
@@ -272,6 +276,7 @@ Shader version: 450
                               Decorate 119(g_tTex3df4) DescriptorSet 0
                               Decorate 122(g_tTex3di4) DescriptorSet 0
                               Decorate 125(g_tTex3du4) DescriptorSet 0
+                              Decorate 128(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -355,6 +360,9 @@ Shader version: 450
              123:             TypeImage 45(int) 3D sampled format:Unknown
              124:             TypePointer UniformConstant 123
  125(g_tTex3du4):    124(ptr) Variable UniformConstant
+  126(VS_OUTPUT):             TypeStruct
+             127:             TypePointer Output 126(VS_OUTPUT)
+128(@entryPointOutput):    127(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
              104:8(VS_OUTPUT) FunctionCall 10(@main()

+ 610 - 0
3rdparty/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out

@@ -0,0 +1,610 @@
+hlsl.gathercmpRGBA.offset.dx10.frag
+Shader version: 450
+gl_FragCoord origin is upper left
+0:? Sequence
+0:38  Function Definition: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38    Function Parameters: 
+0:?     Sequence
+0:45      Sequence
+0:45        move second child to first child (temp 4-component vector of float)
+0:45          'txval001' (temp 4-component vector of float)
+0:45          textureGatherOffset (temp 4-component vector of float)
+0:45            Construct combined texture-sampler (temp sampler2DShadow)
+0:45              'g_tTex2df4' (uniform texture2D)
+0:45              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:45            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:45              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:45              Constant:
+0:45                1 (const uint)
+0:45            Constant:
+0:45              0.750000
+0:?             Constant:
+0:?               1 (const int)
+0:?               0 (const int)
+0:45            Constant:
+0:45              0 (const int)
+0:46      Sequence
+0:46        move second child to first child (temp 4-component vector of int)
+0:46          'txval011' (temp 4-component vector of int)
+0:46          textureGatherOffset (temp 4-component vector of int)
+0:46            Construct combined texture-sampler (temp isampler2DShadow)
+0:46              'g_tTex2di4' (uniform itexture2D)
+0:46              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:46            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:46              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:46              Constant:
+0:46                1 (const uint)
+0:46            Constant:
+0:46              0.750000
+0:?             Constant:
+0:?               1 (const int)
+0:?               -1 (const int)
+0:46            Constant:
+0:46              0 (const int)
+0:47      Sequence
+0:47        move second child to first child (temp 4-component vector of uint)
+0:47          'txval021' (temp 4-component vector of uint)
+0:47          textureGatherOffset (temp 4-component vector of uint)
+0:47            Construct combined texture-sampler (temp usampler2DShadow)
+0:47              'g_tTex2du4' (uniform utexture2D)
+0:47              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:47            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:47              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:47              Constant:
+0:47                1 (const uint)
+0:47            Constant:
+0:47              0.750000
+0:?             Constant:
+0:?               1 (const int)
+0:?               1 (const int)
+0:47            Constant:
+0:47              0 (const int)
+0:49      Sequence
+0:49        move second child to first child (temp 4-component vector of float)
+0:49          'txval004' (temp 4-component vector of float)
+0:49          textureGatherOffsets (temp 4-component vector of float)
+0:49            Construct combined texture-sampler (temp sampler2DShadow)
+0:49              'g_tTex2df4' (uniform texture2D)
+0:49              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:49            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:49              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:49              Constant:
+0:49                1 (const uint)
+0:49            Constant:
+0:49              0.750000
+0:49            Constant:
+0:49              1 (const int)
+0:49              0 (const int)
+0:49              1 (const int)
+0:49              0 (const int)
+0:49              1 (const int)
+0:49              0 (const int)
+0:49              1 (const int)
+0:49              0 (const int)
+0:49            Constant:
+0:49              0 (const int)
+0:50      Sequence
+0:50        move second child to first child (temp 4-component vector of int)
+0:50          'txval014' (temp 4-component vector of int)
+0:50          textureGatherOffsets (temp 4-component vector of int)
+0:50            Construct combined texture-sampler (temp isampler2DShadow)
+0:50              'g_tTex2di4' (uniform itexture2D)
+0:50              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:50            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:50              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:50              Constant:
+0:50                1 (const uint)
+0:50            Constant:
+0:50              0.750000
+0:50            Constant:
+0:50              1 (const int)
+0:50              -1 (const int)
+0:50              1 (const int)
+0:50              -1 (const int)
+0:50              1 (const int)
+0:50              -1 (const int)
+0:50              1 (const int)
+0:50              -1 (const int)
+0:50            Constant:
+0:50              0 (const int)
+0:51      Sequence
+0:51        move second child to first child (temp 4-component vector of uint)
+0:51          'txval024' (temp 4-component vector of uint)
+0:51          textureGatherOffsets (temp 4-component vector of uint)
+0:51            Construct combined texture-sampler (temp usampler2DShadow)
+0:51              'g_tTex2du4' (uniform utexture2D)
+0:51              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:51            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:51              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:51              Constant:
+0:51                1 (const uint)
+0:51            Constant:
+0:51              0.750000
+0:51            Constant:
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51            Constant:
+0:51              0 (const int)
+0:114      move second child to first child (temp 4-component vector of float)
+0:114        Color: direct index for structure (temp 4-component vector of float)
+0:114          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:114          Constant:
+0:114            0 (const int)
+0:114        Constant:
+0:114          1.000000
+0:114          1.000000
+0:114          1.000000
+0:114          1.000000
+0:115      move second child to first child (temp float)
+0:115        Depth: direct index for structure (temp float)
+0:115          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:115          Constant:
+0:115            1 (const int)
+0:115        Constant:
+0:115          1.000000
+0:117      Branch: Return with expression
+0:117        'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38  Function Definition: main( (temp void)
+0:38    Function Parameters: 
+0:?     Sequence
+0:38      Sequence
+0:38        move second child to first child (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38          'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38          Function Call: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38        move second child to first child (temp 4-component vector of float)
+0:?           'Color' (layout(location=0 ) out 4-component vector of float)
+0:38          Color: direct index for structure (temp 4-component vector of float)
+0:38            'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38            Constant:
+0:38              0 (const int)
+0:38        move second child to first child (temp float)
+0:?           'Depth' (out float FragDepth)
+0:38          Depth: direct index for structure (temp float)
+0:38            'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38            Constant:
+0:38              1 (const int)
+0:?   Linker Objects
+0:?     'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
+0:?     'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:?     'g_tTex1di4' (uniform itexture1D)
+0:?     'g_tTex1du4' (uniform utexture1D)
+0:?     'g_tTex2df4' (uniform texture2D)
+0:?     'g_tTex2di4' (uniform itexture2D)
+0:?     'g_tTex2du4' (uniform utexture2D)
+0:?     'g_tTex3df4' (uniform texture3D)
+0:?     'g_tTex3di4' (uniform itexture3D)
+0:?     'g_tTex3du4' (uniform utexture3D)
+0:?     'g_tTexcdf4' (uniform textureCube)
+0:?     'g_tTexcdi4' (uniform itextureCube)
+0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
+0:?     'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+
+
+Linked fragment stage:
+
+
+Shader version: 450
+gl_FragCoord origin is upper left
+0:? Sequence
+0:38  Function Definition: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38    Function Parameters: 
+0:?     Sequence
+0:45      Sequence
+0:45        move second child to first child (temp 4-component vector of float)
+0:45          'txval001' (temp 4-component vector of float)
+0:45          textureGatherOffset (temp 4-component vector of float)
+0:45            Construct combined texture-sampler (temp sampler2DShadow)
+0:45              'g_tTex2df4' (uniform texture2D)
+0:45              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:45            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:45              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:45              Constant:
+0:45                1 (const uint)
+0:45            Constant:
+0:45              0.750000
+0:?             Constant:
+0:?               1 (const int)
+0:?               0 (const int)
+0:45            Constant:
+0:45              0 (const int)
+0:46      Sequence
+0:46        move second child to first child (temp 4-component vector of int)
+0:46          'txval011' (temp 4-component vector of int)
+0:46          textureGatherOffset (temp 4-component vector of int)
+0:46            Construct combined texture-sampler (temp isampler2DShadow)
+0:46              'g_tTex2di4' (uniform itexture2D)
+0:46              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:46            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:46              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:46              Constant:
+0:46                1 (const uint)
+0:46            Constant:
+0:46              0.750000
+0:?             Constant:
+0:?               1 (const int)
+0:?               -1 (const int)
+0:46            Constant:
+0:46              0 (const int)
+0:47      Sequence
+0:47        move second child to first child (temp 4-component vector of uint)
+0:47          'txval021' (temp 4-component vector of uint)
+0:47          textureGatherOffset (temp 4-component vector of uint)
+0:47            Construct combined texture-sampler (temp usampler2DShadow)
+0:47              'g_tTex2du4' (uniform utexture2D)
+0:47              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:47            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:47              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:47              Constant:
+0:47                1 (const uint)
+0:47            Constant:
+0:47              0.750000
+0:?             Constant:
+0:?               1 (const int)
+0:?               1 (const int)
+0:47            Constant:
+0:47              0 (const int)
+0:49      Sequence
+0:49        move second child to first child (temp 4-component vector of float)
+0:49          'txval004' (temp 4-component vector of float)
+0:49          textureGatherOffsets (temp 4-component vector of float)
+0:49            Construct combined texture-sampler (temp sampler2DShadow)
+0:49              'g_tTex2df4' (uniform texture2D)
+0:49              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:49            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:49              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:49              Constant:
+0:49                1 (const uint)
+0:49            Constant:
+0:49              0.750000
+0:49            Constant:
+0:49              1 (const int)
+0:49              0 (const int)
+0:49              1 (const int)
+0:49              0 (const int)
+0:49              1 (const int)
+0:49              0 (const int)
+0:49              1 (const int)
+0:49              0 (const int)
+0:49            Constant:
+0:49              0 (const int)
+0:50      Sequence
+0:50        move second child to first child (temp 4-component vector of int)
+0:50          'txval014' (temp 4-component vector of int)
+0:50          textureGatherOffsets (temp 4-component vector of int)
+0:50            Construct combined texture-sampler (temp isampler2DShadow)
+0:50              'g_tTex2di4' (uniform itexture2D)
+0:50              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:50            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:50              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:50              Constant:
+0:50                1 (const uint)
+0:50            Constant:
+0:50              0.750000
+0:50            Constant:
+0:50              1 (const int)
+0:50              -1 (const int)
+0:50              1 (const int)
+0:50              -1 (const int)
+0:50              1 (const int)
+0:50              -1 (const int)
+0:50              1 (const int)
+0:50              -1 (const int)
+0:50            Constant:
+0:50              0 (const int)
+0:51      Sequence
+0:51        move second child to first child (temp 4-component vector of uint)
+0:51          'txval024' (temp 4-component vector of uint)
+0:51          textureGatherOffsets (temp 4-component vector of uint)
+0:51            Construct combined texture-sampler (temp usampler2DShadow)
+0:51              'g_tTex2du4' (uniform utexture2D)
+0:51              'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:51            c2: direct index for structure (layout(offset=8 ) uniform 2-component vector of float)
+0:51              'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+0:51              Constant:
+0:51                1 (const uint)
+0:51            Constant:
+0:51              0.750000
+0:51            Constant:
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51              1 (const int)
+0:51            Constant:
+0:51              0 (const int)
+0:114      move second child to first child (temp 4-component vector of float)
+0:114        Color: direct index for structure (temp 4-component vector of float)
+0:114          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:114          Constant:
+0:114            0 (const int)
+0:114        Constant:
+0:114          1.000000
+0:114          1.000000
+0:114          1.000000
+0:114          1.000000
+0:115      move second child to first child (temp float)
+0:115        Depth: direct index for structure (temp float)
+0:115          'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:115          Constant:
+0:115            1 (const int)
+0:115        Constant:
+0:115          1.000000
+0:117      Branch: Return with expression
+0:117        'psout' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38  Function Definition: main( (temp void)
+0:38    Function Parameters: 
+0:?     Sequence
+0:38      Sequence
+0:38        move second child to first child (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38          'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38          Function Call: @main( (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38        move second child to first child (temp 4-component vector of float)
+0:?           'Color' (layout(location=0 ) out 4-component vector of float)
+0:38          Color: direct index for structure (temp 4-component vector of float)
+0:38            'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38            Constant:
+0:38              0 (const int)
+0:38        move second child to first child (temp float)
+0:?           'Depth' (out float FragDepth)
+0:38          Depth: direct index for structure (temp float)
+0:38            'flattenTemp' (temp structure{temp 4-component vector of float Color, temp float Depth})
+0:38            Constant:
+0:38              1 (const int)
+0:?   Linker Objects
+0:?     'g_sSampCmp' (layout(binding=0 ) uniform sampler)
+0:?     'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
+0:?     'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:?     'g_tTex1di4' (uniform itexture1D)
+0:?     'g_tTex1du4' (uniform utexture1D)
+0:?     'g_tTex2df4' (uniform texture2D)
+0:?     'g_tTex2di4' (uniform itexture2D)
+0:?     'g_tTex2du4' (uniform utexture2D)
+0:?     'g_tTex3df4' (uniform texture3D)
+0:?     'g_tTex3di4' (uniform itexture3D)
+0:?     'g_tTex3du4' (uniform utexture3D)
+0:?     'g_tTexcdf4' (uniform textureCube)
+0:?     'g_tTexcdi4' (uniform itextureCube)
+0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     'Color' (layout(location=0 ) out 4-component vector of float)
+0:?     'Depth' (out float FragDepth)
+0:?     'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform float c1, layout(offset=8 ) uniform 2-component vector of float c2, layout(offset=16 ) uniform 3-component vector of float c3, layout(offset=32 ) uniform 4-component vector of float c4})
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 146
+
+                              Capability Shader
+                              Capability Sampled1D
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 111 115
+                              ExecutionMode 4 OriginUpperLeft
+                              Name 4  "main"
+                              Name 8  "PS_OUTPUT"
+                              MemberName 8(PS_OUTPUT) 0  "Color"
+                              MemberName 8(PS_OUTPUT) 1  "Depth"
+                              Name 10  "@main("
+                              Name 13  "txval001"
+                              Name 16  "g_tTex2df4"
+                              Name 20  "g_sSampCmp"
+                              Name 27  "$Global"
+                              MemberName 27($Global) 0  "c1"
+                              MemberName 27($Global) 1  "c2"
+                              MemberName 27($Global) 2  "c3"
+                              MemberName 27($Global) 3  "c4"
+                              Name 29  ""
+                              Name 42  "txval011"
+                              Name 45  "g_tTex2di4"
+                              Name 59  "txval021"
+                              Name 62  "g_tTex2du4"
+                              Name 72  "txval004"
+                              Name 82  "txval014"
+                              Name 90  "txval024"
+                              Name 99  "psout"
+                              Name 108  "flattenTemp"
+                              Name 111  "Color"
+                              Name 115  "Depth"
+                              Name 120  "g_tTex1df4a"
+                              Name 121  "g_tTex1df4"
+                              Name 124  "g_tTex1di4"
+                              Name 127  "g_tTex1du4"
+                              Name 130  "g_tTex3df4"
+                              Name 133  "g_tTex3di4"
+                              Name 136  "g_tTex3du4"
+                              Name 139  "g_tTexcdf4"
+                              Name 142  "g_tTexcdi4"
+                              Name 145  "g_tTexcdu4"
+                              Decorate 16(g_tTex2df4) DescriptorSet 0
+                              Decorate 20(g_sSampCmp) DescriptorSet 0
+                              Decorate 20(g_sSampCmp) Binding 0
+                              MemberDecorate 27($Global) 0 Offset 0
+                              MemberDecorate 27($Global) 1 Offset 8
+                              MemberDecorate 27($Global) 2 Offset 16
+                              MemberDecorate 27($Global) 3 Offset 32
+                              Decorate 27($Global) Block
+                              Decorate 29 DescriptorSet 0
+                              Decorate 45(g_tTex2di4) DescriptorSet 0
+                              Decorate 62(g_tTex2du4) DescriptorSet 0
+                              Decorate 111(Color) Location 0
+                              Decorate 115(Depth) BuiltIn FragDepth
+                              Decorate 120(g_tTex1df4a) DescriptorSet 0
+                              Decorate 120(g_tTex1df4a) Binding 1
+                              Decorate 121(g_tTex1df4) DescriptorSet 0
+                              Decorate 121(g_tTex1df4) Binding 0
+                              Decorate 124(g_tTex1di4) DescriptorSet 0
+                              Decorate 127(g_tTex1du4) DescriptorSet 0
+                              Decorate 130(g_tTex3df4) DescriptorSet 0
+                              Decorate 133(g_tTex3di4) DescriptorSet 0
+                              Decorate 136(g_tTex3du4) DescriptorSet 0
+                              Decorate 139(g_tTexcdf4) DescriptorSet 0
+                              Decorate 142(g_tTexcdi4) DescriptorSet 0
+                              Decorate 145(g_tTexcdu4) DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+    8(PS_OUTPUT):             TypeStruct 7(fvec4) 6(float)
+               9:             TypeFunction 8(PS_OUTPUT)
+              12:             TypePointer Function 7(fvec4)
+              14:             TypeImage 6(float) 2D sampled format:Unknown
+              15:             TypePointer UniformConstant 14
+  16(g_tTex2df4):     15(ptr) Variable UniformConstant
+              18:             TypeSampler
+              19:             TypePointer UniformConstant 18
+  20(g_sSampCmp):     19(ptr) Variable UniformConstant
+              22:             TypeImage 6(float) 2D depth sampled format:Unknown
+              23:             TypeSampledImage 22
+              25:             TypeVector 6(float) 2
+              26:             TypeVector 6(float) 3
+     27($Global):             TypeStruct 6(float) 25(fvec2) 26(fvec3) 7(fvec4)
+              28:             TypePointer Uniform 27($Global)
+              29:     28(ptr) Variable Uniform
+              30:             TypeInt 32 1
+              31:     30(int) Constant 1
+              32:             TypePointer Uniform 25(fvec2)
+              35:    6(float) Constant 1061158912
+              36:             TypeVector 30(int) 2
+              37:     30(int) Constant 0
+              38:   36(ivec2) ConstantComposite 31 37
+              40:             TypeVector 30(int) 4
+              41:             TypePointer Function 40(ivec4)
+              43:             TypeImage 30(int) 2D sampled format:Unknown
+              44:             TypePointer UniformConstant 43
+  45(g_tTex2di4):     44(ptr) Variable UniformConstant
+              48:             TypeImage 30(int) 2D depth sampled format:Unknown
+              49:             TypeSampledImage 48
+              53:     30(int) Constant 4294967295
+              54:   36(ivec2) ConstantComposite 31 53
+              56:             TypeInt 32 0
+              57:             TypeVector 56(int) 4
+              58:             TypePointer Function 57(ivec4)
+              60:             TypeImage 56(int) 2D sampled format:Unknown
+              61:             TypePointer UniformConstant 60
+  62(g_tTex2du4):     61(ptr) Variable UniformConstant
+              65:             TypeImage 56(int) 2D depth sampled format:Unknown
+              66:             TypeSampledImage 65
+              70:   36(ivec2) ConstantComposite 31 31
+              78:     56(int) Constant 4
+              79:             TypeArray 36(ivec2) 78
+              80:          79 ConstantComposite 38 38 38 38
+              88:          79 ConstantComposite 54 54 54 54
+              96:          79 ConstantComposite 70 70 70 70
+              98:             TypePointer Function 8(PS_OUTPUT)
+             100:    6(float) Constant 1065353216
+             101:    7(fvec4) ConstantComposite 100 100 100 100
+             103:             TypePointer Function 6(float)
+             110:             TypePointer Output 7(fvec4)
+      111(Color):    110(ptr) Variable Output
+             114:             TypePointer Output 6(float)
+      115(Depth):    114(ptr) Variable Output
+             118:             TypeImage 6(float) 1D sampled format:Unknown
+             119:             TypePointer UniformConstant 118
+120(g_tTex1df4a):    119(ptr) Variable UniformConstant
+ 121(g_tTex1df4):    119(ptr) Variable UniformConstant
+             122:             TypeImage 30(int) 1D sampled format:Unknown
+             123:             TypePointer UniformConstant 122
+ 124(g_tTex1di4):    123(ptr) Variable UniformConstant
+             125:             TypeImage 56(int) 1D sampled format:Unknown
+             126:             TypePointer UniformConstant 125
+ 127(g_tTex1du4):    126(ptr) Variable UniformConstant
+             128:             TypeImage 6(float) 3D sampled format:Unknown
+             129:             TypePointer UniformConstant 128
+ 130(g_tTex3df4):    129(ptr) Variable UniformConstant
+             131:             TypeImage 30(int) 3D sampled format:Unknown
+             132:             TypePointer UniformConstant 131
+ 133(g_tTex3di4):    132(ptr) Variable UniformConstant
+             134:             TypeImage 56(int) 3D sampled format:Unknown
+             135:             TypePointer UniformConstant 134
+ 136(g_tTex3du4):    135(ptr) Variable UniformConstant
+             137:             TypeImage 6(float) Cube sampled format:Unknown
+             138:             TypePointer UniformConstant 137
+ 139(g_tTexcdf4):    138(ptr) Variable UniformConstant
+             140:             TypeImage 30(int) Cube sampled format:Unknown
+             141:             TypePointer UniformConstant 140
+ 142(g_tTexcdi4):    141(ptr) Variable UniformConstant
+             143:             TypeImage 56(int) Cube sampled format:Unknown
+             144:             TypePointer UniformConstant 143
+ 145(g_tTexcdu4):    144(ptr) Variable UniformConstant
+         4(main):           2 Function None 3
+               5:             Label
+108(flattenTemp):     98(ptr) Variable Function
+             109:8(PS_OUTPUT) FunctionCall 10(@main()
+                              Store 108(flattenTemp) 109
+             112:     12(ptr) AccessChain 108(flattenTemp) 37
+             113:    7(fvec4) Load 112
+                              Store 111(Color) 113
+             116:    103(ptr) AccessChain 108(flattenTemp) 31
+             117:    6(float) Load 116
+                              Store 115(Depth) 117
+                              Return
+                              FunctionEnd
+      10(@main():8(PS_OUTPUT) Function None 9
+              11:             Label
+    13(txval001):     12(ptr) Variable Function
+    42(txval011):     41(ptr) Variable Function
+    59(txval021):     58(ptr) Variable Function
+    72(txval004):     12(ptr) Variable Function
+    82(txval014):     41(ptr) Variable Function
+    90(txval024):     58(ptr) Variable Function
+       99(psout):     98(ptr) Variable Function
+              17:          14 Load 16(g_tTex2df4)
+              21:          18 Load 20(g_sSampCmp)
+              24:          23 SampledImage 17 21
+              33:     32(ptr) AccessChain 29 31
+              34:   25(fvec2) Load 33
+              39:    7(fvec4) ImageDrefGather 24 34 35 ConstOffset 38
+                              Store 13(txval001) 39
+              46:          43 Load 45(g_tTex2di4)
+              47:          18 Load 20(g_sSampCmp)
+              50:          49 SampledImage 46 47
+              51:     32(ptr) AccessChain 29 31
+              52:   25(fvec2) Load 51
+              55:   40(ivec4) ImageDrefGather 50 52 35 ConstOffset 54
+                              Store 42(txval011) 55
+              63:          60 Load 62(g_tTex2du4)
+              64:          18 Load 20(g_sSampCmp)
+              67:          66 SampledImage 63 64
+              68:     32(ptr) AccessChain 29 31
+              69:   25(fvec2) Load 68
+              71:   57(ivec4) ImageDrefGather 67 69 35 ConstOffset 70
+                              Store 59(txval021) 71
+              73:          14 Load 16(g_tTex2df4)
+              74:          18 Load 20(g_sSampCmp)
+              75:          23 SampledImage 73 74
+              76:     32(ptr) AccessChain 29 31
+              77:   25(fvec2) Load 76
+              81:    7(fvec4) ImageDrefGather 75 77 35 ConstOffsets 80
+                              Store 72(txval004) 81
+              83:          43 Load 45(g_tTex2di4)
+              84:          18 Load 20(g_sSampCmp)
+              85:          49 SampledImage 83 84
+              86:     32(ptr) AccessChain 29 31
+              87:   25(fvec2) Load 86
+              89:   40(ivec4) ImageDrefGather 85 87 35 ConstOffsets 88
+                              Store 82(txval014) 89
+              91:          60 Load 62(g_tTex2du4)
+              92:          18 Load 20(g_sSampCmp)
+              93:          66 SampledImage 91 92
+              94:     32(ptr) AccessChain 29 31
+              95:   25(fvec2) Load 94
+              97:   57(ivec4) ImageDrefGather 93 95 35 ConstOffsets 96
+                              Store 90(txval024) 97
+             102:     12(ptr) AccessChain 99(psout) 37
+                              Store 102 101
+             104:    103(ptr) AccessChain 99(psout) 31
+                              Store 104 100
+             105:8(PS_OUTPUT) Load 99(psout)
+                              ReturnValue 105
+                              FunctionEnd

+ 784 - 702
3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.frag.out

@@ -10,6 +10,8 @@ gl_FragCoord origin is upper left
 0:65          'sizeQueryTemp' (temp uint)
 0:65          textureSize (temp uint)
 0:65            'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:65            Constant:
+0:65              0 (const int)
 0:65        move second child to first child (temp uint)
 0:65          'WidthU' (temp uint)
 0:65          'sizeQueryTemp' (temp uint)
@@ -32,6 +34,8 @@ gl_FragCoord origin is upper left
 0:69          'sizeQueryTemp' (temp uint)
 0:69          textureSize (temp uint)
 0:69            'g_tTex1di4' (uniform itexture1D)
+0:69            Constant:
+0:69              0 (const int)
 0:69        move second child to first child (temp uint)
 0:69          'WidthU' (temp uint)
 0:69          'sizeQueryTemp' (temp uint)
@@ -54,6 +58,8 @@ gl_FragCoord origin is upper left
 0:73          'sizeQueryTemp' (temp uint)
 0:73          textureSize (temp uint)
 0:73            'g_tTex1du4' (uniform utexture1D)
+0:73            Constant:
+0:73              0 (const int)
 0:73        move second child to first child (temp uint)
 0:73          'WidthU' (temp uint)
 0:73          'sizeQueryTemp' (temp uint)
@@ -76,6 +82,8 @@ gl_FragCoord origin is upper left
 0:77          'sizeQueryTemp' (temp 2-component vector of uint)
 0:77          textureSize (temp 2-component vector of uint)
 0:77            'g_tTex1df4a' (uniform texture1DArray)
+0:77            Constant:
+0:77              0 (const int)
 0:77        move second child to first child (temp uint)
 0:77          'WidthU' (temp uint)
 0:77          direct index (temp uint)
@@ -116,6 +124,8 @@ gl_FragCoord origin is upper left
 0:81          'sizeQueryTemp' (temp 2-component vector of uint)
 0:81          textureSize (temp 2-component vector of uint)
 0:81            'g_tTex1di4a' (uniform itexture1DArray)
+0:81            Constant:
+0:81              0 (const int)
 0:81        move second child to first child (temp uint)
 0:81          'WidthU' (temp uint)
 0:81          direct index (temp uint)
@@ -156,6 +166,8 @@ gl_FragCoord origin is upper left
 0:85          'sizeQueryTemp' (temp 2-component vector of uint)
 0:85          textureSize (temp 2-component vector of uint)
 0:85            'g_tTex1du4a' (uniform utexture1DArray)
+0:85            Constant:
+0:85              0 (const int)
 0:85        move second child to first child (temp uint)
 0:85          'WidthU' (temp uint)
 0:85          direct index (temp uint)
@@ -196,6 +208,8 @@ gl_FragCoord origin is upper left
 0:89          'sizeQueryTemp' (temp 2-component vector of uint)
 0:89          textureSize (temp 2-component vector of uint)
 0:89            'g_tTex2df4' (uniform texture2D)
+0:89            Constant:
+0:89              0 (const int)
 0:89        move second child to first child (temp uint)
 0:89          'WidthU' (temp uint)
 0:89          direct index (temp uint)
@@ -236,6 +250,8 @@ gl_FragCoord origin is upper left
 0:93          'sizeQueryTemp' (temp 2-component vector of uint)
 0:93          textureSize (temp 2-component vector of uint)
 0:93            'g_tTex2di4' (uniform itexture2D)
+0:93            Constant:
+0:93              0 (const int)
 0:93        move second child to first child (temp uint)
 0:93          'WidthU' (temp uint)
 0:93          direct index (temp uint)
@@ -276,6 +292,8 @@ gl_FragCoord origin is upper left
 0:97          'sizeQueryTemp' (temp 2-component vector of uint)
 0:97          textureSize (temp 2-component vector of uint)
 0:97            'g_tTex2du4' (uniform utexture2D)
+0:97            Constant:
+0:97              0 (const int)
 0:97        move second child to first child (temp uint)
 0:97          'WidthU' (temp uint)
 0:97          direct index (temp uint)
@@ -316,6 +334,8 @@ gl_FragCoord origin is upper left
 0:101          'sizeQueryTemp' (temp 3-component vector of uint)
 0:101          textureSize (temp 3-component vector of uint)
 0:101            'g_tTex2df4a' (uniform texture2DArray)
+0:101            Constant:
+0:101              0 (const int)
 0:101        move second child to first child (temp uint)
 0:101          'WidthU' (temp uint)
 0:101          direct index (temp uint)
@@ -368,6 +388,8 @@ gl_FragCoord origin is upper left
 0:105          'sizeQueryTemp' (temp 3-component vector of uint)
 0:105          textureSize (temp 3-component vector of uint)
 0:105            'g_tTex2di4a' (uniform itexture2DArray)
+0:105            Constant:
+0:105              0 (const int)
 0:105        move second child to first child (temp uint)
 0:105          'WidthU' (temp uint)
 0:105          direct index (temp uint)
@@ -420,6 +442,8 @@ gl_FragCoord origin is upper left
 0:109          'sizeQueryTemp' (temp 3-component vector of uint)
 0:109          textureSize (temp 3-component vector of uint)
 0:109            'g_tTex2du4a' (uniform utexture2DArray)
+0:109            Constant:
+0:109              0 (const int)
 0:109        move second child to first child (temp uint)
 0:109          'WidthU' (temp uint)
 0:109          direct index (temp uint)
@@ -472,6 +496,8 @@ gl_FragCoord origin is upper left
 0:113          'sizeQueryTemp' (temp 3-component vector of uint)
 0:113          textureSize (temp 3-component vector of uint)
 0:113            'g_tTex3df4' (uniform texture3D)
+0:113            Constant:
+0:113              0 (const int)
 0:113        move second child to first child (temp uint)
 0:113          'WidthU' (temp uint)
 0:113          direct index (temp uint)
@@ -524,6 +550,8 @@ gl_FragCoord origin is upper left
 0:117          'sizeQueryTemp' (temp 3-component vector of uint)
 0:117          textureSize (temp 3-component vector of uint)
 0:117            'g_tTex3di4' (uniform itexture3D)
+0:117            Constant:
+0:117              0 (const int)
 0:117        move second child to first child (temp uint)
 0:117          'WidthU' (temp uint)
 0:117          direct index (temp uint)
@@ -576,6 +604,8 @@ gl_FragCoord origin is upper left
 0:121          'sizeQueryTemp' (temp 3-component vector of uint)
 0:121          textureSize (temp 3-component vector of uint)
 0:121            'g_tTex3du4' (uniform utexture3D)
+0:121            Constant:
+0:121              0 (const int)
 0:121        move second child to first child (temp uint)
 0:121          'WidthU' (temp uint)
 0:121          direct index (temp uint)
@@ -628,6 +658,8 @@ gl_FragCoord origin is upper left
 0:125          'sizeQueryTemp' (temp 2-component vector of uint)
 0:125          textureSize (temp 2-component vector of uint)
 0:125            'g_tTexcdf4' (uniform textureCube)
+0:125            Constant:
+0:125              0 (const int)
 0:125        move second child to first child (temp uint)
 0:125          'WidthU' (temp uint)
 0:125          direct index (temp uint)
@@ -668,6 +700,8 @@ gl_FragCoord origin is upper left
 0:129          'sizeQueryTemp' (temp 2-component vector of uint)
 0:129          textureSize (temp 2-component vector of uint)
 0:129            'g_tTexcdi4' (uniform itextureCube)
+0:129            Constant:
+0:129              0 (const int)
 0:129        move second child to first child (temp uint)
 0:129          'WidthU' (temp uint)
 0:129          direct index (temp uint)
@@ -708,6 +742,8 @@ gl_FragCoord origin is upper left
 0:133          'sizeQueryTemp' (temp 2-component vector of uint)
 0:133          textureSize (temp 2-component vector of uint)
 0:133            'g_tTexcdu4' (uniform utextureCube)
+0:133            Constant:
+0:133              0 (const int)
 0:133        move second child to first child (temp uint)
 0:133          'WidthU' (temp uint)
 0:133          direct index (temp uint)
@@ -748,6 +784,8 @@ gl_FragCoord origin is upper left
 0:137          'sizeQueryTemp' (temp 3-component vector of uint)
 0:137          textureSize (temp 3-component vector of uint)
 0:137            'g_tTexcdf4a' (uniform textureCubeArray)
+0:137            Constant:
+0:137              0 (const int)
 0:137        move second child to first child (temp uint)
 0:137          'WidthU' (temp uint)
 0:137          direct index (temp uint)
@@ -800,6 +838,8 @@ gl_FragCoord origin is upper left
 0:141          'sizeQueryTemp' (temp 3-component vector of uint)
 0:141          textureSize (temp 3-component vector of uint)
 0:141            'g_tTexcdi4a' (uniform itextureCubeArray)
+0:141            Constant:
+0:141              0 (const int)
 0:141        move second child to first child (temp uint)
 0:141          'WidthU' (temp uint)
 0:141          direct index (temp uint)
@@ -852,6 +892,8 @@ gl_FragCoord origin is upper left
 0:145          'sizeQueryTemp' (temp 3-component vector of uint)
 0:145          textureSize (temp 3-component vector of uint)
 0:145            'g_tTexcdu4a' (uniform utextureCubeArray)
+0:145            Constant:
+0:145              0 (const int)
 0:145        move second child to first child (temp uint)
 0:145          'WidthU' (temp uint)
 0:145          direct index (temp uint)
@@ -1128,6 +1170,8 @@ gl_FragCoord origin is upper left
 0:65          'sizeQueryTemp' (temp uint)
 0:65          textureSize (temp uint)
 0:65            'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:65            Constant:
+0:65              0 (const int)
 0:65        move second child to first child (temp uint)
 0:65          'WidthU' (temp uint)
 0:65          'sizeQueryTemp' (temp uint)
@@ -1150,6 +1194,8 @@ gl_FragCoord origin is upper left
 0:69          'sizeQueryTemp' (temp uint)
 0:69          textureSize (temp uint)
 0:69            'g_tTex1di4' (uniform itexture1D)
+0:69            Constant:
+0:69              0 (const int)
 0:69        move second child to first child (temp uint)
 0:69          'WidthU' (temp uint)
 0:69          'sizeQueryTemp' (temp uint)
@@ -1172,6 +1218,8 @@ gl_FragCoord origin is upper left
 0:73          'sizeQueryTemp' (temp uint)
 0:73          textureSize (temp uint)
 0:73            'g_tTex1du4' (uniform utexture1D)
+0:73            Constant:
+0:73              0 (const int)
 0:73        move second child to first child (temp uint)
 0:73          'WidthU' (temp uint)
 0:73          'sizeQueryTemp' (temp uint)
@@ -1194,6 +1242,8 @@ gl_FragCoord origin is upper left
 0:77          'sizeQueryTemp' (temp 2-component vector of uint)
 0:77          textureSize (temp 2-component vector of uint)
 0:77            'g_tTex1df4a' (uniform texture1DArray)
+0:77            Constant:
+0:77              0 (const int)
 0:77        move second child to first child (temp uint)
 0:77          'WidthU' (temp uint)
 0:77          direct index (temp uint)
@@ -1234,6 +1284,8 @@ gl_FragCoord origin is upper left
 0:81          'sizeQueryTemp' (temp 2-component vector of uint)
 0:81          textureSize (temp 2-component vector of uint)
 0:81            'g_tTex1di4a' (uniform itexture1DArray)
+0:81            Constant:
+0:81              0 (const int)
 0:81        move second child to first child (temp uint)
 0:81          'WidthU' (temp uint)
 0:81          direct index (temp uint)
@@ -1274,6 +1326,8 @@ gl_FragCoord origin is upper left
 0:85          'sizeQueryTemp' (temp 2-component vector of uint)
 0:85          textureSize (temp 2-component vector of uint)
 0:85            'g_tTex1du4a' (uniform utexture1DArray)
+0:85            Constant:
+0:85              0 (const int)
 0:85        move second child to first child (temp uint)
 0:85          'WidthU' (temp uint)
 0:85          direct index (temp uint)
@@ -1314,6 +1368,8 @@ gl_FragCoord origin is upper left
 0:89          'sizeQueryTemp' (temp 2-component vector of uint)
 0:89          textureSize (temp 2-component vector of uint)
 0:89            'g_tTex2df4' (uniform texture2D)
+0:89            Constant:
+0:89              0 (const int)
 0:89        move second child to first child (temp uint)
 0:89          'WidthU' (temp uint)
 0:89          direct index (temp uint)
@@ -1354,6 +1410,8 @@ gl_FragCoord origin is upper left
 0:93          'sizeQueryTemp' (temp 2-component vector of uint)
 0:93          textureSize (temp 2-component vector of uint)
 0:93            'g_tTex2di4' (uniform itexture2D)
+0:93            Constant:
+0:93              0 (const int)
 0:93        move second child to first child (temp uint)
 0:93          'WidthU' (temp uint)
 0:93          direct index (temp uint)
@@ -1394,6 +1452,8 @@ gl_FragCoord origin is upper left
 0:97          'sizeQueryTemp' (temp 2-component vector of uint)
 0:97          textureSize (temp 2-component vector of uint)
 0:97            'g_tTex2du4' (uniform utexture2D)
+0:97            Constant:
+0:97              0 (const int)
 0:97        move second child to first child (temp uint)
 0:97          'WidthU' (temp uint)
 0:97          direct index (temp uint)
@@ -1434,6 +1494,8 @@ gl_FragCoord origin is upper left
 0:101          'sizeQueryTemp' (temp 3-component vector of uint)
 0:101          textureSize (temp 3-component vector of uint)
 0:101            'g_tTex2df4a' (uniform texture2DArray)
+0:101            Constant:
+0:101              0 (const int)
 0:101        move second child to first child (temp uint)
 0:101          'WidthU' (temp uint)
 0:101          direct index (temp uint)
@@ -1486,6 +1548,8 @@ gl_FragCoord origin is upper left
 0:105          'sizeQueryTemp' (temp 3-component vector of uint)
 0:105          textureSize (temp 3-component vector of uint)
 0:105            'g_tTex2di4a' (uniform itexture2DArray)
+0:105            Constant:
+0:105              0 (const int)
 0:105        move second child to first child (temp uint)
 0:105          'WidthU' (temp uint)
 0:105          direct index (temp uint)
@@ -1538,6 +1602,8 @@ gl_FragCoord origin is upper left
 0:109          'sizeQueryTemp' (temp 3-component vector of uint)
 0:109          textureSize (temp 3-component vector of uint)
 0:109            'g_tTex2du4a' (uniform utexture2DArray)
+0:109            Constant:
+0:109              0 (const int)
 0:109        move second child to first child (temp uint)
 0:109          'WidthU' (temp uint)
 0:109          direct index (temp uint)
@@ -1590,6 +1656,8 @@ gl_FragCoord origin is upper left
 0:113          'sizeQueryTemp' (temp 3-component vector of uint)
 0:113          textureSize (temp 3-component vector of uint)
 0:113            'g_tTex3df4' (uniform texture3D)
+0:113            Constant:
+0:113              0 (const int)
 0:113        move second child to first child (temp uint)
 0:113          'WidthU' (temp uint)
 0:113          direct index (temp uint)
@@ -1642,6 +1710,8 @@ gl_FragCoord origin is upper left
 0:117          'sizeQueryTemp' (temp 3-component vector of uint)
 0:117          textureSize (temp 3-component vector of uint)
 0:117            'g_tTex3di4' (uniform itexture3D)
+0:117            Constant:
+0:117              0 (const int)
 0:117        move second child to first child (temp uint)
 0:117          'WidthU' (temp uint)
 0:117          direct index (temp uint)
@@ -1694,6 +1764,8 @@ gl_FragCoord origin is upper left
 0:121          'sizeQueryTemp' (temp 3-component vector of uint)
 0:121          textureSize (temp 3-component vector of uint)
 0:121            'g_tTex3du4' (uniform utexture3D)
+0:121            Constant:
+0:121              0 (const int)
 0:121        move second child to first child (temp uint)
 0:121          'WidthU' (temp uint)
 0:121          direct index (temp uint)
@@ -1746,6 +1818,8 @@ gl_FragCoord origin is upper left
 0:125          'sizeQueryTemp' (temp 2-component vector of uint)
 0:125          textureSize (temp 2-component vector of uint)
 0:125            'g_tTexcdf4' (uniform textureCube)
+0:125            Constant:
+0:125              0 (const int)
 0:125        move second child to first child (temp uint)
 0:125          'WidthU' (temp uint)
 0:125          direct index (temp uint)
@@ -1786,6 +1860,8 @@ gl_FragCoord origin is upper left
 0:129          'sizeQueryTemp' (temp 2-component vector of uint)
 0:129          textureSize (temp 2-component vector of uint)
 0:129            'g_tTexcdi4' (uniform itextureCube)
+0:129            Constant:
+0:129              0 (const int)
 0:129        move second child to first child (temp uint)
 0:129          'WidthU' (temp uint)
 0:129          direct index (temp uint)
@@ -1826,6 +1902,8 @@ gl_FragCoord origin is upper left
 0:133          'sizeQueryTemp' (temp 2-component vector of uint)
 0:133          textureSize (temp 2-component vector of uint)
 0:133            'g_tTexcdu4' (uniform utextureCube)
+0:133            Constant:
+0:133              0 (const int)
 0:133        move second child to first child (temp uint)
 0:133          'WidthU' (temp uint)
 0:133          direct index (temp uint)
@@ -1866,6 +1944,8 @@ gl_FragCoord origin is upper left
 0:137          'sizeQueryTemp' (temp 3-component vector of uint)
 0:137          textureSize (temp 3-component vector of uint)
 0:137            'g_tTexcdf4a' (uniform textureCubeArray)
+0:137            Constant:
+0:137              0 (const int)
 0:137        move second child to first child (temp uint)
 0:137          'WidthU' (temp uint)
 0:137          direct index (temp uint)
@@ -1918,6 +1998,8 @@ gl_FragCoord origin is upper left
 0:141          'sizeQueryTemp' (temp 3-component vector of uint)
 0:141          textureSize (temp 3-component vector of uint)
 0:141            'g_tTexcdi4a' (uniform itextureCubeArray)
+0:141            Constant:
+0:141              0 (const int)
 0:141        move second child to first child (temp uint)
 0:141          'WidthU' (temp uint)
 0:141          direct index (temp uint)
@@ -1970,6 +2052,8 @@ gl_FragCoord origin is upper left
 0:145          'sizeQueryTemp' (temp 3-component vector of uint)
 0:145          textureSize (temp 3-component vector of uint)
 0:145            'g_tTexcdu4a' (uniform utextureCubeArray)
+0:145            Constant:
+0:145              0 (const int)
 0:145        move second child to first child (temp uint)
 0:145          'WidthU' (temp uint)
 0:145          direct index (temp uint)
@@ -2233,7 +2317,7 @@ gl_FragCoord origin is upper left
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 552
+// Id's are bound by 550
 
                               Capability Shader
                               Capability Sampled1D
@@ -2242,7 +2326,7 @@ gl_FragCoord origin is upper left
                               Capability ImageQuery
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 542 546
+                              EntryPoint Fragment 4  "main" 540 544
                               ExecutionMode 4 OriginUpperLeft
                               Name 4  "main"
                               Name 8  "PS_OUTPUT"
@@ -2251,17 +2335,17 @@ gl_FragCoord origin is upper left
                               Name 10  "@main("
                               Name 14  "sizeQueryTemp"
                               Name 17  "g_tTex1df4"
-                              Name 21  "WidthU"
-                              Name 23  "sizeQueryTemp"
-                              Name 28  "NumberOfLevelsU"
-                              Name 31  "sizeQueryTemp"
-                              Name 34  "g_tTex1di4"
-                              Name 38  "sizeQueryTemp"
-                              Name 44  "sizeQueryTemp"
-                              Name 47  "g_tTex1du4"
-                              Name 51  "sizeQueryTemp"
-                              Name 59  "sizeQueryTemp"
-                              Name 62  "g_tTex1df4a"
+                              Name 22  "WidthU"
+                              Name 24  "sizeQueryTemp"
+                              Name 29  "NumberOfLevelsU"
+                              Name 32  "sizeQueryTemp"
+                              Name 35  "g_tTex1di4"
+                              Name 39  "sizeQueryTemp"
+                              Name 45  "sizeQueryTemp"
+                              Name 48  "g_tTex1du4"
+                              Name 52  "sizeQueryTemp"
+                              Name 60  "sizeQueryTemp"
+                              Name 63  "g_tTex1df4a"
                               Name 69  "ElementsU"
                               Name 73  "sizeQueryTemp"
                               Name 82  "sizeQueryTemp"
@@ -2282,91 +2366,91 @@ gl_FragCoord origin is upper left
                               Name 169  "sizeQueryTemp"
                               Name 180  "sizeQueryTemp"
                               Name 183  "g_tTex2df4a"
-                              Name 194  "sizeQueryTemp"
-                              Name 205  "sizeQueryTemp"
-                              Name 208  "g_tTex2di4a"
-                              Name 217  "sizeQueryTemp"
-                              Name 228  "sizeQueryTemp"
-                              Name 231  "g_tTex2du4a"
-                              Name 240  "sizeQueryTemp"
-                              Name 251  "sizeQueryTemp"
-                              Name 254  "g_tTex3df4"
-                              Name 261  "DepthU"
-                              Name 264  "sizeQueryTemp"
-                              Name 275  "sizeQueryTemp"
-                              Name 278  "g_tTex3di4"
-                              Name 287  "sizeQueryTemp"
-                              Name 298  "sizeQueryTemp"
-                              Name 301  "g_tTex3du4"
-                              Name 310  "sizeQueryTemp"
-                              Name 321  "sizeQueryTemp"
-                              Name 324  "g_tTexcdf4"
-                              Name 331  "sizeQueryTemp"
-                              Name 340  "sizeQueryTemp"
-                              Name 343  "g_tTexcdi4"
-                              Name 350  "sizeQueryTemp"
-                              Name 359  "sizeQueryTemp"
-                              Name 362  "g_tTexcdu4"
-                              Name 369  "sizeQueryTemp"
-                              Name 378  "sizeQueryTemp"
-                              Name 381  "g_tTexcdf4a"
-                              Name 390  "sizeQueryTemp"
-                              Name 401  "sizeQueryTemp"
-                              Name 404  "g_tTexcdi4a"
-                              Name 413  "sizeQueryTemp"
-                              Name 424  "sizeQueryTemp"
-                              Name 427  "g_tTexcdu4a"
-                              Name 436  "sizeQueryTemp"
-                              Name 447  "sizeQueryTemp"
-                              Name 450  "g_tTex2dmsf4"
-                              Name 457  "NumberOfSamplesU"
-                              Name 460  "sizeQueryTemp"
-                              Name 463  "g_tTex2dmsi4"
-                              Name 472  "sizeQueryTemp"
-                              Name 475  "g_tTex2dmsu4"
-                              Name 484  "sizeQueryTemp"
-                              Name 487  "g_tTex2dmsf4a"
-                              Name 498  "sizeQueryTemp"
-                              Name 501  "g_tTex2dmsi4a"
-                              Name 512  "sizeQueryTemp"
-                              Name 515  "g_tTex2dmsu4a"
-                              Name 527  "psout"
-                              Name 539  "flattenTemp"
-                              Name 542  "Color"
-                              Name 546  "Depth"
-                              Name 551  "g_sSamp"
+                              Name 193  "sizeQueryTemp"
+                              Name 204  "sizeQueryTemp"
+                              Name 207  "g_tTex2di4a"
+                              Name 216  "sizeQueryTemp"
+                              Name 227  "sizeQueryTemp"
+                              Name 230  "g_tTex2du4a"
+                              Name 239  "sizeQueryTemp"
+                              Name 250  "sizeQueryTemp"
+                              Name 253  "g_tTex3df4"
+                              Name 260  "DepthU"
+                              Name 263  "sizeQueryTemp"
+                              Name 274  "sizeQueryTemp"
+                              Name 277  "g_tTex3di4"
+                              Name 286  "sizeQueryTemp"
+                              Name 297  "sizeQueryTemp"
+                              Name 300  "g_tTex3du4"
+                              Name 309  "sizeQueryTemp"
+                              Name 320  "sizeQueryTemp"
+                              Name 323  "g_tTexcdf4"
+                              Name 330  "sizeQueryTemp"
+                              Name 339  "sizeQueryTemp"
+                              Name 342  "g_tTexcdi4"
+                              Name 349  "sizeQueryTemp"
+                              Name 358  "sizeQueryTemp"
+                              Name 361  "g_tTexcdu4"
+                              Name 368  "sizeQueryTemp"
+                              Name 377  "sizeQueryTemp"
+                              Name 380  "g_tTexcdf4a"
+                              Name 389  "sizeQueryTemp"
+                              Name 400  "sizeQueryTemp"
+                              Name 403  "g_tTexcdi4a"
+                              Name 412  "sizeQueryTemp"
+                              Name 423  "sizeQueryTemp"
+                              Name 426  "g_tTexcdu4a"
+                              Name 435  "sizeQueryTemp"
+                              Name 446  "sizeQueryTemp"
+                              Name 449  "g_tTex2dmsf4"
+                              Name 456  "NumberOfSamplesU"
+                              Name 459  "sizeQueryTemp"
+                              Name 462  "g_tTex2dmsi4"
+                              Name 471  "sizeQueryTemp"
+                              Name 474  "g_tTex2dmsu4"
+                              Name 483  "sizeQueryTemp"
+                              Name 486  "g_tTex2dmsf4a"
+                              Name 497  "sizeQueryTemp"
+                              Name 500  "g_tTex2dmsi4a"
+                              Name 511  "sizeQueryTemp"
+                              Name 514  "g_tTex2dmsu4a"
+                              Name 526  "psout"
+                              Name 537  "flattenTemp"
+                              Name 540  "Color"
+                              Name 544  "Depth"
+                              Name 549  "g_sSamp"
                               Decorate 17(g_tTex1df4) DescriptorSet 0
                               Decorate 17(g_tTex1df4) Binding 0
-                              Decorate 34(g_tTex1di4) DescriptorSet 0
-                              Decorate 47(g_tTex1du4) DescriptorSet 0
-                              Decorate 62(g_tTex1df4a) DescriptorSet 0
+                              Decorate 35(g_tTex1di4) DescriptorSet 0
+                              Decorate 48(g_tTex1du4) DescriptorSet 0
+                              Decorate 63(g_tTex1df4a) DescriptorSet 0
                               Decorate 85(g_tTex1di4a) DescriptorSet 0
                               Decorate 104(g_tTex1du4a) DescriptorSet 0
                               Decorate 123(g_tTex2df4) DescriptorSet 0
                               Decorate 143(g_tTex2di4) DescriptorSet 0
                               Decorate 162(g_tTex2du4) DescriptorSet 0
                               Decorate 183(g_tTex2df4a) DescriptorSet 0
-                              Decorate 208(g_tTex2di4a) DescriptorSet 0
-                              Decorate 231(g_tTex2du4a) DescriptorSet 0
-                              Decorate 254(g_tTex3df4) DescriptorSet 0
-                              Decorate 278(g_tTex3di4) DescriptorSet 0
-                              Decorate 301(g_tTex3du4) DescriptorSet 0
-                              Decorate 324(g_tTexcdf4) DescriptorSet 0
-                              Decorate 343(g_tTexcdi4) DescriptorSet 0
-                              Decorate 362(g_tTexcdu4) DescriptorSet 0
-                              Decorate 381(g_tTexcdf4a) DescriptorSet 0
-                              Decorate 404(g_tTexcdi4a) DescriptorSet 0
-                              Decorate 427(g_tTexcdu4a) DescriptorSet 0
-                              Decorate 450(g_tTex2dmsf4) DescriptorSet 0
-                              Decorate 463(g_tTex2dmsi4) DescriptorSet 0
-                              Decorate 475(g_tTex2dmsu4) DescriptorSet 0
-                              Decorate 487(g_tTex2dmsf4a) DescriptorSet 0
-                              Decorate 501(g_tTex2dmsi4a) DescriptorSet 0
-                              Decorate 515(g_tTex2dmsu4a) DescriptorSet 0
-                              Decorate 542(Color) Location 0
-                              Decorate 546(Depth) BuiltIn FragDepth
-                              Decorate 551(g_sSamp) DescriptorSet 0
-                              Decorate 551(g_sSamp) Binding 0
+                              Decorate 207(g_tTex2di4a) DescriptorSet 0
+                              Decorate 230(g_tTex2du4a) DescriptorSet 0
+                              Decorate 253(g_tTex3df4) DescriptorSet 0
+                              Decorate 277(g_tTex3di4) DescriptorSet 0
+                              Decorate 300(g_tTex3du4) DescriptorSet 0
+                              Decorate 323(g_tTexcdf4) DescriptorSet 0
+                              Decorate 342(g_tTexcdi4) DescriptorSet 0
+                              Decorate 361(g_tTexcdu4) DescriptorSet 0
+                              Decorate 380(g_tTexcdf4a) DescriptorSet 0
+                              Decorate 403(g_tTexcdi4a) DescriptorSet 0
+                              Decorate 426(g_tTexcdu4a) DescriptorSet 0
+                              Decorate 449(g_tTex2dmsf4) DescriptorSet 0
+                              Decorate 462(g_tTex2dmsi4) DescriptorSet 0
+                              Decorate 474(g_tTex2dmsu4) DescriptorSet 0
+                              Decorate 486(g_tTex2dmsf4a) DescriptorSet 0
+                              Decorate 500(g_tTex2dmsi4a) DescriptorSet 0
+                              Decorate 514(g_tTex2dmsu4a) DescriptorSet 0
+                              Decorate 540(Color) Location 0
+                              Decorate 544(Depth) BuiltIn FragDepth
+                              Decorate 549(g_sSamp) DescriptorSet 0
+                              Decorate 549(g_sSamp) Binding 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -2379,19 +2463,19 @@ gl_FragCoord origin is upper left
               16:             TypePointer UniformConstant 15
   17(g_tTex1df4):     16(ptr) Variable UniformConstant
               19:             TypeInt 32 1
-              25:     12(int) Constant 6
-              32:             TypeImage 19(int) 1D sampled format:Unknown
-              33:             TypePointer UniformConstant 32
-  34(g_tTex1di4):     33(ptr) Variable UniformConstant
-              45:             TypeImage 12(int) 1D sampled format:Unknown
-              46:             TypePointer UniformConstant 45
-  47(g_tTex1du4):     46(ptr) Variable UniformConstant
-              57:             TypeVector 12(int) 2
-              58:             TypePointer Function 57(ivec2)
-              60:             TypeImage 6(float) 1D array sampled format:Unknown
-              61:             TypePointer UniformConstant 60
- 62(g_tTex1df4a):     61(ptr) Variable UniformConstant
-              64:             TypeVector 19(int) 2
+              20:     19(int) Constant 0
+              26:     12(int) Constant 6
+              33:             TypeImage 19(int) 1D sampled format:Unknown
+              34:             TypePointer UniformConstant 33
+  35(g_tTex1di4):     34(ptr) Variable UniformConstant
+              46:             TypeImage 12(int) 1D sampled format:Unknown
+              47:             TypePointer UniformConstant 46
+  48(g_tTex1du4):     47(ptr) Variable UniformConstant
+              58:             TypeVector 12(int) 2
+              59:             TypePointer Function 58(ivec2)
+              61:             TypeImage 6(float) 1D array sampled format:Unknown
+              62:             TypePointer UniformConstant 61
+ 63(g_tTex1df4a):     62(ptr) Variable UniformConstant
               66:     12(int) Constant 0
               70:     12(int) Constant 1
               83:             TypeImage 19(int) 1D array sampled format:Unknown
@@ -2414,699 +2498,697 @@ gl_FragCoord origin is upper left
              181:             TypeImage 6(float) 2D array sampled format:Unknown
              182:             TypePointer UniformConstant 181
 183(g_tTex2df4a):    182(ptr) Variable UniformConstant
-             185:             TypeVector 19(int) 3
-             191:     12(int) Constant 2
-             206:             TypeImage 19(int) 2D array sampled format:Unknown
-             207:             TypePointer UniformConstant 206
-208(g_tTex2di4a):    207(ptr) Variable UniformConstant
-             229:             TypeImage 12(int) 2D array sampled format:Unknown
-             230:             TypePointer UniformConstant 229
-231(g_tTex2du4a):    230(ptr) Variable UniformConstant
-             252:             TypeImage 6(float) 3D sampled format:Unknown
-             253:             TypePointer UniformConstant 252
- 254(g_tTex3df4):    253(ptr) Variable UniformConstant
-             276:             TypeImage 19(int) 3D sampled format:Unknown
-             277:             TypePointer UniformConstant 276
- 278(g_tTex3di4):    277(ptr) Variable UniformConstant
-             299:             TypeImage 12(int) 3D sampled format:Unknown
-             300:             TypePointer UniformConstant 299
- 301(g_tTex3du4):    300(ptr) Variable UniformConstant
-             322:             TypeImage 6(float) Cube sampled format:Unknown
-             323:             TypePointer UniformConstant 322
- 324(g_tTexcdf4):    323(ptr) Variable UniformConstant
-             341:             TypeImage 19(int) Cube sampled format:Unknown
-             342:             TypePointer UniformConstant 341
- 343(g_tTexcdi4):    342(ptr) Variable UniformConstant
-             360:             TypeImage 12(int) Cube sampled format:Unknown
-             361:             TypePointer UniformConstant 360
- 362(g_tTexcdu4):    361(ptr) Variable UniformConstant
-             379:             TypeImage 6(float) Cube array sampled format:Unknown
-             380:             TypePointer UniformConstant 379
-381(g_tTexcdf4a):    380(ptr) Variable UniformConstant
-             402:             TypeImage 19(int) Cube array sampled format:Unknown
-             403:             TypePointer UniformConstant 402
-404(g_tTexcdi4a):    403(ptr) Variable UniformConstant
-             425:             TypeImage 12(int) Cube array sampled format:Unknown
-             426:             TypePointer UniformConstant 425
-427(g_tTexcdu4a):    426(ptr) Variable UniformConstant
-             448:             TypeImage 6(float) 2D multi-sampled sampled format:Unknown
-             449:             TypePointer UniformConstant 448
-450(g_tTex2dmsf4):    449(ptr) Variable UniformConstant
-             461:             TypeImage 19(int) 2D multi-sampled sampled format:Unknown
-             462:             TypePointer UniformConstant 461
-463(g_tTex2dmsi4):    462(ptr) Variable UniformConstant
-             473:             TypeImage 12(int) 2D multi-sampled sampled format:Unknown
-             474:             TypePointer UniformConstant 473
-475(g_tTex2dmsu4):    474(ptr) Variable UniformConstant
-             485:             TypeImage 6(float) 2D array multi-sampled sampled format:Unknown
-             486:             TypePointer UniformConstant 485
-487(g_tTex2dmsf4a):    486(ptr) Variable UniformConstant
-             499:             TypeImage 19(int) 2D array multi-sampled sampled format:Unknown
-             500:             TypePointer UniformConstant 499
-501(g_tTex2dmsi4a):    500(ptr) Variable UniformConstant
-             513:             TypeImage 12(int) 2D array multi-sampled sampled format:Unknown
-             514:             TypePointer UniformConstant 513
-515(g_tTex2dmsu4a):    514(ptr) Variable UniformConstant
-             526:             TypePointer Function 8(PS_OUTPUT)
-             528:     19(int) Constant 0
-             529:    6(float) Constant 1065353216
-             530:    7(fvec4) ConstantComposite 529 529 529 529
-             531:             TypePointer Function 7(fvec4)
-             533:     19(int) Constant 1
-             534:             TypePointer Function 6(float)
-             541:             TypePointer Output 7(fvec4)
-      542(Color):    541(ptr) Variable Output
-             545:             TypePointer Output 6(float)
-      546(Depth):    545(ptr) Variable Output
-             549:             TypeSampler
-             550:             TypePointer UniformConstant 549
-    551(g_sSamp):    550(ptr) Variable UniformConstant
+             190:     12(int) Constant 2
+             205:             TypeImage 19(int) 2D array sampled format:Unknown
+             206:             TypePointer UniformConstant 205
+207(g_tTex2di4a):    206(ptr) Variable UniformConstant
+             228:             TypeImage 12(int) 2D array sampled format:Unknown
+             229:             TypePointer UniformConstant 228
+230(g_tTex2du4a):    229(ptr) Variable UniformConstant
+             251:             TypeImage 6(float) 3D sampled format:Unknown
+             252:             TypePointer UniformConstant 251
+ 253(g_tTex3df4):    252(ptr) Variable UniformConstant
+             275:             TypeImage 19(int) 3D sampled format:Unknown
+             276:             TypePointer UniformConstant 275
+ 277(g_tTex3di4):    276(ptr) Variable UniformConstant
+             298:             TypeImage 12(int) 3D sampled format:Unknown
+             299:             TypePointer UniformConstant 298
+ 300(g_tTex3du4):    299(ptr) Variable UniformConstant
+             321:             TypeImage 6(float) Cube sampled format:Unknown
+             322:             TypePointer UniformConstant 321
+ 323(g_tTexcdf4):    322(ptr) Variable UniformConstant
+             340:             TypeImage 19(int) Cube sampled format:Unknown
+             341:             TypePointer UniformConstant 340
+ 342(g_tTexcdi4):    341(ptr) Variable UniformConstant
+             359:             TypeImage 12(int) Cube sampled format:Unknown
+             360:             TypePointer UniformConstant 359
+ 361(g_tTexcdu4):    360(ptr) Variable UniformConstant
+             378:             TypeImage 6(float) Cube array sampled format:Unknown
+             379:             TypePointer UniformConstant 378
+380(g_tTexcdf4a):    379(ptr) Variable UniformConstant
+             401:             TypeImage 19(int) Cube array sampled format:Unknown
+             402:             TypePointer UniformConstant 401
+403(g_tTexcdi4a):    402(ptr) Variable UniformConstant
+             424:             TypeImage 12(int) Cube array sampled format:Unknown
+             425:             TypePointer UniformConstant 424
+426(g_tTexcdu4a):    425(ptr) Variable UniformConstant
+             447:             TypeImage 6(float) 2D multi-sampled sampled format:Unknown
+             448:             TypePointer UniformConstant 447
+449(g_tTex2dmsf4):    448(ptr) Variable UniformConstant
+             460:             TypeImage 19(int) 2D multi-sampled sampled format:Unknown
+             461:             TypePointer UniformConstant 460
+462(g_tTex2dmsi4):    461(ptr) Variable UniformConstant
+             472:             TypeImage 12(int) 2D multi-sampled sampled format:Unknown
+             473:             TypePointer UniformConstant 472
+474(g_tTex2dmsu4):    473(ptr) Variable UniformConstant
+             484:             TypeImage 6(float) 2D array multi-sampled sampled format:Unknown
+             485:             TypePointer UniformConstant 484
+486(g_tTex2dmsf4a):    485(ptr) Variable UniformConstant
+             498:             TypeImage 19(int) 2D array multi-sampled sampled format:Unknown
+             499:             TypePointer UniformConstant 498
+500(g_tTex2dmsi4a):    499(ptr) Variable UniformConstant
+             512:             TypeImage 12(int) 2D array multi-sampled sampled format:Unknown
+             513:             TypePointer UniformConstant 512
+514(g_tTex2dmsu4a):    513(ptr) Variable UniformConstant
+             525:             TypePointer Function 8(PS_OUTPUT)
+             527:    6(float) Constant 1065353216
+             528:    7(fvec4) ConstantComposite 527 527 527 527
+             529:             TypePointer Function 7(fvec4)
+             531:     19(int) Constant 1
+             532:             TypePointer Function 6(float)
+             539:             TypePointer Output 7(fvec4)
+      540(Color):    539(ptr) Variable Output
+             543:             TypePointer Output 6(float)
+      544(Depth):    543(ptr) Variable Output
+             547:             TypeSampler
+             548:             TypePointer UniformConstant 547
+    549(g_sSamp):    548(ptr) Variable UniformConstant
          4(main):           2 Function None 3
                5:             Label
-539(flattenTemp):    526(ptr) Variable Function
-             540:8(PS_OUTPUT) FunctionCall 10(@main()
-                              Store 539(flattenTemp) 540
-             543:    531(ptr) AccessChain 539(flattenTemp) 528
-             544:    7(fvec4) Load 543
-                              Store 542(Color) 544
-             547:    534(ptr) AccessChain 539(flattenTemp) 533
-             548:    6(float) Load 547
-                              Store 546(Depth) 548
+537(flattenTemp):    525(ptr) Variable Function
+             538:8(PS_OUTPUT) FunctionCall 10(@main()
+                              Store 537(flattenTemp) 538
+             541:    529(ptr) AccessChain 537(flattenTemp) 20
+             542:    7(fvec4) Load 541
+                              Store 540(Color) 542
+             545:    532(ptr) AccessChain 537(flattenTemp) 531
+             546:    6(float) Load 545
+                              Store 544(Depth) 546
                               Return
                               FunctionEnd
       10(@main():8(PS_OUTPUT) Function None 9
               11:             Label
 14(sizeQueryTemp):     13(ptr) Variable Function
-      21(WidthU):     13(ptr) Variable Function
-23(sizeQueryTemp):     13(ptr) Variable Function
-28(NumberOfLevelsU):     13(ptr) Variable Function
-31(sizeQueryTemp):     13(ptr) Variable Function
-38(sizeQueryTemp):     13(ptr) Variable Function
-44(sizeQueryTemp):     13(ptr) Variable Function
-51(sizeQueryTemp):     13(ptr) Variable Function
-59(sizeQueryTemp):     58(ptr) Variable Function
+      22(WidthU):     13(ptr) Variable Function
+24(sizeQueryTemp):     13(ptr) Variable Function
+29(NumberOfLevelsU):     13(ptr) Variable Function
+32(sizeQueryTemp):     13(ptr) Variable Function
+39(sizeQueryTemp):     13(ptr) Variable Function
+45(sizeQueryTemp):     13(ptr) Variable Function
+52(sizeQueryTemp):     13(ptr) Variable Function
+60(sizeQueryTemp):     59(ptr) Variable Function
    69(ElementsU):     13(ptr) Variable Function
-73(sizeQueryTemp):     58(ptr) Variable Function
-82(sizeQueryTemp):     58(ptr) Variable Function
-92(sizeQueryTemp):     58(ptr) Variable Function
-101(sizeQueryTemp):     58(ptr) Variable Function
-111(sizeQueryTemp):     58(ptr) Variable Function
-120(sizeQueryTemp):     58(ptr) Variable Function
+73(sizeQueryTemp):     59(ptr) Variable Function
+82(sizeQueryTemp):     59(ptr) Variable Function
+92(sizeQueryTemp):     59(ptr) Variable Function
+101(sizeQueryTemp):     59(ptr) Variable Function
+111(sizeQueryTemp):     59(ptr) Variable Function
+120(sizeQueryTemp):     59(ptr) Variable Function
     128(HeightU):     13(ptr) Variable Function
-131(sizeQueryTemp):     58(ptr) Variable Function
-140(sizeQueryTemp):     58(ptr) Variable Function
-150(sizeQueryTemp):     58(ptr) Variable Function
-159(sizeQueryTemp):     58(ptr) Variable Function
-169(sizeQueryTemp):     58(ptr) Variable Function
+131(sizeQueryTemp):     59(ptr) Variable Function
+140(sizeQueryTemp):     59(ptr) Variable Function
+150(sizeQueryTemp):     59(ptr) Variable Function
+159(sizeQueryTemp):     59(ptr) Variable Function
+169(sizeQueryTemp):     59(ptr) Variable Function
 180(sizeQueryTemp):    179(ptr) Variable Function
-194(sizeQueryTemp):    179(ptr) Variable Function
-205(sizeQueryTemp):    179(ptr) Variable Function
-217(sizeQueryTemp):    179(ptr) Variable Function
-228(sizeQueryTemp):    179(ptr) Variable Function
-240(sizeQueryTemp):    179(ptr) Variable Function
-251(sizeQueryTemp):    179(ptr) Variable Function
-     261(DepthU):     13(ptr) Variable Function
-264(sizeQueryTemp):    179(ptr) Variable Function
-275(sizeQueryTemp):    179(ptr) Variable Function
-287(sizeQueryTemp):    179(ptr) Variable Function
-298(sizeQueryTemp):    179(ptr) Variable Function
-310(sizeQueryTemp):    179(ptr) Variable Function
-321(sizeQueryTemp):     58(ptr) Variable Function
-331(sizeQueryTemp):     58(ptr) Variable Function
-340(sizeQueryTemp):     58(ptr) Variable Function
-350(sizeQueryTemp):     58(ptr) Variable Function
-359(sizeQueryTemp):     58(ptr) Variable Function
-369(sizeQueryTemp):     58(ptr) Variable Function
-378(sizeQueryTemp):    179(ptr) Variable Function
-390(sizeQueryTemp):    179(ptr) Variable Function
-401(sizeQueryTemp):    179(ptr) Variable Function
-413(sizeQueryTemp):    179(ptr) Variable Function
-424(sizeQueryTemp):    179(ptr) Variable Function
-436(sizeQueryTemp):    179(ptr) Variable Function
-447(sizeQueryTemp):     58(ptr) Variable Function
-457(NumberOfSamplesU):     13(ptr) Variable Function
-460(sizeQueryTemp):     58(ptr) Variable Function
-472(sizeQueryTemp):     58(ptr) Variable Function
-484(sizeQueryTemp):    179(ptr) Variable Function
-498(sizeQueryTemp):    179(ptr) Variable Function
-512(sizeQueryTemp):    179(ptr) Variable Function
-      527(psout):    526(ptr) Variable Function
+193(sizeQueryTemp):    179(ptr) Variable Function
+204(sizeQueryTemp):    179(ptr) Variable Function
+216(sizeQueryTemp):    179(ptr) Variable Function
+227(sizeQueryTemp):    179(ptr) Variable Function
+239(sizeQueryTemp):    179(ptr) Variable Function
+250(sizeQueryTemp):    179(ptr) Variable Function
+     260(DepthU):     13(ptr) Variable Function
+263(sizeQueryTemp):    179(ptr) Variable Function
+274(sizeQueryTemp):    179(ptr) Variable Function
+286(sizeQueryTemp):    179(ptr) Variable Function
+297(sizeQueryTemp):    179(ptr) Variable Function
+309(sizeQueryTemp):    179(ptr) Variable Function
+320(sizeQueryTemp):     59(ptr) Variable Function
+330(sizeQueryTemp):     59(ptr) Variable Function
+339(sizeQueryTemp):     59(ptr) Variable Function
+349(sizeQueryTemp):     59(ptr) Variable Function
+358(sizeQueryTemp):     59(ptr) Variable Function
+368(sizeQueryTemp):     59(ptr) Variable Function
+377(sizeQueryTemp):    179(ptr) Variable Function
+389(sizeQueryTemp):    179(ptr) Variable Function
+400(sizeQueryTemp):    179(ptr) Variable Function
+412(sizeQueryTemp):    179(ptr) Variable Function
+423(sizeQueryTemp):    179(ptr) Variable Function
+435(sizeQueryTemp):    179(ptr) Variable Function
+446(sizeQueryTemp):     59(ptr) Variable Function
+456(NumberOfSamplesU):     13(ptr) Variable Function
+459(sizeQueryTemp):     59(ptr) Variable Function
+471(sizeQueryTemp):     59(ptr) Variable Function
+483(sizeQueryTemp):    179(ptr) Variable Function
+497(sizeQueryTemp):    179(ptr) Variable Function
+511(sizeQueryTemp):    179(ptr) Variable Function
+      526(psout):    525(ptr) Variable Function
               18:          15 Load 17(g_tTex1df4)
-              20:     19(int) ImageQuerySize 18
-                              Store 14(sizeQueryTemp) 20
-              22:     12(int) Load 14(sizeQueryTemp)
-                              Store 21(WidthU) 22
-              24:          15 Load 17(g_tTex1df4)
-              26:     19(int) ImageQuerySizeLod 24 25
-                              Store 23(sizeQueryTemp) 26
-              27:     12(int) Load 23(sizeQueryTemp)
-                              Store 21(WidthU) 27
-              29:          15 Load 17(g_tTex1df4)
-              30:     19(int) ImageQueryLevels 29
-                              Store 28(NumberOfLevelsU) 30
-              35:          32 Load 34(g_tTex1di4)
-              36:     19(int) ImageQuerySize 35
-                              Store 31(sizeQueryTemp) 36
-              37:     12(int) Load 31(sizeQueryTemp)
-                              Store 21(WidthU) 37
-              39:          32 Load 34(g_tTex1di4)
-              40:     19(int) ImageQuerySizeLod 39 25
-                              Store 38(sizeQueryTemp) 40
-              41:     12(int) Load 38(sizeQueryTemp)
-                              Store 21(WidthU) 41
-              42:          32 Load 34(g_tTex1di4)
-              43:     19(int) ImageQueryLevels 42
-                              Store 28(NumberOfLevelsU) 43
-              48:          45 Load 47(g_tTex1du4)
-              49:     19(int) ImageQuerySize 48
-                              Store 44(sizeQueryTemp) 49
-              50:     12(int) Load 44(sizeQueryTemp)
-                              Store 21(WidthU) 50
-              52:          45 Load 47(g_tTex1du4)
-              53:     19(int) ImageQuerySizeLod 52 25
-                              Store 51(sizeQueryTemp) 53
-              54:     12(int) Load 51(sizeQueryTemp)
-                              Store 21(WidthU) 54
-              55:          45 Load 47(g_tTex1du4)
-              56:     19(int) ImageQueryLevels 55
-                              Store 28(NumberOfLevelsU) 56
-              63:          60 Load 62(g_tTex1df4a)
-              65:   64(ivec2) ImageQuerySize 63
-                              Store 59(sizeQueryTemp) 65
-              67:     13(ptr) AccessChain 59(sizeQueryTemp) 66
+              21:     12(int) ImageQuerySizeLod 18 20
+                              Store 14(sizeQueryTemp) 21
+              23:     12(int) Load 14(sizeQueryTemp)
+                              Store 22(WidthU) 23
+              25:          15 Load 17(g_tTex1df4)
+              27:     12(int) ImageQuerySizeLod 25 26
+                              Store 24(sizeQueryTemp) 27
+              28:     12(int) Load 24(sizeQueryTemp)
+                              Store 22(WidthU) 28
+              30:          15 Load 17(g_tTex1df4)
+              31:     12(int) ImageQueryLevels 30
+                              Store 29(NumberOfLevelsU) 31
+              36:          33 Load 35(g_tTex1di4)
+              37:     12(int) ImageQuerySizeLod 36 20
+                              Store 32(sizeQueryTemp) 37
+              38:     12(int) Load 32(sizeQueryTemp)
+                              Store 22(WidthU) 38
+              40:          33 Load 35(g_tTex1di4)
+              41:     12(int) ImageQuerySizeLod 40 26
+                              Store 39(sizeQueryTemp) 41
+              42:     12(int) Load 39(sizeQueryTemp)
+                              Store 22(WidthU) 42
+              43:          33 Load 35(g_tTex1di4)
+              44:     12(int) ImageQueryLevels 43
+                              Store 29(NumberOfLevelsU) 44
+              49:          46 Load 48(g_tTex1du4)
+              50:     12(int) ImageQuerySizeLod 49 20
+                              Store 45(sizeQueryTemp) 50
+              51:     12(int) Load 45(sizeQueryTemp)
+                              Store 22(WidthU) 51
+              53:          46 Load 48(g_tTex1du4)
+              54:     12(int) ImageQuerySizeLod 53 26
+                              Store 52(sizeQueryTemp) 54
+              55:     12(int) Load 52(sizeQueryTemp)
+                              Store 22(WidthU) 55
+              56:          46 Load 48(g_tTex1du4)
+              57:     12(int) ImageQueryLevels 56
+                              Store 29(NumberOfLevelsU) 57
+              64:          61 Load 63(g_tTex1df4a)
+              65:   58(ivec2) ImageQuerySizeLod 64 20
+                              Store 60(sizeQueryTemp) 65
+              67:     13(ptr) AccessChain 60(sizeQueryTemp) 66
               68:     12(int) Load 67
-                              Store 21(WidthU) 68
-              71:     13(ptr) AccessChain 59(sizeQueryTemp) 70
+                              Store 22(WidthU) 68
+              71:     13(ptr) AccessChain 60(sizeQueryTemp) 70
               72:     12(int) Load 71
                               Store 69(ElementsU) 72
-              74:          60 Load 62(g_tTex1df4a)
-              75:   64(ivec2) ImageQuerySizeLod 74 25
+              74:          61 Load 63(g_tTex1df4a)
+              75:   58(ivec2) ImageQuerySizeLod 74 26
                               Store 73(sizeQueryTemp) 75
               76:     13(ptr) AccessChain 73(sizeQueryTemp) 66
               77:     12(int) Load 76
-                              Store 21(WidthU) 77
+                              Store 22(WidthU) 77
               78:     13(ptr) AccessChain 73(sizeQueryTemp) 70
               79:     12(int) Load 78
                               Store 69(ElementsU) 79
-              80:          60 Load 62(g_tTex1df4a)
-              81:     19(int) ImageQueryLevels 80
-                              Store 28(NumberOfLevelsU) 81
+              80:          61 Load 63(g_tTex1df4a)
+              81:     12(int) ImageQueryLevels 80
+                              Store 29(NumberOfLevelsU) 81
               86:          83 Load 85(g_tTex1di4a)
-              87:   64(ivec2) ImageQuerySize 86
+              87:   58(ivec2) ImageQuerySizeLod 86 20
                               Store 82(sizeQueryTemp) 87
               88:     13(ptr) AccessChain 82(sizeQueryTemp) 66
               89:     12(int) Load 88
-                              Store 21(WidthU) 89
+                              Store 22(WidthU) 89
               90:     13(ptr) AccessChain 82(sizeQueryTemp) 70
               91:     12(int) Load 90
                               Store 69(ElementsU) 91
               93:          83 Load 85(g_tTex1di4a)
-              94:   64(ivec2) ImageQuerySizeLod 93 25
+              94:   58(ivec2) ImageQuerySizeLod 93 26
                               Store 92(sizeQueryTemp) 94
               95:     13(ptr) AccessChain 92(sizeQueryTemp) 66
               96:     12(int) Load 95
-                              Store 21(WidthU) 96
+                              Store 22(WidthU) 96
               97:     13(ptr) AccessChain 92(sizeQueryTemp) 70
               98:     12(int) Load 97
                               Store 69(ElementsU) 98
               99:          83 Load 85(g_tTex1di4a)
-             100:     19(int) ImageQueryLevels 99
-                              Store 28(NumberOfLevelsU) 100
+             100:     12(int) ImageQueryLevels 99
+                              Store 29(NumberOfLevelsU) 100
              105:         102 Load 104(g_tTex1du4a)
-             106:   64(ivec2) ImageQuerySize 105
+             106:   58(ivec2) ImageQuerySizeLod 105 20
                               Store 101(sizeQueryTemp) 106
              107:     13(ptr) AccessChain 101(sizeQueryTemp) 66
              108:     12(int) Load 107
-                              Store 21(WidthU) 108
+                              Store 22(WidthU) 108
              109:     13(ptr) AccessChain 101(sizeQueryTemp) 70
              110:     12(int) Load 109
                               Store 69(ElementsU) 110
              112:         102 Load 104(g_tTex1du4a)
-             113:   64(ivec2) ImageQuerySizeLod 112 25
+             113:   58(ivec2) ImageQuerySizeLod 112 26
                               Store 111(sizeQueryTemp) 113
              114:     13(ptr) AccessChain 111(sizeQueryTemp) 66
              115:     12(int) Load 114
-                              Store 21(WidthU) 115
+                              Store 22(WidthU) 115
              116:     13(ptr) AccessChain 111(sizeQueryTemp) 70
              117:     12(int) Load 116
                               Store 69(ElementsU) 117
              118:         102 Load 104(g_tTex1du4a)
-             119:     19(int) ImageQueryLevels 118
-                              Store 28(NumberOfLevelsU) 119
+             119:     12(int) ImageQueryLevels 118
+                              Store 29(NumberOfLevelsU) 119
              124:         121 Load 123(g_tTex2df4)
-             125:   64(ivec2) ImageQuerySize 124
+             125:   58(ivec2) ImageQuerySizeLod 124 20
                               Store 120(sizeQueryTemp) 125
              126:     13(ptr) AccessChain 120(sizeQueryTemp) 66
              127:     12(int) Load 126
-                              Store 21(WidthU) 127
+                              Store 22(WidthU) 127
              129:     13(ptr) AccessChain 120(sizeQueryTemp) 70
              130:     12(int) Load 129
                               Store 128(HeightU) 130
              132:         121 Load 123(g_tTex2df4)
-             133:   64(ivec2) ImageQuerySizeLod 132 25
+             133:   58(ivec2) ImageQuerySizeLod 132 26
                               Store 131(sizeQueryTemp) 133
              134:     13(ptr) AccessChain 131(sizeQueryTemp) 66
              135:     12(int) Load 134
-                              Store 21(WidthU) 135
+                              Store 22(WidthU) 135
              136:     13(ptr) AccessChain 131(sizeQueryTemp) 70
              137:     12(int) Load 136
                               Store 128(HeightU) 137
              138:         121 Load 123(g_tTex2df4)
-             139:     19(int) ImageQueryLevels 138
-                              Store 28(NumberOfLevelsU) 139
+             139:     12(int) ImageQueryLevels 138
+                              Store 29(NumberOfLevelsU) 139
              144:         141 Load 143(g_tTex2di4)
-             145:   64(ivec2) ImageQuerySize 144
+             145:   58(ivec2) ImageQuerySizeLod 144 20
                               Store 140(sizeQueryTemp) 145
              146:     13(ptr) AccessChain 140(sizeQueryTemp) 66
              147:     12(int) Load 146
-                              Store 21(WidthU) 147
+                              Store 22(WidthU) 147
              148:     13(ptr) AccessChain 140(sizeQueryTemp) 70
              149:     12(int) Load 148
                               Store 128(HeightU) 149
              151:         141 Load 143(g_tTex2di4)
-             152:   64(ivec2) ImageQuerySizeLod 151 25
+             152:   58(ivec2) ImageQuerySizeLod 151 26
                               Store 150(sizeQueryTemp) 152
              153:     13(ptr) AccessChain 150(sizeQueryTemp) 66
              154:     12(int) Load 153
-                              Store 21(WidthU) 154
+                              Store 22(WidthU) 154
              155:     13(ptr) AccessChain 150(sizeQueryTemp) 70
              156:     12(int) Load 155
                               Store 128(HeightU) 156
              157:         141 Load 143(g_tTex2di4)
-             158:     19(int) ImageQueryLevels 157
-                              Store 28(NumberOfLevelsU) 158
+             158:     12(int) ImageQueryLevels 157
+                              Store 29(NumberOfLevelsU) 158
              163:         160 Load 162(g_tTex2du4)
-             164:   64(ivec2) ImageQuerySize 163
+             164:   58(ivec2) ImageQuerySizeLod 163 20
                               Store 159(sizeQueryTemp) 164
              165:     13(ptr) AccessChain 159(sizeQueryTemp) 66
              166:     12(int) Load 165
-                              Store 21(WidthU) 166
+                              Store 22(WidthU) 166
              167:     13(ptr) AccessChain 159(sizeQueryTemp) 70
              168:     12(int) Load 167
                               Store 128(HeightU) 168
              170:         160 Load 162(g_tTex2du4)
-             171:   64(ivec2) ImageQuerySizeLod 170 25
+             171:   58(ivec2) ImageQuerySizeLod 170 26
                               Store 169(sizeQueryTemp) 171
              172:     13(ptr) AccessChain 169(sizeQueryTemp) 66
              173:     12(int) Load 172
-                              Store 21(WidthU) 173
+                              Store 22(WidthU) 173
              174:     13(ptr) AccessChain 169(sizeQueryTemp) 70
              175:     12(int) Load 174
                               Store 128(HeightU) 175
              176:         160 Load 162(g_tTex2du4)
-             177:     19(int) ImageQueryLevels 176
-                              Store 28(NumberOfLevelsU) 177
+             177:     12(int) ImageQueryLevels 176
+                              Store 29(NumberOfLevelsU) 177
              184:         181 Load 183(g_tTex2df4a)
-             186:  185(ivec3) ImageQuerySize 184
-                              Store 180(sizeQueryTemp) 186
-             187:     13(ptr) AccessChain 180(sizeQueryTemp) 66
-             188:     12(int) Load 187
-                              Store 21(WidthU) 188
-             189:     13(ptr) AccessChain 180(sizeQueryTemp) 70
-             190:     12(int) Load 189
-                              Store 128(HeightU) 190
-             192:     13(ptr) AccessChain 180(sizeQueryTemp) 191
-             193:     12(int) Load 192
-                              Store 69(ElementsU) 193
-             195:         181 Load 183(g_tTex2df4a)
-             196:  185(ivec3) ImageQuerySizeLod 195 25
-                              Store 194(sizeQueryTemp) 196
-             197:     13(ptr) AccessChain 194(sizeQueryTemp) 66
-             198:     12(int) Load 197
-                              Store 21(WidthU) 198
-             199:     13(ptr) AccessChain 194(sizeQueryTemp) 70
-             200:     12(int) Load 199
-                              Store 128(HeightU) 200
-             201:     13(ptr) AccessChain 194(sizeQueryTemp) 191
-             202:     12(int) Load 201
-                              Store 69(ElementsU) 202
-             203:         181 Load 183(g_tTex2df4a)
-             204:     19(int) ImageQueryLevels 203
-                              Store 28(NumberOfLevelsU) 204
-             209:         206 Load 208(g_tTex2di4a)
-             210:  185(ivec3) ImageQuerySize 209
-                              Store 205(sizeQueryTemp) 210
-             211:     13(ptr) AccessChain 205(sizeQueryTemp) 66
-             212:     12(int) Load 211
-                              Store 21(WidthU) 212
-             213:     13(ptr) AccessChain 205(sizeQueryTemp) 70
-             214:     12(int) Load 213
-                              Store 128(HeightU) 214
-             215:     13(ptr) AccessChain 205(sizeQueryTemp) 191
-             216:     12(int) Load 215
-                              Store 69(ElementsU) 216
-             218:         206 Load 208(g_tTex2di4a)
-             219:  185(ivec3) ImageQuerySizeLod 218 25
-                              Store 217(sizeQueryTemp) 219
-             220:     13(ptr) AccessChain 217(sizeQueryTemp) 66
-             221:     12(int) Load 220
-                              Store 21(WidthU) 221
-             222:     13(ptr) AccessChain 217(sizeQueryTemp) 70
-             223:     12(int) Load 222
-                              Store 128(HeightU) 223
-             224:     13(ptr) AccessChain 217(sizeQueryTemp) 191
-             225:     12(int) Load 224
-                              Store 69(ElementsU) 225
-             226:         206 Load 208(g_tTex2di4a)
-             227:     19(int) ImageQueryLevels 226
-                              Store 28(NumberOfLevelsU) 227
-             232:         229 Load 231(g_tTex2du4a)
-             233:  185(ivec3) ImageQuerySize 232
-                              Store 228(sizeQueryTemp) 233
-             234:     13(ptr) AccessChain 228(sizeQueryTemp) 66
-             235:     12(int) Load 234
-                              Store 21(WidthU) 235
-             236:     13(ptr) AccessChain 228(sizeQueryTemp) 70
-             237:     12(int) Load 236
-                              Store 128(HeightU) 237
-             238:     13(ptr) AccessChain 228(sizeQueryTemp) 191
-             239:     12(int) Load 238
-                              Store 69(ElementsU) 239
-             241:         229 Load 231(g_tTex2du4a)
-             242:  185(ivec3) ImageQuerySizeLod 241 25
-                              Store 240(sizeQueryTemp) 242
-             243:     13(ptr) AccessChain 240(sizeQueryTemp) 66
-             244:     12(int) Load 243
-                              Store 21(WidthU) 244
-             245:     13(ptr) AccessChain 240(sizeQueryTemp) 70
-             246:     12(int) Load 245
-                              Store 128(HeightU) 246
-             247:     13(ptr) AccessChain 240(sizeQueryTemp) 191
-             248:     12(int) Load 247
-                              Store 69(ElementsU) 248
-             249:         229 Load 231(g_tTex2du4a)
-             250:     19(int) ImageQueryLevels 249
-                              Store 28(NumberOfLevelsU) 250
-             255:         252 Load 254(g_tTex3df4)
-             256:  185(ivec3) ImageQuerySize 255
-                              Store 251(sizeQueryTemp) 256
-             257:     13(ptr) AccessChain 251(sizeQueryTemp) 66
-             258:     12(int) Load 257
-                              Store 21(WidthU) 258
-             259:     13(ptr) AccessChain 251(sizeQueryTemp) 70
-             260:     12(int) Load 259
-                              Store 128(HeightU) 260
-             262:     13(ptr) AccessChain 251(sizeQueryTemp) 191
-             263:     12(int) Load 262
-                              Store 261(DepthU) 263
-             265:         252 Load 254(g_tTex3df4)
-             266:  185(ivec3) ImageQuerySizeLod 265 25
-                              Store 264(sizeQueryTemp) 266
-             267:     13(ptr) AccessChain 264(sizeQueryTemp) 66
-             268:     12(int) Load 267
-                              Store 21(WidthU) 268
-             269:     13(ptr) AccessChain 264(sizeQueryTemp) 70
-             270:     12(int) Load 269
-                              Store 128(HeightU) 270
-             271:     13(ptr) AccessChain 264(sizeQueryTemp) 191
-             272:     12(int) Load 271
-                              Store 261(DepthU) 272
-             273:         252 Load 254(g_tTex3df4)
-             274:     19(int) ImageQueryLevels 273
-                              Store 28(NumberOfLevelsU) 274
-             279:         276 Load 278(g_tTex3di4)
-             280:  185(ivec3) ImageQuerySize 279
-                              Store 275(sizeQueryTemp) 280
-             281:     13(ptr) AccessChain 275(sizeQueryTemp) 66
-             282:     12(int) Load 281
-                              Store 21(WidthU) 282
-             283:     13(ptr) AccessChain 275(sizeQueryTemp) 70
-             284:     12(int) Load 283
-                              Store 128(HeightU) 284
-             285:     13(ptr) AccessChain 275(sizeQueryTemp) 191
-             286:     12(int) Load 285
-                              Store 261(DepthU) 286
-             288:         276 Load 278(g_tTex3di4)
-             289:  185(ivec3) ImageQuerySizeLod 288 25
-                              Store 287(sizeQueryTemp) 289
-             290:     13(ptr) AccessChain 287(sizeQueryTemp) 66
-             291:     12(int) Load 290
-                              Store 21(WidthU) 291
-             292:     13(ptr) AccessChain 287(sizeQueryTemp) 70
-             293:     12(int) Load 292
-                              Store 128(HeightU) 293
-             294:     13(ptr) AccessChain 287(sizeQueryTemp) 191
-             295:     12(int) Load 294
-                              Store 261(DepthU) 295
-             296:         276 Load 278(g_tTex3di4)
-             297:     19(int) ImageQueryLevels 296
-                              Store 28(NumberOfLevelsU) 297
-             302:         299 Load 301(g_tTex3du4)
-             303:  185(ivec3) ImageQuerySize 302
-                              Store 298(sizeQueryTemp) 303
-             304:     13(ptr) AccessChain 298(sizeQueryTemp) 66
-             305:     12(int) Load 304
-                              Store 21(WidthU) 305
-             306:     13(ptr) AccessChain 298(sizeQueryTemp) 70
-             307:     12(int) Load 306
-                              Store 128(HeightU) 307
-             308:     13(ptr) AccessChain 298(sizeQueryTemp) 191
-             309:     12(int) Load 308
-                              Store 261(DepthU) 309
-             311:         299 Load 301(g_tTex3du4)
-             312:  185(ivec3) ImageQuerySizeLod 311 25
-                              Store 310(sizeQueryTemp) 312
-             313:     13(ptr) AccessChain 310(sizeQueryTemp) 66
-             314:     12(int) Load 313
-                              Store 21(WidthU) 314
-             315:     13(ptr) AccessChain 310(sizeQueryTemp) 70
-             316:     12(int) Load 315
-                              Store 128(HeightU) 316
-             317:     13(ptr) AccessChain 310(sizeQueryTemp) 191
-             318:     12(int) Load 317
-                              Store 261(DepthU) 318
-             319:         299 Load 301(g_tTex3du4)
-             320:     19(int) ImageQueryLevels 319
-                              Store 28(NumberOfLevelsU) 320
-             325:         322 Load 324(g_tTexcdf4)
-             326:   64(ivec2) ImageQuerySize 325
-                              Store 321(sizeQueryTemp) 326
-             327:     13(ptr) AccessChain 321(sizeQueryTemp) 66
-             328:     12(int) Load 327
-                              Store 21(WidthU) 328
-             329:     13(ptr) AccessChain 321(sizeQueryTemp) 70
-             330:     12(int) Load 329
-                              Store 128(HeightU) 330
-             332:         322 Load 324(g_tTexcdf4)
-             333:   64(ivec2) ImageQuerySizeLod 332 25
-                              Store 331(sizeQueryTemp) 333
-             334:     13(ptr) AccessChain 331(sizeQueryTemp) 66
-             335:     12(int) Load 334
-                              Store 21(WidthU) 335
-             336:     13(ptr) AccessChain 331(sizeQueryTemp) 70
-             337:     12(int) Load 336
-                              Store 128(HeightU) 337
-             338:         322 Load 324(g_tTexcdf4)
-             339:     19(int) ImageQueryLevels 338
-                              Store 28(NumberOfLevelsU) 339
-             344:         341 Load 343(g_tTexcdi4)
-             345:   64(ivec2) ImageQuerySize 344
-                              Store 340(sizeQueryTemp) 345
-             346:     13(ptr) AccessChain 340(sizeQueryTemp) 66
-             347:     12(int) Load 346
-                              Store 21(WidthU) 347
-             348:     13(ptr) AccessChain 340(sizeQueryTemp) 70
-             349:     12(int) Load 348
-                              Store 128(HeightU) 349
-             351:         341 Load 343(g_tTexcdi4)
-             352:   64(ivec2) ImageQuerySizeLod 351 25
-                              Store 350(sizeQueryTemp) 352
-             353:     13(ptr) AccessChain 350(sizeQueryTemp) 66
-             354:     12(int) Load 353
-                              Store 21(WidthU) 354
-             355:     13(ptr) AccessChain 350(sizeQueryTemp) 70
-             356:     12(int) Load 355
-                              Store 128(HeightU) 356
-             357:         341 Load 343(g_tTexcdi4)
-             358:     19(int) ImageQueryLevels 357
-                              Store 28(NumberOfLevelsU) 358
-             363:         360 Load 362(g_tTexcdu4)
-             364:   64(ivec2) ImageQuerySize 363
-                              Store 359(sizeQueryTemp) 364
-             365:     13(ptr) AccessChain 359(sizeQueryTemp) 66
-             366:     12(int) Load 365
-                              Store 21(WidthU) 366
-             367:     13(ptr) AccessChain 359(sizeQueryTemp) 70
-             368:     12(int) Load 367
-                              Store 128(HeightU) 368
-             370:         360 Load 362(g_tTexcdu4)
-             371:   64(ivec2) ImageQuerySizeLod 370 25
-                              Store 369(sizeQueryTemp) 371
-             372:     13(ptr) AccessChain 369(sizeQueryTemp) 66
-             373:     12(int) Load 372
-                              Store 21(WidthU) 373
-             374:     13(ptr) AccessChain 369(sizeQueryTemp) 70
-             375:     12(int) Load 374
-                              Store 128(HeightU) 375
-             376:         360 Load 362(g_tTexcdu4)
-             377:     19(int) ImageQueryLevels 376
-                              Store 28(NumberOfLevelsU) 377
-             382:         379 Load 381(g_tTexcdf4a)
-             383:  185(ivec3) ImageQuerySize 382
-                              Store 378(sizeQueryTemp) 383
-             384:     13(ptr) AccessChain 378(sizeQueryTemp) 66
-             385:     12(int) Load 384
-                              Store 21(WidthU) 385
-             386:     13(ptr) AccessChain 378(sizeQueryTemp) 70
-             387:     12(int) Load 386
-                              Store 128(HeightU) 387
-             388:     13(ptr) AccessChain 378(sizeQueryTemp) 191
-             389:     12(int) Load 388
-                              Store 69(ElementsU) 389
-             391:         379 Load 381(g_tTexcdf4a)
-             392:  185(ivec3) ImageQuerySizeLod 391 25
-                              Store 390(sizeQueryTemp) 392
-             393:     13(ptr) AccessChain 390(sizeQueryTemp) 66
-             394:     12(int) Load 393
-                              Store 21(WidthU) 394
-             395:     13(ptr) AccessChain 390(sizeQueryTemp) 70
-             396:     12(int) Load 395
-                              Store 128(HeightU) 396
-             397:     13(ptr) AccessChain 390(sizeQueryTemp) 191
-             398:     12(int) Load 397
-                              Store 69(ElementsU) 398
-             399:         379 Load 381(g_tTexcdf4a)
-             400:     19(int) ImageQueryLevels 399
-                              Store 28(NumberOfLevelsU) 400
-             405:         402 Load 404(g_tTexcdi4a)
-             406:  185(ivec3) ImageQuerySize 405
-                              Store 401(sizeQueryTemp) 406
-             407:     13(ptr) AccessChain 401(sizeQueryTemp) 66
-             408:     12(int) Load 407
-                              Store 21(WidthU) 408
-             409:     13(ptr) AccessChain 401(sizeQueryTemp) 70
-             410:     12(int) Load 409
-                              Store 128(HeightU) 410
-             411:     13(ptr) AccessChain 401(sizeQueryTemp) 191
-             412:     12(int) Load 411
-                              Store 69(ElementsU) 412
-             414:         402 Load 404(g_tTexcdi4a)
-             415:  185(ivec3) ImageQuerySizeLod 414 25
-                              Store 413(sizeQueryTemp) 415
-             416:     13(ptr) AccessChain 413(sizeQueryTemp) 66
-             417:     12(int) Load 416
-                              Store 21(WidthU) 417
-             418:     13(ptr) AccessChain 413(sizeQueryTemp) 70
-             419:     12(int) Load 418
-                              Store 128(HeightU) 419
-             420:     13(ptr) AccessChain 413(sizeQueryTemp) 191
-             421:     12(int) Load 420
-                              Store 69(ElementsU) 421
-             422:         402 Load 404(g_tTexcdi4a)
-             423:     19(int) ImageQueryLevels 422
-                              Store 28(NumberOfLevelsU) 423
-             428:         425 Load 427(g_tTexcdu4a)
-             429:  185(ivec3) ImageQuerySize 428
-                              Store 424(sizeQueryTemp) 429
-             430:     13(ptr) AccessChain 424(sizeQueryTemp) 66
-             431:     12(int) Load 430
-                              Store 21(WidthU) 431
-             432:     13(ptr) AccessChain 424(sizeQueryTemp) 70
-             433:     12(int) Load 432
-                              Store 128(HeightU) 433
-             434:     13(ptr) AccessChain 424(sizeQueryTemp) 191
-             435:     12(int) Load 434
-                              Store 69(ElementsU) 435
-             437:         425 Load 427(g_tTexcdu4a)
-             438:  185(ivec3) ImageQuerySizeLod 437 25
-                              Store 436(sizeQueryTemp) 438
-             439:     13(ptr) AccessChain 436(sizeQueryTemp) 66
-             440:     12(int) Load 439
-                              Store 21(WidthU) 440
-             441:     13(ptr) AccessChain 436(sizeQueryTemp) 70
-             442:     12(int) Load 441
-                              Store 128(HeightU) 442
-             443:     13(ptr) AccessChain 436(sizeQueryTemp) 191
-             444:     12(int) Load 443
-                              Store 69(ElementsU) 444
-             445:         425 Load 427(g_tTexcdu4a)
-             446:     19(int) ImageQueryLevels 445
-                              Store 28(NumberOfLevelsU) 446
-             451:         448 Load 450(g_tTex2dmsf4)
-             452:   64(ivec2) ImageQuerySize 451
-                              Store 447(sizeQueryTemp) 452
-             453:     13(ptr) AccessChain 447(sizeQueryTemp) 66
-             454:     12(int) Load 453
-                              Store 21(WidthU) 454
-             455:     13(ptr) AccessChain 447(sizeQueryTemp) 70
-             456:     12(int) Load 455
-                              Store 128(HeightU) 456
-             458:         448 Load 450(g_tTex2dmsf4)
-             459:     19(int) ImageQuerySamples 458
-                              Store 457(NumberOfSamplesU) 459
-             464:         461 Load 463(g_tTex2dmsi4)
-             465:   64(ivec2) ImageQuerySize 464
-                              Store 460(sizeQueryTemp) 465
-             466:     13(ptr) AccessChain 460(sizeQueryTemp) 66
-             467:     12(int) Load 466
-                              Store 21(WidthU) 467
-             468:     13(ptr) AccessChain 460(sizeQueryTemp) 70
-             469:     12(int) Load 468
-                              Store 128(HeightU) 469
-             470:         461 Load 463(g_tTex2dmsi4)
-             471:     19(int) ImageQuerySamples 470
-                              Store 457(NumberOfSamplesU) 471
-             476:         473 Load 475(g_tTex2dmsu4)
-             477:   64(ivec2) ImageQuerySize 476
-                              Store 472(sizeQueryTemp) 477
-             478:     13(ptr) AccessChain 472(sizeQueryTemp) 66
-             479:     12(int) Load 478
-                              Store 21(WidthU) 479
-             480:     13(ptr) AccessChain 472(sizeQueryTemp) 70
-             481:     12(int) Load 480
-                              Store 128(HeightU) 481
-             482:         473 Load 475(g_tTex2dmsu4)
-             483:     19(int) ImageQuerySamples 482
-                              Store 457(NumberOfSamplesU) 483
-             488:         485 Load 487(g_tTex2dmsf4a)
-             489:  185(ivec3) ImageQuerySize 488
-                              Store 484(sizeQueryTemp) 489
-             490:     13(ptr) AccessChain 484(sizeQueryTemp) 66
-             491:     12(int) Load 490
-                              Store 21(WidthU) 491
-             492:     13(ptr) AccessChain 484(sizeQueryTemp) 70
-             493:     12(int) Load 492
-                              Store 128(HeightU) 493
-             494:     13(ptr) AccessChain 484(sizeQueryTemp) 191
-             495:     12(int) Load 494
-                              Store 69(ElementsU) 495
-             496:         485 Load 487(g_tTex2dmsf4a)
-             497:     19(int) ImageQuerySamples 496
-                              Store 457(NumberOfSamplesU) 497
-             502:         499 Load 501(g_tTex2dmsi4a)
-             503:  185(ivec3) ImageQuerySize 502
-                              Store 498(sizeQueryTemp) 503
-             504:     13(ptr) AccessChain 498(sizeQueryTemp) 66
-             505:     12(int) Load 504
-                              Store 21(WidthU) 505
-             506:     13(ptr) AccessChain 498(sizeQueryTemp) 70
-             507:     12(int) Load 506
-                              Store 128(HeightU) 507
-             508:     13(ptr) AccessChain 498(sizeQueryTemp) 191
-             509:     12(int) Load 508
-                              Store 69(ElementsU) 509
-             510:         499 Load 501(g_tTex2dmsi4a)
-             511:     19(int) ImageQuerySamples 510
-                              Store 457(NumberOfSamplesU) 511
-             516:         513 Load 515(g_tTex2dmsu4a)
-             517:  185(ivec3) ImageQuerySize 516
-                              Store 512(sizeQueryTemp) 517
-             518:     13(ptr) AccessChain 512(sizeQueryTemp) 66
-             519:     12(int) Load 518
-                              Store 21(WidthU) 519
-             520:     13(ptr) AccessChain 512(sizeQueryTemp) 70
-             521:     12(int) Load 520
-                              Store 128(HeightU) 521
-             522:     13(ptr) AccessChain 512(sizeQueryTemp) 191
-             523:     12(int) Load 522
-                              Store 69(ElementsU) 523
-             524:         513 Load 515(g_tTex2dmsu4a)
-             525:     19(int) ImageQuerySamples 524
-                              Store 457(NumberOfSamplesU) 525
-             532:    531(ptr) AccessChain 527(psout) 528
-                              Store 532 530
-             535:    534(ptr) AccessChain 527(psout) 533
-                              Store 535 529
-             536:8(PS_OUTPUT) Load 527(psout)
-                              ReturnValue 536
+             185:  178(ivec3) ImageQuerySizeLod 184 20
+                              Store 180(sizeQueryTemp) 185
+             186:     13(ptr) AccessChain 180(sizeQueryTemp) 66
+             187:     12(int) Load 186
+                              Store 22(WidthU) 187
+             188:     13(ptr) AccessChain 180(sizeQueryTemp) 70
+             189:     12(int) Load 188
+                              Store 128(HeightU) 189
+             191:     13(ptr) AccessChain 180(sizeQueryTemp) 190
+             192:     12(int) Load 191
+                              Store 69(ElementsU) 192
+             194:         181 Load 183(g_tTex2df4a)
+             195:  178(ivec3) ImageQuerySizeLod 194 26
+                              Store 193(sizeQueryTemp) 195
+             196:     13(ptr) AccessChain 193(sizeQueryTemp) 66
+             197:     12(int) Load 196
+                              Store 22(WidthU) 197
+             198:     13(ptr) AccessChain 193(sizeQueryTemp) 70
+             199:     12(int) Load 198
+                              Store 128(HeightU) 199
+             200:     13(ptr) AccessChain 193(sizeQueryTemp) 190
+             201:     12(int) Load 200
+                              Store 69(ElementsU) 201
+             202:         181 Load 183(g_tTex2df4a)
+             203:     12(int) ImageQueryLevels 202
+                              Store 29(NumberOfLevelsU) 203
+             208:         205 Load 207(g_tTex2di4a)
+             209:  178(ivec3) ImageQuerySizeLod 208 20
+                              Store 204(sizeQueryTemp) 209
+             210:     13(ptr) AccessChain 204(sizeQueryTemp) 66
+             211:     12(int) Load 210
+                              Store 22(WidthU) 211
+             212:     13(ptr) AccessChain 204(sizeQueryTemp) 70
+             213:     12(int) Load 212
+                              Store 128(HeightU) 213
+             214:     13(ptr) AccessChain 204(sizeQueryTemp) 190
+             215:     12(int) Load 214
+                              Store 69(ElementsU) 215
+             217:         205 Load 207(g_tTex2di4a)
+             218:  178(ivec3) ImageQuerySizeLod 217 26
+                              Store 216(sizeQueryTemp) 218
+             219:     13(ptr) AccessChain 216(sizeQueryTemp) 66
+             220:     12(int) Load 219
+                              Store 22(WidthU) 220
+             221:     13(ptr) AccessChain 216(sizeQueryTemp) 70
+             222:     12(int) Load 221
+                              Store 128(HeightU) 222
+             223:     13(ptr) AccessChain 216(sizeQueryTemp) 190
+             224:     12(int) Load 223
+                              Store 69(ElementsU) 224
+             225:         205 Load 207(g_tTex2di4a)
+             226:     12(int) ImageQueryLevels 225
+                              Store 29(NumberOfLevelsU) 226
+             231:         228 Load 230(g_tTex2du4a)
+             232:  178(ivec3) ImageQuerySizeLod 231 20
+                              Store 227(sizeQueryTemp) 232
+             233:     13(ptr) AccessChain 227(sizeQueryTemp) 66
+             234:     12(int) Load 233
+                              Store 22(WidthU) 234
+             235:     13(ptr) AccessChain 227(sizeQueryTemp) 70
+             236:     12(int) Load 235
+                              Store 128(HeightU) 236
+             237:     13(ptr) AccessChain 227(sizeQueryTemp) 190
+             238:     12(int) Load 237
+                              Store 69(ElementsU) 238
+             240:         228 Load 230(g_tTex2du4a)
+             241:  178(ivec3) ImageQuerySizeLod 240 26
+                              Store 239(sizeQueryTemp) 241
+             242:     13(ptr) AccessChain 239(sizeQueryTemp) 66
+             243:     12(int) Load 242
+                              Store 22(WidthU) 243
+             244:     13(ptr) AccessChain 239(sizeQueryTemp) 70
+             245:     12(int) Load 244
+                              Store 128(HeightU) 245
+             246:     13(ptr) AccessChain 239(sizeQueryTemp) 190
+             247:     12(int) Load 246
+                              Store 69(ElementsU) 247
+             248:         228 Load 230(g_tTex2du4a)
+             249:     12(int) ImageQueryLevels 248
+                              Store 29(NumberOfLevelsU) 249
+             254:         251 Load 253(g_tTex3df4)
+             255:  178(ivec3) ImageQuerySizeLod 254 20
+                              Store 250(sizeQueryTemp) 255
+             256:     13(ptr) AccessChain 250(sizeQueryTemp) 66
+             257:     12(int) Load 256
+                              Store 22(WidthU) 257
+             258:     13(ptr) AccessChain 250(sizeQueryTemp) 70
+             259:     12(int) Load 258
+                              Store 128(HeightU) 259
+             261:     13(ptr) AccessChain 250(sizeQueryTemp) 190
+             262:     12(int) Load 261
+                              Store 260(DepthU) 262
+             264:         251 Load 253(g_tTex3df4)
+             265:  178(ivec3) ImageQuerySizeLod 264 26
+                              Store 263(sizeQueryTemp) 265
+             266:     13(ptr) AccessChain 263(sizeQueryTemp) 66
+             267:     12(int) Load 266
+                              Store 22(WidthU) 267
+             268:     13(ptr) AccessChain 263(sizeQueryTemp) 70
+             269:     12(int) Load 268
+                              Store 128(HeightU) 269
+             270:     13(ptr) AccessChain 263(sizeQueryTemp) 190
+             271:     12(int) Load 270
+                              Store 260(DepthU) 271
+             272:         251 Load 253(g_tTex3df4)
+             273:     12(int) ImageQueryLevels 272
+                              Store 29(NumberOfLevelsU) 273
+             278:         275 Load 277(g_tTex3di4)
+             279:  178(ivec3) ImageQuerySizeLod 278 20
+                              Store 274(sizeQueryTemp) 279
+             280:     13(ptr) AccessChain 274(sizeQueryTemp) 66
+             281:     12(int) Load 280
+                              Store 22(WidthU) 281
+             282:     13(ptr) AccessChain 274(sizeQueryTemp) 70
+             283:     12(int) Load 282
+                              Store 128(HeightU) 283
+             284:     13(ptr) AccessChain 274(sizeQueryTemp) 190
+             285:     12(int) Load 284
+                              Store 260(DepthU) 285
+             287:         275 Load 277(g_tTex3di4)
+             288:  178(ivec3) ImageQuerySizeLod 287 26
+                              Store 286(sizeQueryTemp) 288
+             289:     13(ptr) AccessChain 286(sizeQueryTemp) 66
+             290:     12(int) Load 289
+                              Store 22(WidthU) 290
+             291:     13(ptr) AccessChain 286(sizeQueryTemp) 70
+             292:     12(int) Load 291
+                              Store 128(HeightU) 292
+             293:     13(ptr) AccessChain 286(sizeQueryTemp) 190
+             294:     12(int) Load 293
+                              Store 260(DepthU) 294
+             295:         275 Load 277(g_tTex3di4)
+             296:     12(int) ImageQueryLevels 295
+                              Store 29(NumberOfLevelsU) 296
+             301:         298 Load 300(g_tTex3du4)
+             302:  178(ivec3) ImageQuerySizeLod 301 20
+                              Store 297(sizeQueryTemp) 302
+             303:     13(ptr) AccessChain 297(sizeQueryTemp) 66
+             304:     12(int) Load 303
+                              Store 22(WidthU) 304
+             305:     13(ptr) AccessChain 297(sizeQueryTemp) 70
+             306:     12(int) Load 305
+                              Store 128(HeightU) 306
+             307:     13(ptr) AccessChain 297(sizeQueryTemp) 190
+             308:     12(int) Load 307
+                              Store 260(DepthU) 308
+             310:         298 Load 300(g_tTex3du4)
+             311:  178(ivec3) ImageQuerySizeLod 310 26
+                              Store 309(sizeQueryTemp) 311
+             312:     13(ptr) AccessChain 309(sizeQueryTemp) 66
+             313:     12(int) Load 312
+                              Store 22(WidthU) 313
+             314:     13(ptr) AccessChain 309(sizeQueryTemp) 70
+             315:     12(int) Load 314
+                              Store 128(HeightU) 315
+             316:     13(ptr) AccessChain 309(sizeQueryTemp) 190
+             317:     12(int) Load 316
+                              Store 260(DepthU) 317
+             318:         298 Load 300(g_tTex3du4)
+             319:     12(int) ImageQueryLevels 318
+                              Store 29(NumberOfLevelsU) 319
+             324:         321 Load 323(g_tTexcdf4)
+             325:   58(ivec2) ImageQuerySizeLod 324 20
+                              Store 320(sizeQueryTemp) 325
+             326:     13(ptr) AccessChain 320(sizeQueryTemp) 66
+             327:     12(int) Load 326
+                              Store 22(WidthU) 327
+             328:     13(ptr) AccessChain 320(sizeQueryTemp) 70
+             329:     12(int) Load 328
+                              Store 128(HeightU) 329
+             331:         321 Load 323(g_tTexcdf4)
+             332:   58(ivec2) ImageQuerySizeLod 331 26
+                              Store 330(sizeQueryTemp) 332
+             333:     13(ptr) AccessChain 330(sizeQueryTemp) 66
+             334:     12(int) Load 333
+                              Store 22(WidthU) 334
+             335:     13(ptr) AccessChain 330(sizeQueryTemp) 70
+             336:     12(int) Load 335
+                              Store 128(HeightU) 336
+             337:         321 Load 323(g_tTexcdf4)
+             338:     12(int) ImageQueryLevels 337
+                              Store 29(NumberOfLevelsU) 338
+             343:         340 Load 342(g_tTexcdi4)
+             344:   58(ivec2) ImageQuerySizeLod 343 20
+                              Store 339(sizeQueryTemp) 344
+             345:     13(ptr) AccessChain 339(sizeQueryTemp) 66
+             346:     12(int) Load 345
+                              Store 22(WidthU) 346
+             347:     13(ptr) AccessChain 339(sizeQueryTemp) 70
+             348:     12(int) Load 347
+                              Store 128(HeightU) 348
+             350:         340 Load 342(g_tTexcdi4)
+             351:   58(ivec2) ImageQuerySizeLod 350 26
+                              Store 349(sizeQueryTemp) 351
+             352:     13(ptr) AccessChain 349(sizeQueryTemp) 66
+             353:     12(int) Load 352
+                              Store 22(WidthU) 353
+             354:     13(ptr) AccessChain 349(sizeQueryTemp) 70
+             355:     12(int) Load 354
+                              Store 128(HeightU) 355
+             356:         340 Load 342(g_tTexcdi4)
+             357:     12(int) ImageQueryLevels 356
+                              Store 29(NumberOfLevelsU) 357
+             362:         359 Load 361(g_tTexcdu4)
+             363:   58(ivec2) ImageQuerySizeLod 362 20
+                              Store 358(sizeQueryTemp) 363
+             364:     13(ptr) AccessChain 358(sizeQueryTemp) 66
+             365:     12(int) Load 364
+                              Store 22(WidthU) 365
+             366:     13(ptr) AccessChain 358(sizeQueryTemp) 70
+             367:     12(int) Load 366
+                              Store 128(HeightU) 367
+             369:         359 Load 361(g_tTexcdu4)
+             370:   58(ivec2) ImageQuerySizeLod 369 26
+                              Store 368(sizeQueryTemp) 370
+             371:     13(ptr) AccessChain 368(sizeQueryTemp) 66
+             372:     12(int) Load 371
+                              Store 22(WidthU) 372
+             373:     13(ptr) AccessChain 368(sizeQueryTemp) 70
+             374:     12(int) Load 373
+                              Store 128(HeightU) 374
+             375:         359 Load 361(g_tTexcdu4)
+             376:     12(int) ImageQueryLevels 375
+                              Store 29(NumberOfLevelsU) 376
+             381:         378 Load 380(g_tTexcdf4a)
+             382:  178(ivec3) ImageQuerySizeLod 381 20
+                              Store 377(sizeQueryTemp) 382
+             383:     13(ptr) AccessChain 377(sizeQueryTemp) 66
+             384:     12(int) Load 383
+                              Store 22(WidthU) 384
+             385:     13(ptr) AccessChain 377(sizeQueryTemp) 70
+             386:     12(int) Load 385
+                              Store 128(HeightU) 386
+             387:     13(ptr) AccessChain 377(sizeQueryTemp) 190
+             388:     12(int) Load 387
+                              Store 69(ElementsU) 388
+             390:         378 Load 380(g_tTexcdf4a)
+             391:  178(ivec3) ImageQuerySizeLod 390 26
+                              Store 389(sizeQueryTemp) 391
+             392:     13(ptr) AccessChain 389(sizeQueryTemp) 66
+             393:     12(int) Load 392
+                              Store 22(WidthU) 393
+             394:     13(ptr) AccessChain 389(sizeQueryTemp) 70
+             395:     12(int) Load 394
+                              Store 128(HeightU) 395
+             396:     13(ptr) AccessChain 389(sizeQueryTemp) 190
+             397:     12(int) Load 396
+                              Store 69(ElementsU) 397
+             398:         378 Load 380(g_tTexcdf4a)
+             399:     12(int) ImageQueryLevels 398
+                              Store 29(NumberOfLevelsU) 399
+             404:         401 Load 403(g_tTexcdi4a)
+             405:  178(ivec3) ImageQuerySizeLod 404 20
+                              Store 400(sizeQueryTemp) 405
+             406:     13(ptr) AccessChain 400(sizeQueryTemp) 66
+             407:     12(int) Load 406
+                              Store 22(WidthU) 407
+             408:     13(ptr) AccessChain 400(sizeQueryTemp) 70
+             409:     12(int) Load 408
+                              Store 128(HeightU) 409
+             410:     13(ptr) AccessChain 400(sizeQueryTemp) 190
+             411:     12(int) Load 410
+                              Store 69(ElementsU) 411
+             413:         401 Load 403(g_tTexcdi4a)
+             414:  178(ivec3) ImageQuerySizeLod 413 26
+                              Store 412(sizeQueryTemp) 414
+             415:     13(ptr) AccessChain 412(sizeQueryTemp) 66
+             416:     12(int) Load 415
+                              Store 22(WidthU) 416
+             417:     13(ptr) AccessChain 412(sizeQueryTemp) 70
+             418:     12(int) Load 417
+                              Store 128(HeightU) 418
+             419:     13(ptr) AccessChain 412(sizeQueryTemp) 190
+             420:     12(int) Load 419
+                              Store 69(ElementsU) 420
+             421:         401 Load 403(g_tTexcdi4a)
+             422:     12(int) ImageQueryLevels 421
+                              Store 29(NumberOfLevelsU) 422
+             427:         424 Load 426(g_tTexcdu4a)
+             428:  178(ivec3) ImageQuerySizeLod 427 20
+                              Store 423(sizeQueryTemp) 428
+             429:     13(ptr) AccessChain 423(sizeQueryTemp) 66
+             430:     12(int) Load 429
+                              Store 22(WidthU) 430
+             431:     13(ptr) AccessChain 423(sizeQueryTemp) 70
+             432:     12(int) Load 431
+                              Store 128(HeightU) 432
+             433:     13(ptr) AccessChain 423(sizeQueryTemp) 190
+             434:     12(int) Load 433
+                              Store 69(ElementsU) 434
+             436:         424 Load 426(g_tTexcdu4a)
+             437:  178(ivec3) ImageQuerySizeLod 436 26
+                              Store 435(sizeQueryTemp) 437
+             438:     13(ptr) AccessChain 435(sizeQueryTemp) 66
+             439:     12(int) Load 438
+                              Store 22(WidthU) 439
+             440:     13(ptr) AccessChain 435(sizeQueryTemp) 70
+             441:     12(int) Load 440
+                              Store 128(HeightU) 441
+             442:     13(ptr) AccessChain 435(sizeQueryTemp) 190
+             443:     12(int) Load 442
+                              Store 69(ElementsU) 443
+             444:         424 Load 426(g_tTexcdu4a)
+             445:     12(int) ImageQueryLevels 444
+                              Store 29(NumberOfLevelsU) 445
+             450:         447 Load 449(g_tTex2dmsf4)
+             451:   58(ivec2) ImageQuerySize 450
+                              Store 446(sizeQueryTemp) 451
+             452:     13(ptr) AccessChain 446(sizeQueryTemp) 66
+             453:     12(int) Load 452
+                              Store 22(WidthU) 453
+             454:     13(ptr) AccessChain 446(sizeQueryTemp) 70
+             455:     12(int) Load 454
+                              Store 128(HeightU) 455
+             457:         447 Load 449(g_tTex2dmsf4)
+             458:     12(int) ImageQuerySamples 457
+                              Store 456(NumberOfSamplesU) 458
+             463:         460 Load 462(g_tTex2dmsi4)
+             464:   58(ivec2) ImageQuerySize 463
+                              Store 459(sizeQueryTemp) 464
+             465:     13(ptr) AccessChain 459(sizeQueryTemp) 66
+             466:     12(int) Load 465
+                              Store 22(WidthU) 466
+             467:     13(ptr) AccessChain 459(sizeQueryTemp) 70
+             468:     12(int) Load 467
+                              Store 128(HeightU) 468
+             469:         460 Load 462(g_tTex2dmsi4)
+             470:     12(int) ImageQuerySamples 469
+                              Store 456(NumberOfSamplesU) 470
+             475:         472 Load 474(g_tTex2dmsu4)
+             476:   58(ivec2) ImageQuerySize 475
+                              Store 471(sizeQueryTemp) 476
+             477:     13(ptr) AccessChain 471(sizeQueryTemp) 66
+             478:     12(int) Load 477
+                              Store 22(WidthU) 478
+             479:     13(ptr) AccessChain 471(sizeQueryTemp) 70
+             480:     12(int) Load 479
+                              Store 128(HeightU) 480
+             481:         472 Load 474(g_tTex2dmsu4)
+             482:     12(int) ImageQuerySamples 481
+                              Store 456(NumberOfSamplesU) 482
+             487:         484 Load 486(g_tTex2dmsf4a)
+             488:  178(ivec3) ImageQuerySize 487
+                              Store 483(sizeQueryTemp) 488
+             489:     13(ptr) AccessChain 483(sizeQueryTemp) 66
+             490:     12(int) Load 489
+                              Store 22(WidthU) 490
+             491:     13(ptr) AccessChain 483(sizeQueryTemp) 70
+             492:     12(int) Load 491
+                              Store 128(HeightU) 492
+             493:     13(ptr) AccessChain 483(sizeQueryTemp) 190
+             494:     12(int) Load 493
+                              Store 69(ElementsU) 494
+             495:         484 Load 486(g_tTex2dmsf4a)
+             496:     12(int) ImageQuerySamples 495
+                              Store 456(NumberOfSamplesU) 496
+             501:         498 Load 500(g_tTex2dmsi4a)
+             502:  178(ivec3) ImageQuerySize 501
+                              Store 497(sizeQueryTemp) 502
+             503:     13(ptr) AccessChain 497(sizeQueryTemp) 66
+             504:     12(int) Load 503
+                              Store 22(WidthU) 504
+             505:     13(ptr) AccessChain 497(sizeQueryTemp) 70
+             506:     12(int) Load 505
+                              Store 128(HeightU) 506
+             507:     13(ptr) AccessChain 497(sizeQueryTemp) 190
+             508:     12(int) Load 507
+                              Store 69(ElementsU) 508
+             509:         498 Load 500(g_tTex2dmsi4a)
+             510:     12(int) ImageQuerySamples 509
+                              Store 456(NumberOfSamplesU) 510
+             515:         512 Load 514(g_tTex2dmsu4a)
+             516:  178(ivec3) ImageQuerySize 515
+                              Store 511(sizeQueryTemp) 516
+             517:     13(ptr) AccessChain 511(sizeQueryTemp) 66
+             518:     12(int) Load 517
+                              Store 22(WidthU) 518
+             519:     13(ptr) AccessChain 511(sizeQueryTemp) 70
+             520:     12(int) Load 519
+                              Store 128(HeightU) 520
+             521:     13(ptr) AccessChain 511(sizeQueryTemp) 190
+             522:     12(int) Load 521
+                              Store 69(ElementsU) 522
+             523:         512 Load 514(g_tTex2dmsu4a)
+             524:     12(int) ImageQuerySamples 523
+                              Store 456(NumberOfSamplesU) 524
+             530:    529(ptr) AccessChain 526(psout) 20
+                              Store 530 528
+             533:    532(ptr) AccessChain 526(psout) 531
+                              Store 533 527
+             534:8(PS_OUTPUT) Load 526(psout)
+                              ReturnValue 534
                               FunctionEnd

+ 39 - 27
3rdparty/glslang/Test/baseResults/hlsl.getdimensions.dx10.vert.out

@@ -9,6 +9,8 @@ Shader version: 450
 0:21          'sizeQueryTemp' (temp uint)
 0:21          textureSize (temp uint)
 0:21            'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:21            Constant:
+0:21              0 (const int)
 0:21        move second child to first child (temp uint)
 0:21          'WidthU' (temp uint)
 0:21          'sizeQueryTemp' (temp uint)
@@ -51,6 +53,7 @@ Shader version: 450
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 
 
 Linked vertex stage:
@@ -66,6 +69,8 @@ Shader version: 450
 0:21          'sizeQueryTemp' (temp uint)
 0:21          textureSize (temp uint)
 0:21            'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:21            Constant:
+0:21              0 (const int)
 0:21        move second child to first child (temp uint)
 0:21          'WidthU' (temp uint)
 0:21          'sizeQueryTemp' (temp uint)
@@ -108,34 +113,38 @@ Shader version: 450
 0:?   Linker Objects
 0:?     'g_sSamp' (layout(binding=0 ) uniform sampler)
 0:?     'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 48
+// Id's are bound by 51
 
                               Capability Shader
                               Capability Sampled1D
                               Capability ImageQuery
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 42
+                              EntryPoint Vertex 4  "main" 42 50
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
                               MemberName 8(VS_OUTPUT) 0  "Pos"
                               Name 10  "@main("
                               Name 14  "sizeQueryTemp"
                               Name 17  "g_tTex1df4"
-                              Name 21  "WidthU"
-                              Name 23  "sizeQueryTemp"
-                              Name 28  "NumberOfLevelsU"
-                              Name 32  "vsout"
+                              Name 22  "WidthU"
+                              Name 24  "sizeQueryTemp"
+                              Name 29  "NumberOfLevelsU"
+                              Name 33  "vsout"
                               Name 42  "@entryPointOutput_Pos"
                               Name 47  "g_sSamp"
+                              Name 48  "VS_OUTPUT"
+                              Name 50  "@entryPointOutput"
                               Decorate 17(g_tTex1df4) DescriptorSet 0
                               Decorate 17(g_tTex1df4) Binding 0
                               Decorate 42(@entryPointOutput_Pos) BuiltIn Position
                               Decorate 47(g_sSamp) DescriptorSet 0
                               Decorate 47(g_sSamp) Binding 0
+                              Decorate 50(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -148,9 +157,9 @@ Shader version: 450
               16:             TypePointer UniformConstant 15
   17(g_tTex1df4):     16(ptr) Variable UniformConstant
               19:             TypeInt 32 1
-              25:     12(int) Constant 6
-              31:             TypePointer Function 8(VS_OUTPUT)
-              33:     19(int) Constant 0
+              20:     19(int) Constant 0
+              26:     12(int) Constant 6
+              32:             TypePointer Function 8(VS_OUTPUT)
               34:    6(float) Constant 0
               35:    7(fvec4) ConstantComposite 34 34 34 34
               36:             TypePointer Function 7(fvec4)
@@ -159,6 +168,9 @@ Shader version: 450
               45:             TypeSampler
               46:             TypePointer UniformConstant 45
      47(g_sSamp):     46(ptr) Variable UniformConstant
+   48(VS_OUTPUT):             TypeStruct
+              49:             TypePointer Output 48(VS_OUTPUT)
+50(@entryPointOutput):     49(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
               43:8(VS_OUTPUT) FunctionCall 10(@main()
@@ -169,25 +181,25 @@ Shader version: 450
       10(@main():8(VS_OUTPUT) Function None 9
               11:             Label
 14(sizeQueryTemp):     13(ptr) Variable Function
-      21(WidthU):     13(ptr) Variable Function
-23(sizeQueryTemp):     13(ptr) Variable Function
-28(NumberOfLevelsU):     13(ptr) Variable Function
-       32(vsout):     31(ptr) Variable Function
+      22(WidthU):     13(ptr) Variable Function
+24(sizeQueryTemp):     13(ptr) Variable Function
+29(NumberOfLevelsU):     13(ptr) Variable Function
+       33(vsout):     32(ptr) Variable Function
               18:          15 Load 17(g_tTex1df4)
-              20:     19(int) ImageQuerySize 18
-                              Store 14(sizeQueryTemp) 20
-              22:     12(int) Load 14(sizeQueryTemp)
-                              Store 21(WidthU) 22
-              24:          15 Load 17(g_tTex1df4)
-              26:     19(int) ImageQuerySizeLod 24 25
-                              Store 23(sizeQueryTemp) 26
-              27:     12(int) Load 23(sizeQueryTemp)
-                              Store 21(WidthU) 27
-              29:          15 Load 17(g_tTex1df4)
-              30:     19(int) ImageQueryLevels 29
-                              Store 28(NumberOfLevelsU) 30
-              37:     36(ptr) AccessChain 32(vsout) 33
+              21:     12(int) ImageQuerySizeLod 18 20
+                              Store 14(sizeQueryTemp) 21
+              23:     12(int) Load 14(sizeQueryTemp)
+                              Store 22(WidthU) 23
+              25:          15 Load 17(g_tTex1df4)
+              27:     12(int) ImageQuerySizeLod 25 26
+                              Store 24(sizeQueryTemp) 27
+              28:     12(int) Load 24(sizeQueryTemp)
+                              Store 22(WidthU) 28
+              30:          15 Load 17(g_tTex1df4)
+              31:     12(int) ImageQueryLevels 30
+                              Store 29(NumberOfLevelsU) 31
+              37:     36(ptr) AccessChain 33(vsout) 20
                               Store 37 35
-              38:8(VS_OUTPUT) Load 32(vsout)
+              38:8(VS_OUTPUT) Load 33(vsout)
                               ReturnValue 38
                               FunctionEnd

+ 270 - 270
3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out

@@ -725,7 +725,7 @@ gl_FragCoord origin is upper left
                               Capability ImageQuery
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 218 222
+                              EntryPoint Fragment 4  "main" 216 220
                               ExecutionMode 4 OriginUpperLeft
                               Name 4  "main"
                               Name 8  "PS_OUTPUT"
@@ -734,8 +734,8 @@ gl_FragCoord origin is upper left
                               Name 10  "@main("
                               Name 14  "sizeQueryTemp"
                               Name 17  "g_tTex1df4"
-                              Name 21  "WidthU"
-                              Name 23  "sizeQueryTemp"
+                              Name 20  "WidthU"
+                              Name 22  "sizeQueryTemp"
                               Name 26  "g_tTex1di4"
                               Name 30  "sizeQueryTemp"
                               Name 33  "g_tTex1du4"
@@ -747,36 +747,36 @@ gl_FragCoord origin is upper left
                               Name 54  "g_tBuffU"
                               Name 60  "sizeQueryTemp"
                               Name 63  "g_tTex1df4a"
-                              Name 70  "ElementsU"
-                              Name 74  "sizeQueryTemp"
-                              Name 77  "g_tTex1di4a"
-                              Name 84  "sizeQueryTemp"
-                              Name 87  "g_tTex1du4a"
-                              Name 94  "sizeQueryTemp"
-                              Name 97  "g_tTex2df4"
-                              Name 102  "HeightU"
-                              Name 105  "sizeQueryTemp"
-                              Name 108  "g_tTex2di4"
-                              Name 115  "sizeQueryTemp"
-                              Name 118  "g_tTex2du4"
-                              Name 127  "sizeQueryTemp"
-                              Name 130  "g_tTex2df4a"
-                              Name 141  "sizeQueryTemp"
-                              Name 144  "g_tTex2di4a"
-                              Name 153  "sizeQueryTemp"
-                              Name 156  "g_tTex2du4a"
-                              Name 165  "sizeQueryTemp"
-                              Name 168  "g_tTex3df4"
-                              Name 175  "DepthU"
-                              Name 178  "sizeQueryTemp"
-                              Name 181  "g_tTex3di4"
-                              Name 190  "sizeQueryTemp"
-                              Name 193  "g_tTex3du4"
-                              Name 203  "psout"
-                              Name 215  "flattenTemp"
-                              Name 218  "Color"
-                              Name 222  "Depth"
-                              Name 227  "g_sSamp"
+                              Name 69  "ElementsU"
+                              Name 73  "sizeQueryTemp"
+                              Name 76  "g_tTex1di4a"
+                              Name 83  "sizeQueryTemp"
+                              Name 86  "g_tTex1du4a"
+                              Name 93  "sizeQueryTemp"
+                              Name 96  "g_tTex2df4"
+                              Name 101  "HeightU"
+                              Name 104  "sizeQueryTemp"
+                              Name 107  "g_tTex2di4"
+                              Name 114  "sizeQueryTemp"
+                              Name 117  "g_tTex2du4"
+                              Name 126  "sizeQueryTemp"
+                              Name 129  "g_tTex2df4a"
+                              Name 139  "sizeQueryTemp"
+                              Name 142  "g_tTex2di4a"
+                              Name 151  "sizeQueryTemp"
+                              Name 154  "g_tTex2du4a"
+                              Name 163  "sizeQueryTemp"
+                              Name 166  "g_tTex3df4"
+                              Name 173  "DepthU"
+                              Name 176  "sizeQueryTemp"
+                              Name 179  "g_tTex3di4"
+                              Name 188  "sizeQueryTemp"
+                              Name 191  "g_tTex3du4"
+                              Name 201  "psout"
+                              Name 213  "flattenTemp"
+                              Name 216  "Color"
+                              Name 220  "Depth"
+                              Name 225  "g_sSamp"
                               Name 229  "$Global"
                               MemberName 229($Global) 0  "c1"
                               MemberName 229($Global) 1  "c2"
@@ -795,21 +795,21 @@ gl_FragCoord origin is upper left
                               Decorate 47(g_tBuffI) DescriptorSet 0
                               Decorate 54(g_tBuffU) DescriptorSet 0
                               Decorate 63(g_tTex1df4a) DescriptorSet 0
-                              Decorate 77(g_tTex1di4a) DescriptorSet 0
-                              Decorate 87(g_tTex1du4a) DescriptorSet 0
-                              Decorate 97(g_tTex2df4) DescriptorSet 0
-                              Decorate 108(g_tTex2di4) DescriptorSet 0
-                              Decorate 118(g_tTex2du4) DescriptorSet 0
-                              Decorate 130(g_tTex2df4a) DescriptorSet 0
-                              Decorate 144(g_tTex2di4a) DescriptorSet 0
-                              Decorate 156(g_tTex2du4a) DescriptorSet 0
-                              Decorate 168(g_tTex3df4) DescriptorSet 0
-                              Decorate 181(g_tTex3di4) DescriptorSet 0
-                              Decorate 193(g_tTex3du4) DescriptorSet 0
-                              Decorate 218(Color) Location 0
-                              Decorate 222(Depth) BuiltIn FragDepth
-                              Decorate 227(g_sSamp) DescriptorSet 0
-                              Decorate 227(g_sSamp) Binding 0
+                              Decorate 76(g_tTex1di4a) DescriptorSet 0
+                              Decorate 86(g_tTex1du4a) DescriptorSet 0
+                              Decorate 96(g_tTex2df4) DescriptorSet 0
+                              Decorate 107(g_tTex2di4) DescriptorSet 0
+                              Decorate 117(g_tTex2du4) DescriptorSet 0
+                              Decorate 129(g_tTex2df4a) DescriptorSet 0
+                              Decorate 142(g_tTex2di4a) DescriptorSet 0
+                              Decorate 154(g_tTex2du4a) DescriptorSet 0
+                              Decorate 166(g_tTex3df4) DescriptorSet 0
+                              Decorate 179(g_tTex3di4) DescriptorSet 0
+                              Decorate 191(g_tTex3du4) DescriptorSet 0
+                              Decorate 216(Color) Location 0
+                              Decorate 220(Depth) BuiltIn FragDepth
+                              Decorate 225(g_sSamp) DescriptorSet 0
+                              Decorate 225(g_sSamp) Binding 0
                               MemberDecorate 229($Global) 0 Offset 0
                               MemberDecorate 229($Global) 1 Offset 8
                               MemberDecorate 229($Global) 2 Offset 16
@@ -831,8 +831,8 @@ gl_FragCoord origin is upper left
               15:             TypeImage 6(float) 1D nonsampled format:Rgba32f
               16:             TypePointer UniformConstant 15
   17(g_tTex1df4):     16(ptr) Variable UniformConstant
-              19:             TypeInt 32 1
-              24:             TypeImage 19(int) 1D nonsampled format:Rgba32i
+              23:             TypeInt 32 1
+              24:             TypeImage 23(int) 1D nonsampled format:Rgba32i
               25:             TypePointer UniformConstant 24
   26(g_tTex1di4):     25(ptr) Variable UniformConstant
               31:             TypeImage 12(int) 1D nonsampled format:Rgba32ui
@@ -841,7 +841,7 @@ gl_FragCoord origin is upper left
               38:             TypeImage 6(float) Buffer nonsampled format:Rgba32f
               39:             TypePointer UniformConstant 38
     40(g_tBuffF):     39(ptr) Variable UniformConstant
-              45:             TypeImage 19(int) Buffer nonsampled format:Rgba32i
+              45:             TypeImage 23(int) Buffer nonsampled format:Rgba32i
               46:             TypePointer UniformConstant 45
     47(g_tBuffI):     46(ptr) Variable UniformConstant
               52:             TypeImage 12(int) Buffer nonsampled format:Rgba32ui
@@ -852,262 +852,262 @@ gl_FragCoord origin is upper left
               61:             TypeImage 6(float) 1D array nonsampled format:Rgba32f
               62:             TypePointer UniformConstant 61
  63(g_tTex1df4a):     62(ptr) Variable UniformConstant
-              65:             TypeVector 19(int) 2
-              67:     12(int) Constant 0
-              71:     12(int) Constant 1
-              75:             TypeImage 19(int) 1D array nonsampled format:Rgba32i
-              76:             TypePointer UniformConstant 75
- 77(g_tTex1di4a):     76(ptr) Variable UniformConstant
-              85:             TypeImage 12(int) 1D array nonsampled format:Rgba32ui
-              86:             TypePointer UniformConstant 85
- 87(g_tTex1du4a):     86(ptr) Variable UniformConstant
-              95:             TypeImage 6(float) 2D nonsampled format:Rgba32f
-              96:             TypePointer UniformConstant 95
-  97(g_tTex2df4):     96(ptr) Variable UniformConstant
-             106:             TypeImage 19(int) 2D nonsampled format:Rgba32i
-             107:             TypePointer UniformConstant 106
- 108(g_tTex2di4):    107(ptr) Variable UniformConstant
-             116:             TypeImage 12(int) 2D nonsampled format:Rgba32ui
-             117:             TypePointer UniformConstant 116
- 118(g_tTex2du4):    117(ptr) Variable UniformConstant
-             125:             TypeVector 12(int) 3
-             126:             TypePointer Function 125(ivec3)
-             128:             TypeImage 6(float) 2D array nonsampled format:Rgba32f
-             129:             TypePointer UniformConstant 128
-130(g_tTex2df4a):    129(ptr) Variable UniformConstant
-             132:             TypeVector 19(int) 3
-             138:     12(int) Constant 2
-             142:             TypeImage 19(int) 2D array nonsampled format:Rgba32i
-             143:             TypePointer UniformConstant 142
-144(g_tTex2di4a):    143(ptr) Variable UniformConstant
-             154:             TypeImage 12(int) 2D array nonsampled format:Rgba32ui
-             155:             TypePointer UniformConstant 154
-156(g_tTex2du4a):    155(ptr) Variable UniformConstant
-             166:             TypeImage 6(float) 3D nonsampled format:Rgba32f
-             167:             TypePointer UniformConstant 166
- 168(g_tTex3df4):    167(ptr) Variable UniformConstant
-             179:             TypeImage 19(int) 3D nonsampled format:Rgba32i
-             180:             TypePointer UniformConstant 179
- 181(g_tTex3di4):    180(ptr) Variable UniformConstant
-             191:             TypeImage 12(int) 3D nonsampled format:Rgba32ui
-             192:             TypePointer UniformConstant 191
- 193(g_tTex3du4):    192(ptr) Variable UniformConstant
-             202:             TypePointer Function 8(PS_OUTPUT)
-             204:     19(int) Constant 0
-             205:    6(float) Constant 1065353216
-             206:    7(fvec4) ConstantComposite 205 205 205 205
-             207:             TypePointer Function 7(fvec4)
-             209:     19(int) Constant 1
-             210:             TypePointer Function 6(float)
-             217:             TypePointer Output 7(fvec4)
-      218(Color):    217(ptr) Variable Output
-             221:             TypePointer Output 6(float)
-      222(Depth):    221(ptr) Variable Output
-             225:             TypeSampler
-             226:             TypePointer UniformConstant 225
-    227(g_sSamp):    226(ptr) Variable UniformConstant
-             228:             TypeVector 19(int) 4
-    229($Global):             TypeStruct 19(int) 65(ivec2) 132(ivec3) 228(ivec4) 19(int) 65(ivec2) 132(ivec3) 228(ivec4)
+              66:     12(int) Constant 0
+              70:     12(int) Constant 1
+              74:             TypeImage 23(int) 1D array nonsampled format:Rgba32i
+              75:             TypePointer UniformConstant 74
+ 76(g_tTex1di4a):     75(ptr) Variable UniformConstant
+              84:             TypeImage 12(int) 1D array nonsampled format:Rgba32ui
+              85:             TypePointer UniformConstant 84
+ 86(g_tTex1du4a):     85(ptr) Variable UniformConstant
+              94:             TypeImage 6(float) 2D nonsampled format:Rgba32f
+              95:             TypePointer UniformConstant 94
+  96(g_tTex2df4):     95(ptr) Variable UniformConstant
+             105:             TypeImage 23(int) 2D nonsampled format:Rgba32i
+             106:             TypePointer UniformConstant 105
+ 107(g_tTex2di4):    106(ptr) Variable UniformConstant
+             115:             TypeImage 12(int) 2D nonsampled format:Rgba32ui
+             116:             TypePointer UniformConstant 115
+ 117(g_tTex2du4):    116(ptr) Variable UniformConstant
+             124:             TypeVector 12(int) 3
+             125:             TypePointer Function 124(ivec3)
+             127:             TypeImage 6(float) 2D array nonsampled format:Rgba32f
+             128:             TypePointer UniformConstant 127
+129(g_tTex2df4a):    128(ptr) Variable UniformConstant
+             136:     12(int) Constant 2
+             140:             TypeImage 23(int) 2D array nonsampled format:Rgba32i
+             141:             TypePointer UniformConstant 140
+142(g_tTex2di4a):    141(ptr) Variable UniformConstant
+             152:             TypeImage 12(int) 2D array nonsampled format:Rgba32ui
+             153:             TypePointer UniformConstant 152
+154(g_tTex2du4a):    153(ptr) Variable UniformConstant
+             164:             TypeImage 6(float) 3D nonsampled format:Rgba32f
+             165:             TypePointer UniformConstant 164
+ 166(g_tTex3df4):    165(ptr) Variable UniformConstant
+             177:             TypeImage 23(int) 3D nonsampled format:Rgba32i
+             178:             TypePointer UniformConstant 177
+ 179(g_tTex3di4):    178(ptr) Variable UniformConstant
+             189:             TypeImage 12(int) 3D nonsampled format:Rgba32ui
+             190:             TypePointer UniformConstant 189
+ 191(g_tTex3du4):    190(ptr) Variable UniformConstant
+             200:             TypePointer Function 8(PS_OUTPUT)
+             202:     23(int) Constant 0
+             203:    6(float) Constant 1065353216
+             204:    7(fvec4) ConstantComposite 203 203 203 203
+             205:             TypePointer Function 7(fvec4)
+             207:     23(int) Constant 1
+             208:             TypePointer Function 6(float)
+             215:             TypePointer Output 7(fvec4)
+      216(Color):    215(ptr) Variable Output
+             219:             TypePointer Output 6(float)
+      220(Depth):    219(ptr) Variable Output
+             223:             TypeSampler
+             224:             TypePointer UniformConstant 223
+    225(g_sSamp):    224(ptr) Variable UniformConstant
+             226:             TypeVector 23(int) 2
+             227:             TypeVector 23(int) 3
+             228:             TypeVector 23(int) 4
+    229($Global):             TypeStruct 23(int) 226(ivec2) 227(ivec3) 228(ivec4) 23(int) 226(ivec2) 227(ivec3) 228(ivec4)
              230:             TypePointer Uniform 229($Global)
              231:    230(ptr) Variable Uniform
          4(main):           2 Function None 3
                5:             Label
-215(flattenTemp):    202(ptr) Variable Function
-             216:8(PS_OUTPUT) FunctionCall 10(@main()
-                              Store 215(flattenTemp) 216
-             219:    207(ptr) AccessChain 215(flattenTemp) 204
-             220:    7(fvec4) Load 219
-                              Store 218(Color) 220
-             223:    210(ptr) AccessChain 215(flattenTemp) 209
-             224:    6(float) Load 223
-                              Store 222(Depth) 224
+213(flattenTemp):    200(ptr) Variable Function
+             214:8(PS_OUTPUT) FunctionCall 10(@main()
+                              Store 213(flattenTemp) 214
+             217:    205(ptr) AccessChain 213(flattenTemp) 202
+             218:    7(fvec4) Load 217
+                              Store 216(Color) 218
+             221:    208(ptr) AccessChain 213(flattenTemp) 207
+             222:    6(float) Load 221
+                              Store 220(Depth) 222
                               Return
                               FunctionEnd
       10(@main():8(PS_OUTPUT) Function None 9
               11:             Label
 14(sizeQueryTemp):     13(ptr) Variable Function
-      21(WidthU):     13(ptr) Variable Function
-23(sizeQueryTemp):     13(ptr) Variable Function
+      20(WidthU):     13(ptr) Variable Function
+22(sizeQueryTemp):     13(ptr) Variable Function
 30(sizeQueryTemp):     13(ptr) Variable Function
 37(sizeQueryTemp):     13(ptr) Variable Function
 44(sizeQueryTemp):     13(ptr) Variable Function
 51(sizeQueryTemp):     13(ptr) Variable Function
 60(sizeQueryTemp):     59(ptr) Variable Function
-   70(ElementsU):     13(ptr) Variable Function
-74(sizeQueryTemp):     59(ptr) Variable Function
-84(sizeQueryTemp):     59(ptr) Variable Function
-94(sizeQueryTemp):     59(ptr) Variable Function
-    102(HeightU):     13(ptr) Variable Function
-105(sizeQueryTemp):     59(ptr) Variable Function
-115(sizeQueryTemp):     59(ptr) Variable Function
-127(sizeQueryTemp):    126(ptr) Variable Function
-141(sizeQueryTemp):    126(ptr) Variable Function
-153(sizeQueryTemp):    126(ptr) Variable Function
-165(sizeQueryTemp):    126(ptr) Variable Function
-     175(DepthU):     13(ptr) Variable Function
-178(sizeQueryTemp):    126(ptr) Variable Function
-190(sizeQueryTemp):    126(ptr) Variable Function
-      203(psout):    202(ptr) Variable Function
+   69(ElementsU):     13(ptr) Variable Function
+73(sizeQueryTemp):     59(ptr) Variable Function
+83(sizeQueryTemp):     59(ptr) Variable Function
+93(sizeQueryTemp):     59(ptr) Variable Function
+    101(HeightU):     13(ptr) Variable Function
+104(sizeQueryTemp):     59(ptr) Variable Function
+114(sizeQueryTemp):     59(ptr) Variable Function
+126(sizeQueryTemp):    125(ptr) Variable Function
+139(sizeQueryTemp):    125(ptr) Variable Function
+151(sizeQueryTemp):    125(ptr) Variable Function
+163(sizeQueryTemp):    125(ptr) Variable Function
+     173(DepthU):     13(ptr) Variable Function
+176(sizeQueryTemp):    125(ptr) Variable Function
+188(sizeQueryTemp):    125(ptr) Variable Function
+      201(psout):    200(ptr) Variable Function
               18:          15 Load 17(g_tTex1df4)
-              20:     19(int) ImageQuerySize 18
-                              Store 14(sizeQueryTemp) 20
-              22:     12(int) Load 14(sizeQueryTemp)
-                              Store 21(WidthU) 22
+              19:     12(int) ImageQuerySize 18
+                              Store 14(sizeQueryTemp) 19
+              21:     12(int) Load 14(sizeQueryTemp)
+                              Store 20(WidthU) 21
               27:          24 Load 26(g_tTex1di4)
-              28:     19(int) ImageQuerySize 27
-                              Store 23(sizeQueryTemp) 28
-              29:     12(int) Load 23(sizeQueryTemp)
-                              Store 21(WidthU) 29
+              28:     12(int) ImageQuerySize 27
+                              Store 22(sizeQueryTemp) 28
+              29:     12(int) Load 22(sizeQueryTemp)
+                              Store 20(WidthU) 29
               34:          31 Load 33(g_tTex1du4)
-              35:     19(int) ImageQuerySize 34
+              35:     12(int) ImageQuerySize 34
                               Store 30(sizeQueryTemp) 35
               36:     12(int) Load 30(sizeQueryTemp)
-                              Store 21(WidthU) 36
+                              Store 20(WidthU) 36
               41:          38 Load 40(g_tBuffF)
-              42:     19(int) ImageQuerySize 41
+              42:     12(int) ImageQuerySize 41
                               Store 37(sizeQueryTemp) 42
               43:     12(int) Load 37(sizeQueryTemp)
-                              Store 21(WidthU) 43
+                              Store 20(WidthU) 43
               48:          45 Load 47(g_tBuffI)
-              49:     19(int) ImageQuerySize 48
+              49:     12(int) ImageQuerySize 48
                               Store 44(sizeQueryTemp) 49
               50:     12(int) Load 44(sizeQueryTemp)
-                              Store 21(WidthU) 50
+                              Store 20(WidthU) 50
               55:          52 Load 54(g_tBuffU)
-              56:     19(int) ImageQuerySize 55
+              56:     12(int) ImageQuerySize 55
                               Store 51(sizeQueryTemp) 56
               57:     12(int) Load 51(sizeQueryTemp)
-                              Store 21(WidthU) 57
+                              Store 20(WidthU) 57
               64:          61 Load 63(g_tTex1df4a)
-              66:   65(ivec2) ImageQuerySize 64
-                              Store 60(sizeQueryTemp) 66
-              68:     13(ptr) AccessChain 60(sizeQueryTemp) 67
-              69:     12(int) Load 68
-                              Store 21(WidthU) 69
-              72:     13(ptr) AccessChain 60(sizeQueryTemp) 71
-              73:     12(int) Load 72
-                              Store 70(ElementsU) 73
-              78:          75 Load 77(g_tTex1di4a)
-              79:   65(ivec2) ImageQuerySize 78
-                              Store 74(sizeQueryTemp) 79
-              80:     13(ptr) AccessChain 74(sizeQueryTemp) 67
-              81:     12(int) Load 80
-                              Store 21(WidthU) 81
-              82:     13(ptr) AccessChain 74(sizeQueryTemp) 71
-              83:     12(int) Load 82
-                              Store 70(ElementsU) 83
-              88:          85 Load 87(g_tTex1du4a)
-              89:   65(ivec2) ImageQuerySize 88
-                              Store 84(sizeQueryTemp) 89
-              90:     13(ptr) AccessChain 84(sizeQueryTemp) 67
-              91:     12(int) Load 90
-                              Store 21(WidthU) 91
-              92:     13(ptr) AccessChain 84(sizeQueryTemp) 71
-              93:     12(int) Load 92
-                              Store 70(ElementsU) 93
-              98:          95 Load 97(g_tTex2df4)
-              99:   65(ivec2) ImageQuerySize 98
-                              Store 94(sizeQueryTemp) 99
-             100:     13(ptr) AccessChain 94(sizeQueryTemp) 67
-             101:     12(int) Load 100
-                              Store 21(WidthU) 101
-             103:     13(ptr) AccessChain 94(sizeQueryTemp) 71
-             104:     12(int) Load 103
-                              Store 102(HeightU) 104
-             109:         106 Load 108(g_tTex2di4)
-             110:   65(ivec2) ImageQuerySize 109
-                              Store 105(sizeQueryTemp) 110
-             111:     13(ptr) AccessChain 105(sizeQueryTemp) 67
-             112:     12(int) Load 111
-                              Store 21(WidthU) 112
-             113:     13(ptr) AccessChain 105(sizeQueryTemp) 71
-             114:     12(int) Load 113
-                              Store 102(HeightU) 114
-             119:         116 Load 118(g_tTex2du4)
-             120:   65(ivec2) ImageQuerySize 119
-                              Store 115(sizeQueryTemp) 120
-             121:     13(ptr) AccessChain 115(sizeQueryTemp) 67
-             122:     12(int) Load 121
-                              Store 21(WidthU) 122
-             123:     13(ptr) AccessChain 115(sizeQueryTemp) 71
-             124:     12(int) Load 123
-                              Store 102(HeightU) 124
-             131:         128 Load 130(g_tTex2df4a)
-             133:  132(ivec3) ImageQuerySize 131
-                              Store 127(sizeQueryTemp) 133
-             134:     13(ptr) AccessChain 127(sizeQueryTemp) 67
+              65:   58(ivec2) ImageQuerySize 64
+                              Store 60(sizeQueryTemp) 65
+              67:     13(ptr) AccessChain 60(sizeQueryTemp) 66
+              68:     12(int) Load 67
+                              Store 20(WidthU) 68
+              71:     13(ptr) AccessChain 60(sizeQueryTemp) 70
+              72:     12(int) Load 71
+                              Store 69(ElementsU) 72
+              77:          74 Load 76(g_tTex1di4a)
+              78:   58(ivec2) ImageQuerySize 77
+                              Store 73(sizeQueryTemp) 78
+              79:     13(ptr) AccessChain 73(sizeQueryTemp) 66
+              80:     12(int) Load 79
+                              Store 20(WidthU) 80
+              81:     13(ptr) AccessChain 73(sizeQueryTemp) 70
+              82:     12(int) Load 81
+                              Store 69(ElementsU) 82
+              87:          84 Load 86(g_tTex1du4a)
+              88:   58(ivec2) ImageQuerySize 87
+                              Store 83(sizeQueryTemp) 88
+              89:     13(ptr) AccessChain 83(sizeQueryTemp) 66
+              90:     12(int) Load 89
+                              Store 20(WidthU) 90
+              91:     13(ptr) AccessChain 83(sizeQueryTemp) 70
+              92:     12(int) Load 91
+                              Store 69(ElementsU) 92
+              97:          94 Load 96(g_tTex2df4)
+              98:   58(ivec2) ImageQuerySize 97
+                              Store 93(sizeQueryTemp) 98
+              99:     13(ptr) AccessChain 93(sizeQueryTemp) 66
+             100:     12(int) Load 99
+                              Store 20(WidthU) 100
+             102:     13(ptr) AccessChain 93(sizeQueryTemp) 70
+             103:     12(int) Load 102
+                              Store 101(HeightU) 103
+             108:         105 Load 107(g_tTex2di4)
+             109:   58(ivec2) ImageQuerySize 108
+                              Store 104(sizeQueryTemp) 109
+             110:     13(ptr) AccessChain 104(sizeQueryTemp) 66
+             111:     12(int) Load 110
+                              Store 20(WidthU) 111
+             112:     13(ptr) AccessChain 104(sizeQueryTemp) 70
+             113:     12(int) Load 112
+                              Store 101(HeightU) 113
+             118:         115 Load 117(g_tTex2du4)
+             119:   58(ivec2) ImageQuerySize 118
+                              Store 114(sizeQueryTemp) 119
+             120:     13(ptr) AccessChain 114(sizeQueryTemp) 66
+             121:     12(int) Load 120
+                              Store 20(WidthU) 121
+             122:     13(ptr) AccessChain 114(sizeQueryTemp) 70
+             123:     12(int) Load 122
+                              Store 101(HeightU) 123
+             130:         127 Load 129(g_tTex2df4a)
+             131:  124(ivec3) ImageQuerySize 130
+                              Store 126(sizeQueryTemp) 131
+             132:     13(ptr) AccessChain 126(sizeQueryTemp) 66
+             133:     12(int) Load 132
+                              Store 20(WidthU) 133
+             134:     13(ptr) AccessChain 126(sizeQueryTemp) 70
              135:     12(int) Load 134
-                              Store 21(WidthU) 135
-             136:     13(ptr) AccessChain 127(sizeQueryTemp) 71
-             137:     12(int) Load 136
-                              Store 102(HeightU) 137
-             139:     13(ptr) AccessChain 127(sizeQueryTemp) 138
-             140:     12(int) Load 139
-                              Store 70(ElementsU) 140
-             145:         142 Load 144(g_tTex2di4a)
-             146:  132(ivec3) ImageQuerySize 145
-                              Store 141(sizeQueryTemp) 146
-             147:     13(ptr) AccessChain 141(sizeQueryTemp) 67
+                              Store 101(HeightU) 135
+             137:     13(ptr) AccessChain 126(sizeQueryTemp) 136
+             138:     12(int) Load 137
+                              Store 69(ElementsU) 138
+             143:         140 Load 142(g_tTex2di4a)
+             144:  124(ivec3) ImageQuerySize 143
+                              Store 139(sizeQueryTemp) 144
+             145:     13(ptr) AccessChain 139(sizeQueryTemp) 66
+             146:     12(int) Load 145
+                              Store 20(WidthU) 146
+             147:     13(ptr) AccessChain 139(sizeQueryTemp) 70
              148:     12(int) Load 147
-                              Store 21(WidthU) 148
-             149:     13(ptr) AccessChain 141(sizeQueryTemp) 71
+                              Store 101(HeightU) 148
+             149:     13(ptr) AccessChain 139(sizeQueryTemp) 136
              150:     12(int) Load 149
-                              Store 102(HeightU) 150
-             151:     13(ptr) AccessChain 141(sizeQueryTemp) 138
-             152:     12(int) Load 151
-                              Store 70(ElementsU) 152
-             157:         154 Load 156(g_tTex2du4a)
-             158:  132(ivec3) ImageQuerySize 157
-                              Store 153(sizeQueryTemp) 158
-             159:     13(ptr) AccessChain 153(sizeQueryTemp) 67
+                              Store 69(ElementsU) 150
+             155:         152 Load 154(g_tTex2du4a)
+             156:  124(ivec3) ImageQuerySize 155
+                              Store 151(sizeQueryTemp) 156
+             157:     13(ptr) AccessChain 151(sizeQueryTemp) 66
+             158:     12(int) Load 157
+                              Store 20(WidthU) 158
+             159:     13(ptr) AccessChain 151(sizeQueryTemp) 70
              160:     12(int) Load 159
-                              Store 21(WidthU) 160
-             161:     13(ptr) AccessChain 153(sizeQueryTemp) 71
+                              Store 101(HeightU) 160
+             161:     13(ptr) AccessChain 151(sizeQueryTemp) 136
              162:     12(int) Load 161
-                              Store 102(HeightU) 162
-             163:     13(ptr) AccessChain 153(sizeQueryTemp) 138
-             164:     12(int) Load 163
-                              Store 70(ElementsU) 164
-             169:         166 Load 168(g_tTex3df4)
-             170:  132(ivec3) ImageQuerySize 169
-                              Store 165(sizeQueryTemp) 170
-             171:     13(ptr) AccessChain 165(sizeQueryTemp) 67
+                              Store 69(ElementsU) 162
+             167:         164 Load 166(g_tTex3df4)
+             168:  124(ivec3) ImageQuerySize 167
+                              Store 163(sizeQueryTemp) 168
+             169:     13(ptr) AccessChain 163(sizeQueryTemp) 66
+             170:     12(int) Load 169
+                              Store 20(WidthU) 170
+             171:     13(ptr) AccessChain 163(sizeQueryTemp) 70
              172:     12(int) Load 171
-                              Store 21(WidthU) 172
-             173:     13(ptr) AccessChain 165(sizeQueryTemp) 71
-             174:     12(int) Load 173
-                              Store 102(HeightU) 174
-             176:     13(ptr) AccessChain 165(sizeQueryTemp) 138
-             177:     12(int) Load 176
-                              Store 175(DepthU) 177
-             182:         179 Load 181(g_tTex3di4)
-             183:  132(ivec3) ImageQuerySize 182
-                              Store 178(sizeQueryTemp) 183
-             184:     13(ptr) AccessChain 178(sizeQueryTemp) 67
+                              Store 101(HeightU) 172
+             174:     13(ptr) AccessChain 163(sizeQueryTemp) 136
+             175:     12(int) Load 174
+                              Store 173(DepthU) 175
+             180:         177 Load 179(g_tTex3di4)
+             181:  124(ivec3) ImageQuerySize 180
+                              Store 176(sizeQueryTemp) 181
+             182:     13(ptr) AccessChain 176(sizeQueryTemp) 66
+             183:     12(int) Load 182
+                              Store 20(WidthU) 183
+             184:     13(ptr) AccessChain 176(sizeQueryTemp) 70
              185:     12(int) Load 184
-                              Store 21(WidthU) 185
-             186:     13(ptr) AccessChain 178(sizeQueryTemp) 71
+                              Store 101(HeightU) 185
+             186:     13(ptr) AccessChain 176(sizeQueryTemp) 136
              187:     12(int) Load 186
-                              Store 102(HeightU) 187
-             188:     13(ptr) AccessChain 178(sizeQueryTemp) 138
-             189:     12(int) Load 188
-                              Store 175(DepthU) 189
-             194:         191 Load 193(g_tTex3du4)
-             195:  132(ivec3) ImageQuerySize 194
-                              Store 190(sizeQueryTemp) 195
-             196:     13(ptr) AccessChain 190(sizeQueryTemp) 67
+                              Store 173(DepthU) 187
+             192:         189 Load 191(g_tTex3du4)
+             193:  124(ivec3) ImageQuerySize 192
+                              Store 188(sizeQueryTemp) 193
+             194:     13(ptr) AccessChain 188(sizeQueryTemp) 66
+             195:     12(int) Load 194
+                              Store 20(WidthU) 195
+             196:     13(ptr) AccessChain 188(sizeQueryTemp) 70
              197:     12(int) Load 196
-                              Store 21(WidthU) 197
-             198:     13(ptr) AccessChain 190(sizeQueryTemp) 71
+                              Store 101(HeightU) 197
+             198:     13(ptr) AccessChain 188(sizeQueryTemp) 136
              199:     12(int) Load 198
-                              Store 102(HeightU) 199
-             200:     13(ptr) AccessChain 190(sizeQueryTemp) 138
-             201:     12(int) Load 200
-                              Store 175(DepthU) 201
-             208:    207(ptr) AccessChain 203(psout) 204
-                              Store 208 206
-             211:    210(ptr) AccessChain 203(psout) 209
-                              Store 211 205
-             212:8(PS_OUTPUT) Load 203(psout)
-                              ReturnValue 212
+                              Store 173(DepthU) 199
+             206:    205(ptr) AccessChain 201(psout) 202
+                              Store 206 204
+             209:    208(ptr) AccessChain 201(psout) 207
+                              Store 209 203
+             210:8(PS_OUTPUT) Load 201(psout)
+                              ReturnValue 210
                               FunctionEnd

+ 53 - 22
3rdparty/glslang/Test/baseResults/hlsl.if.frag.out

@@ -80,6 +80,16 @@ gl_FragCoord origin is upper left
 0:31          'ii' (temp float)
 0:32      Pre-Increment (temp int)
 0:32        'ii' (temp int)
+0:33      Test condition and select (temp void)
+0:33        Condition
+0:33        Compare Equal (temp bool)
+0:33          Convert int to float (temp float)
+0:33            'ii' (temp int)
+0:33          Constant:
+0:33            1.000000
+0:33        true case
+0:34        Pre-Increment (temp int)
+0:34          'ii' (temp int)
 0:2  Function Definition: PixelShaderFunction( (temp void)
 0:2    Function Parameters: 
 0:?     Sequence
@@ -179,6 +189,16 @@ gl_FragCoord origin is upper left
 0:31          'ii' (temp float)
 0:32      Pre-Increment (temp int)
 0:32        'ii' (temp int)
+0:33      Test condition and select (temp void)
+0:33        Condition
+0:33        Compare Equal (temp bool)
+0:33          Convert int to float (temp float)
+0:33            'ii' (temp int)
+0:33          Constant:
+0:33            1.000000
+0:33        true case
+0:34        Pre-Increment (temp int)
+0:34          'ii' (temp int)
 0:2  Function Definition: PixelShaderFunction( (temp void)
 0:2    Function Parameters: 
 0:?     Sequence
@@ -195,24 +215,24 @@ gl_FragCoord origin is upper left
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 94
+// Id's are bound by 101
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 87 90
+                              EntryPoint Fragment 4  "PixelShaderFunction" 94 97
                               ExecutionMode 4 OriginUpperLeft
                               Name 4  "PixelShaderFunction"
                               Name 11  "@PixelShaderFunction(vf4;"
                               Name 10  "input"
                               Name 68  "ii"
                               Name 80  "ii"
-                              Name 85  "input"
-                              Name 87  "input"
-                              Name 90  "@entryPointOutput"
-                              Name 91  "param"
-                              Decorate 87(input) Location 0
-                              Decorate 90(@entryPointOutput) Location 0
+                              Name 92  "input"
+                              Name 94  "input"
+                              Name 97  "@entryPointOutput"
+                              Name 98  "param"
+                              Decorate 94(input) Location 0
+                              Decorate 97(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -228,20 +248,20 @@ gl_FragCoord origin is upper left
               78:             TypeInt 32 1
               79:             TypePointer Function 78(int)
               82:     78(int) Constant 1
-              86:             TypePointer Input 7(fvec4)
-       87(input):     86(ptr) Variable Input
-              89:             TypePointer Output 7(fvec4)
-90(@entryPointOutput):     89(ptr) Variable Output
+              93:             TypePointer Input 7(fvec4)
+       94(input):     93(ptr) Variable Input
+              96:             TypePointer Output 7(fvec4)
+97(@entryPointOutput):     96(ptr) Variable Output
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
-       85(input):      8(ptr) Variable Function
-       91(param):      8(ptr) Variable Function
-              88:    7(fvec4) Load 87(input)
-                              Store 85(input) 88
-              92:    7(fvec4) Load 85(input)
-                              Store 91(param) 92
-              93:    7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 91(param)
-                              Store 90(@entryPointOutput) 93
+       92(input):      8(ptr) Variable Function
+       98(param):      8(ptr) Variable Function
+              95:    7(fvec4) Load 94(input)
+                              Store 92(input) 95
+              99:    7(fvec4) Load 92(input)
+                              Store 98(param) 99
+             100:    7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 98(param)
+                              Store 97(@entryPointOutput) 100
                               Return
                               FunctionEnd
 11(@PixelShaderFunction(vf4;):    7(fvec4) Function None 9
@@ -329,6 +349,17 @@ gl_FragCoord origin is upper left
               81:     78(int) Load 80(ii)
               83:     78(int) IAdd 81 82
                               Store 80(ii) 83
-              84:    7(fvec4) Undef
-                              ReturnValue 84
+              84:     78(int) Load 80(ii)
+              85:    6(float) ConvertSToF 84
+              86:    15(bool) FOrdEqual 85 76
+                              SelectionMerge 88 None
+                              BranchConditional 86 87 88
+              87:               Label
+              89:     78(int)   Load 80(ii)
+              90:     78(int)   IAdd 89 82
+                                Store 80(ii) 90
+                                Branch 88
+              88:             Label
+              91:    7(fvec4) Undef
+                              ReturnValue 91
                               FunctionEnd

+ 11 - 7
3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.frag.out

@@ -364,6 +364,8 @@ gl_FragCoord origin is upper left
 0:70          'sizeQueryTemp' (temp uint)
 0:70          textureSize (temp uint)
 0:70            'g_tTex1df4' (uniform texture1D)
+0:70            Constant:
+0:70              0 (const int)
 0:70        move second child to first child (temp int)
 0:70          'WidthI' (temp int)
 0:70          Convert uint to int (temp int)
@@ -808,6 +810,8 @@ gl_FragCoord origin is upper left
 0:70          'sizeQueryTemp' (temp uint)
 0:70          textureSize (temp uint)
 0:70            'g_tTex1df4' (uniform texture1D)
+0:70            Constant:
+0:70              0 (const int)
 0:70        move second child to first child (temp int)
 0:70          'WidthI' (temp int)
 0:70          Convert uint to int (temp int)
@@ -1284,37 +1288,37 @@ gl_FragCoord origin is upper left
              276:    6(float) CompositeExtract 275 0
                               Store 268(r51) 276
              281:         278 Load 280(g_tTex1df4)
-             282:     14(int) ImageQuerySize 281
+             282:     15(int) ImageQuerySizeLod 281 53
                               Store 277(sizeQueryTemp) 282
              284:     15(int) Load 277(sizeQueryTemp)
              285:     14(int) Bitcast 284
                               Store 283(WidthI) 285
              287:         278 Load 280(g_tTex1df4)
-             289:     14(int) ImageQuerySizeLod 287 288
+             289:     15(int) ImageQuerySizeLod 287 288
                               Store 286(sizeQueryTemp) 289
              290:     15(int) Load 286(sizeQueryTemp)
              291:     14(int) Bitcast 290
                               Store 283(WidthI) 291
              293:         278 Load 280(g_tTex1df4)
-             294:     14(int) ImageQueryLevels 293
+             294:     15(int) ImageQueryLevels 293
                               Store 292(NumberOfLevelsU) 294
              296:         278 Load 280(g_tTex1df4)
-             297:     14(int) ImageQuerySizeLod 296 288
+             297:     15(int) ImageQuerySizeLod 296 288
                               Store 295(sizeQueryTemp) 297
              299:     15(int) Load 295(sizeQueryTemp)
                               Store 298(WidthU) 299
              301:         278 Load 280(g_tTex1df4)
-             302:     14(int) ImageQueryLevels 301
+             302:     15(int) ImageQueryLevels 301
              303:     14(int) Bitcast 302
                               Store 300(NumberOfLevelsI) 303
              305:         278 Load 280(g_tTex1df4)
-             306:     14(int) ImageQuerySizeLod 305 288
+             306:     15(int) ImageQuerySizeLod 305 288
                               Store 304(sizeQueryTemp) 306
              307:     15(int) Load 304(sizeQueryTemp)
              308:     14(int) Bitcast 307
                               Store 283(WidthI) 308
              309:         278 Load 280(g_tTex1df4)
-             310:     14(int) ImageQueryLevels 309
+             310:     15(int) ImageQueryLevels 309
              311:     14(int) Bitcast 310
                               Store 300(NumberOfLevelsI) 311
              314:    6(float) Load 13(r00)

+ 59 - 55
3rdparty/glslang/Test/baseResults/hlsl.intrinsics.promote.outputs.frag.out

@@ -19,6 +19,8 @@ gl_FragCoord origin is upper left
 0:40          'sizeQueryTemp' (temp uint)
 0:40          textureSize (temp uint)
 0:40            'g_tTex1df4' (uniform texture1D)
+0:40            Constant:
+0:40              0 (const int)
 0:40        move second child to first child (temp int)
 0:40          'WidthI' (temp int)
 0:40          Convert uint to int (temp int)
@@ -121,6 +123,8 @@ gl_FragCoord origin is upper left
 0:40          'sizeQueryTemp' (temp uint)
 0:40          textureSize (temp uint)
 0:40            'g_tTex1df4' (uniform texture1D)
+0:40            Constant:
+0:40              0 (const int)
 0:40        move second child to first child (temp int)
 0:40          'WidthI' (temp int)
 0:40          Convert uint to int (temp int)
@@ -229,14 +233,14 @@ gl_FragCoord origin is upper left
                               Name 19  ""
                               Name 28  "sizeQueryTemp"
                               Name 31  "g_tTex1df4"
-                              Name 35  "WidthI"
-                              Name 38  "sizeQueryTemp"
-                              Name 44  "NumberOfLevelsU"
-                              Name 47  "sizeQueryTemp"
-                              Name 50  "WidthU"
-                              Name 52  "NumberOfLevelsI"
-                              Name 56  "sizeQueryTemp"
-                              Name 65  "ps_output"
+                              Name 36  "WidthI"
+                              Name 39  "sizeQueryTemp"
+                              Name 45  "NumberOfLevelsU"
+                              Name 48  "sizeQueryTemp"
+                              Name 51  "WidthU"
+                              Name 53  "NumberOfLevelsI"
+                              Name 57  "sizeQueryTemp"
+                              Name 66  "ps_output"
                               Name 74  "color"
                               Name 80  "g_tTexbfs"
                               MemberDecorate 17($Global) 0 Offset 0
@@ -276,10 +280,10 @@ gl_FragCoord origin is upper left
               29:             TypeImage 6(float) 1D sampled format:Unknown
               30:             TypePointer UniformConstant 29
   31(g_tTex1df4):     30(ptr) Variable UniformConstant
-              34:             TypePointer Function 12(int)
-              40:     13(int) Constant 6
-              64:             TypePointer Function 8(PS_OUTPUT)
-              66:     12(int) Constant 0
+              33:     12(int) Constant 0
+              35:             TypePointer Function 12(int)
+              41:     13(int) Constant 6
+              65:             TypePointer Function 8(PS_OUTPUT)
               67:    7(fvec4) ConstantComposite 24 24 24 24
               68:             TypePointer Function 7(fvec4)
               73:             TypePointer Output 7(fvec4)
@@ -298,53 +302,53 @@ gl_FragCoord origin is upper left
       10(@main():8(PS_OUTPUT) Function None 9
               11:             Label
 28(sizeQueryTemp):     27(ptr) Variable Function
-      35(WidthI):     34(ptr) Variable Function
-38(sizeQueryTemp):     27(ptr) Variable Function
-44(NumberOfLevelsU):     27(ptr) Variable Function
-47(sizeQueryTemp):     27(ptr) Variable Function
-      50(WidthU):     27(ptr) Variable Function
-52(NumberOfLevelsI):     34(ptr) Variable Function
-56(sizeQueryTemp):     27(ptr) Variable Function
-   65(ps_output):     64(ptr) Variable Function
+      36(WidthI):     35(ptr) Variable Function
+39(sizeQueryTemp):     27(ptr) Variable Function
+45(NumberOfLevelsU):     27(ptr) Variable Function
+48(sizeQueryTemp):     27(ptr) Variable Function
+      51(WidthU):     27(ptr) Variable Function
+53(NumberOfLevelsI):     35(ptr) Variable Function
+57(sizeQueryTemp):     27(ptr) Variable Function
+   66(ps_output):     65(ptr) Variable Function
               22:     21(ptr) AccessChain 19 20
               23:    6(float) Load 22
               26:    6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 23 24 25
               32:          29 Load 31(g_tTex1df4)
-              33:     12(int) ImageQuerySize 32
-                              Store 28(sizeQueryTemp) 33
-              36:     13(int) Load 28(sizeQueryTemp)
-              37:     12(int) Bitcast 36
-                              Store 35(WidthI) 37
-              39:          29 Load 31(g_tTex1df4)
-              41:     12(int) ImageQuerySizeLod 39 40
-                              Store 38(sizeQueryTemp) 41
-              42:     13(int) Load 38(sizeQueryTemp)
-              43:     12(int) Bitcast 42
-                              Store 35(WidthI) 43
-              45:          29 Load 31(g_tTex1df4)
-              46:     12(int) ImageQueryLevels 45
-                              Store 44(NumberOfLevelsU) 46
-              48:          29 Load 31(g_tTex1df4)
-              49:     12(int) ImageQuerySizeLod 48 40
-                              Store 47(sizeQueryTemp) 49
-              51:     13(int) Load 47(sizeQueryTemp)
-                              Store 50(WidthU) 51
-              53:          29 Load 31(g_tTex1df4)
-              54:     12(int) ImageQueryLevels 53
-              55:     12(int) Bitcast 54
-                              Store 52(NumberOfLevelsI) 55
-              57:          29 Load 31(g_tTex1df4)
-              58:     12(int) ImageQuerySizeLod 57 40
-                              Store 56(sizeQueryTemp) 58
-              59:     13(int) Load 56(sizeQueryTemp)
-              60:     12(int) Bitcast 59
-                              Store 35(WidthI) 60
-              61:          29 Load 31(g_tTex1df4)
-              62:     12(int) ImageQueryLevels 61
-              63:     12(int) Bitcast 62
-                              Store 52(NumberOfLevelsI) 63
-              69:     68(ptr) AccessChain 65(ps_output) 66
+              34:     13(int) ImageQuerySizeLod 32 33
+                              Store 28(sizeQueryTemp) 34
+              37:     13(int) Load 28(sizeQueryTemp)
+              38:     12(int) Bitcast 37
+                              Store 36(WidthI) 38
+              40:          29 Load 31(g_tTex1df4)
+              42:     13(int) ImageQuerySizeLod 40 41
+                              Store 39(sizeQueryTemp) 42
+              43:     13(int) Load 39(sizeQueryTemp)
+              44:     12(int) Bitcast 43
+                              Store 36(WidthI) 44
+              46:          29 Load 31(g_tTex1df4)
+              47:     13(int) ImageQueryLevels 46
+                              Store 45(NumberOfLevelsU) 47
+              49:          29 Load 31(g_tTex1df4)
+              50:     13(int) ImageQuerySizeLod 49 41
+                              Store 48(sizeQueryTemp) 50
+              52:     13(int) Load 48(sizeQueryTemp)
+                              Store 51(WidthU) 52
+              54:          29 Load 31(g_tTex1df4)
+              55:     13(int) ImageQueryLevels 54
+              56:     12(int) Bitcast 55
+                              Store 53(NumberOfLevelsI) 56
+              58:          29 Load 31(g_tTex1df4)
+              59:     13(int) ImageQuerySizeLod 58 41
+                              Store 57(sizeQueryTemp) 59
+              60:     13(int) Load 57(sizeQueryTemp)
+              61:     12(int) Bitcast 60
+                              Store 36(WidthI) 61
+              62:          29 Load 31(g_tTex1df4)
+              63:     13(int) ImageQueryLevels 62
+              64:     12(int) Bitcast 63
+                              Store 53(NumberOfLevelsI) 64
+              69:     68(ptr) AccessChain 66(ps_output) 33
                               Store 69 67
-              70:8(PS_OUTPUT) Load 65(ps_output)
+              70:8(PS_OUTPUT) Load 66(ps_output)
                               ReturnValue 70
                               FunctionEnd

+ 10 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out

@@ -220,6 +220,7 @@ Shader version: 450
 0:?     'g_tTexcdf4a' (uniform textureCubeArray)
 0:?     'g_tTexcdi4a' (uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' (uniform utextureCubeArray)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 0:?     'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform int c1, layout(offset=8 ) uniform 2-component vector of int c2, layout(offset=16 ) uniform 3-component vector of int c3, layout(offset=32 ) uniform 4-component vector of int c4, layout(offset=48 ) uniform int o1, layout(offset=56 ) uniform 2-component vector of int o2, layout(offset=64 ) uniform 3-component vector of int o3, layout(offset=80 ) uniform 4-component vector of int o4})
 
 
@@ -447,18 +448,19 @@ Shader version: 450
 0:?     'g_tTexcdf4a' (uniform textureCubeArray)
 0:?     'g_tTexcdi4a' (uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' (uniform utextureCubeArray)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 0:?     'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform int c1, layout(offset=8 ) uniform 2-component vector of int c2, layout(offset=16 ) uniform 3-component vector of int c3, layout(offset=32 ) uniform 4-component vector of int c4, layout(offset=48 ) uniform int o1, layout(offset=56 ) uniform 2-component vector of int o2, layout(offset=64 ) uniform 3-component vector of int o3, layout(offset=80 ) uniform 4-component vector of int o4})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 171
+// Id's are bound by 174
 
                               Capability Shader
                               Capability Sampled1D
                               Capability SampledCubeArray
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 129
+                              EntryPoint Vertex 4  "main" 129 173
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
                               MemberName 8(VS_OUTPUT) 0  "Pos"
@@ -497,6 +499,8 @@ Shader version: 450
                               Name 164  "g_tTexcdf4a"
                               Name 167  "g_tTexcdi4a"
                               Name 170  "g_tTexcdu4a"
+                              Name 171  "VS_OUTPUT"
+                              Name 173  "@entryPointOutput"
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
@@ -532,6 +536,7 @@ Shader version: 450
                               Decorate 164(g_tTexcdf4a) DescriptorSet 0
                               Decorate 167(g_tTexcdi4a) DescriptorSet 0
                               Decorate 170(g_tTexcdu4a) DescriptorSet 0
+                              Decorate 173(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -630,6 +635,9 @@ Shader version: 450
              168:             TypeImage 24(int) Cube array sampled format:Unknown
              169:             TypePointer UniformConstant 168
 170(g_tTexcdu4a):    169(ptr) Variable UniformConstant
+  171(VS_OUTPUT):             TypeStruct
+             172:             TypePointer Output 171(VS_OUTPUT)
+173(@entryPointOutput):    172(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
              130:8(VS_OUTPUT) FunctionCall 10(@main()

+ 10 - 2
3rdparty/glslang/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out

@@ -242,6 +242,7 @@ Shader version: 450
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 
 
 Linked vertex stage:
@@ -490,16 +491,17 @@ Shader version: 450
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 166
+// Id's are bound by 169
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 162
+                              EntryPoint Vertex 4  "main" 162 168
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
                               MemberName 8(VS_OUTPUT) 0  "Pos"
@@ -532,6 +534,8 @@ Shader version: 450
                               Name 153  "vsout"
                               Name 162  "@entryPointOutput_Pos"
                               Name 165  "g_tTex1df4a"
+                              Name 166  "VS_OUTPUT"
+                              Name 168  "@entryPointOutput"
                               Decorate 16(g_tTex1df4) DescriptorSet 0
                               Decorate 16(g_tTex1df4) Binding 0
                               Decorate 20(g_sSamp) DescriptorSet 0
@@ -550,6 +554,7 @@ Shader version: 450
                               Decorate 162(@entryPointOutput_Pos) BuiltIn Position
                               Decorate 165(g_tTex1df4a) DescriptorSet 0
                               Decorate 165(g_tTex1df4a) Binding 1
+                              Decorate 168(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -643,6 +648,9 @@ Shader version: 450
              161:             TypePointer Output 7(fvec4)
 162(@entryPointOutput_Pos):    161(ptr) Variable Output
 165(g_tTex1df4a):     15(ptr) Variable UniformConstant
+  166(VS_OUTPUT):             TypeStruct
+             167:             TypePointer Output 166(VS_OUTPUT)
+168(@entryPointOutput):    167(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
              163:8(VS_OUTPUT) FunctionCall 10(@main()

+ 10 - 2
3rdparty/glslang/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out

@@ -188,6 +188,7 @@ Shader version: 450
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 
 
 Linked vertex stage:
@@ -382,16 +383,17 @@ Shader version: 450
 0:?     'g_tTexcdf4' (uniform textureCube)
 0:?     'g_tTexcdi4' (uniform itextureCube)
 0:?     'g_tTexcdu4' (uniform utextureCube)
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 162
+// Id's are bound by 165
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 158
+                              EntryPoint Vertex 4  "main" 158 164
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
                               MemberName 8(VS_OUTPUT) 0  "Pos"
@@ -424,6 +426,8 @@ Shader version: 450
                               Name 149  "vsout"
                               Name 158  "@entryPointOutput_Pos"
                               Name 161  "g_tTex1df4a"
+                              Name 162  "VS_OUTPUT"
+                              Name 164  "@entryPointOutput"
                               Decorate 16(g_tTex1df4) DescriptorSet 0
                               Decorate 16(g_tTex1df4) Binding 0
                               Decorate 20(g_sSamp) DescriptorSet 0
@@ -442,6 +446,7 @@ Shader version: 450
                               Decorate 158(@entryPointOutput_Pos) BuiltIn Position
                               Decorate 161(g_tTex1df4a) DescriptorSet 0
                               Decorate 161(g_tTex1df4a) Binding 1
+                              Decorate 164(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -531,6 +536,9 @@ Shader version: 450
              157:             TypePointer Output 7(fvec4)
 158(@entryPointOutput_Pos):    157(ptr) Variable Output
 161(g_tTex1df4a):     15(ptr) Variable UniformConstant
+  162(VS_OUTPUT):             TypeStruct
+             163:             TypePointer Output 162(VS_OUTPUT)
+164(@entryPointOutput):    163(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
              159:8(VS_OUTPUT) FunctionCall 10(@main()

+ 246 - 0
3rdparty/glslang/Test/baseResults/hlsl.semantic.geom.out

@@ -0,0 +1,246 @@
+hlsl.semantic.geom
+Shader version: 450
+invocations = -1
+max_vertices = 4
+input primitive = triangles
+output primitive = line_strip
+0:? Sequence
+0:12  Function Definition: @main(u1[3];struct-S-f1-f1-u1-u1-i11; (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12    Function Parameters: 
+0:12      'VertexID' (in 3-element array of uint)
+0:12      'OutputStream' (out structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:?     Sequence
+0:14      Branch: Return with expression
+0:14        's' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12  Function Definition: main( (temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child (temp 3-element array of uint)
+0:?         'VertexID' (temp 3-element array of uint)
+0:?         'VertexID' (layout(location=0 ) in 3-element array of uint)
+0:12      Sequence
+0:12        move second child to first child (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12          'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12          Function Call: @main(u1[3];struct-S-f1-f1-u1-u1-i11; (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:?             'VertexID' (temp 3-element array of uint)
+0:?             'OutputStream' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_clip0' (out float ClipDistance)
+0:12          clip0: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_cull0' (out float CullDistance)
+0:12          cull0: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              1 (const int)
+0:12        move second child to first child (temp uint)
+0:?           '@entryPointOutput_vpai' (out uint ViewportIndex)
+0:12          vpai: direct index for structure (temp uint)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              2 (const int)
+0:12        move second child to first child (temp uint)
+0:?           '@entryPointOutput_rtai' (out uint Layer)
+0:12          rtai: direct index for structure (temp uint)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              3 (const int)
+0:12        move second child to first child (temp int)
+0:12          ii: direct index for structure (temp int)
+0:12            '@entryPointOutput' (layout(location=0 ) out structure{temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:12          ii: direct index for structure (temp int)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              4 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{temp int ii})
+0:?     'VertexID' (layout(location=0 ) in 3-element array of uint)
+0:?     '@entryPointOutput_vpai' (out uint ViewportIndex)
+
+
+Linked geometry stage:
+
+
+Shader version: 450
+invocations = 1
+max_vertices = 4
+input primitive = triangles
+output primitive = line_strip
+0:? Sequence
+0:12  Function Definition: @main(u1[3];struct-S-f1-f1-u1-u1-i11; (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12    Function Parameters: 
+0:12      'VertexID' (in 3-element array of uint)
+0:12      'OutputStream' (out structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:?     Sequence
+0:14      Branch: Return with expression
+0:14        's' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12  Function Definition: main( (temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child (temp 3-element array of uint)
+0:?         'VertexID' (temp 3-element array of uint)
+0:?         'VertexID' (layout(location=0 ) in 3-element array of uint)
+0:12      Sequence
+0:12        move second child to first child (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12          'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12          Function Call: @main(u1[3];struct-S-f1-f1-u1-u1-i11; (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:?             'VertexID' (temp 3-element array of uint)
+0:?             'OutputStream' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_clip0' (out float ClipDistance)
+0:12          clip0: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_cull0' (out float CullDistance)
+0:12          cull0: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              1 (const int)
+0:12        move second child to first child (temp uint)
+0:?           '@entryPointOutput_vpai' (out uint ViewportIndex)
+0:12          vpai: direct index for structure (temp uint)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              2 (const int)
+0:12        move second child to first child (temp uint)
+0:?           '@entryPointOutput_rtai' (out uint Layer)
+0:12          rtai: direct index for structure (temp uint)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              3 (const int)
+0:12        move second child to first child (temp int)
+0:12          ii: direct index for structure (temp int)
+0:12            '@entryPointOutput' (layout(location=0 ) out structure{temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:12          ii: direct index for structure (temp int)
+0:12            'flattenTemp' (temp structure{temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii})
+0:12            Constant:
+0:12              4 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{temp int ii})
+0:?     'VertexID' (layout(location=0 ) in 3-element array of uint)
+0:?     '@entryPointOutput_vpai' (out uint ViewportIndex)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 62
+
+                              Capability Geometry
+                              Capability ClipDistance
+                              Capability CullDistance
+                              Capability MultiViewport
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Geometry 4  "main" 25 34 39 44 49 55
+                              ExecutionMode 4 Triangles
+                              ExecutionMode 4 Invocations 1
+                              ExecutionMode 4 OutputLineStrip
+                              ExecutionMode 4 OutputVertices 4
+                              Name 4  "main"
+                              Name 12  "S"
+                              MemberName 12(S) 0  "clip0"
+                              MemberName 12(S) 1  "cull0"
+                              MemberName 12(S) 2  "vpai"
+                              MemberName 12(S) 3  "rtai"
+                              MemberName 12(S) 4  "ii"
+                              Name 17  "@main(u1[3];struct-S-f1-f1-u1-u1-i11;"
+                              Name 15  "VertexID"
+                              Name 16  "OutputStream"
+                              Name 19  "s"
+                              Name 23  "VertexID"
+                              Name 25  "VertexID"
+                              Name 27  "flattenTemp"
+                              Name 28  "OutputStream"
+                              Name 29  "param"
+                              Name 31  "param"
+                              Name 34  "@entryPointOutput_clip0"
+                              Name 39  "@entryPointOutput_cull0"
+                              Name 44  "@entryPointOutput_vpai"
+                              Name 49  "@entryPointOutput_rtai"
+                              Name 53  "S"
+                              MemberName 53(S) 0  "ii"
+                              Name 55  "@entryPointOutput"
+                              Decorate 25(VertexID) Location 0
+                              Decorate 34(@entryPointOutput_clip0) BuiltIn ClipDistance
+                              Decorate 39(@entryPointOutput_cull0) BuiltIn CullDistance
+                              Decorate 44(@entryPointOutput_vpai) BuiltIn ViewportIndex
+                              Decorate 49(@entryPointOutput_rtai) BuiltIn Layer
+                              Decorate 55(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:      6(int) Constant 3
+               8:             TypeArray 6(int) 7
+               9:             TypePointer Function 8
+              10:             TypeFloat 32
+              11:             TypeInt 32 1
+           12(S):             TypeStruct 10(float) 10(float) 6(int) 6(int) 11(int)
+              13:             TypePointer Function 12(S)
+              14:             TypeFunction 12(S) 9(ptr) 13(ptr)
+              24:             TypePointer Input 8
+    25(VertexID):     24(ptr) Variable Input
+              33:             TypePointer Output 10(float)
+34(@entryPointOutput_clip0):     33(ptr) Variable Output
+              35:     11(int) Constant 0
+              36:             TypePointer Function 10(float)
+39(@entryPointOutput_cull0):     33(ptr) Variable Output
+              40:     11(int) Constant 1
+              43:             TypePointer Output 6(int)
+44(@entryPointOutput_vpai):     43(ptr) Variable Output
+              45:     11(int) Constant 2
+              46:             TypePointer Function 6(int)
+49(@entryPointOutput_rtai):     43(ptr) Variable Output
+              50:     11(int) Constant 3
+           53(S):             TypeStruct 11(int)
+              54:             TypePointer Output 53(S)
+55(@entryPointOutput):     54(ptr) Variable Output
+              56:     11(int) Constant 4
+              57:             TypePointer Function 11(int)
+              60:             TypePointer Output 11(int)
+         4(main):           2 Function None 3
+               5:             Label
+    23(VertexID):      9(ptr) Variable Function
+ 27(flattenTemp):     13(ptr) Variable Function
+28(OutputStream):     13(ptr) Variable Function
+       29(param):      9(ptr) Variable Function
+       31(param):     13(ptr) Variable Function
+              26:           8 Load 25(VertexID)
+                              Store 23(VertexID) 26
+              30:           8 Load 23(VertexID)
+                              Store 29(param) 30
+              32:       12(S) FunctionCall 17(@main(u1[3];struct-S-f1-f1-u1-u1-i11;) 29(param) 31(param)
+                              Store 27(flattenTemp) 32
+              37:     36(ptr) AccessChain 27(flattenTemp) 35
+              38:   10(float) Load 37
+                              Store 34(@entryPointOutput_clip0) 38
+              41:     36(ptr) AccessChain 27(flattenTemp) 40
+              42:   10(float) Load 41
+                              Store 39(@entryPointOutput_cull0) 42
+              47:     46(ptr) AccessChain 27(flattenTemp) 45
+              48:      6(int) Load 47
+                              Store 44(@entryPointOutput_vpai) 48
+              51:     46(ptr) AccessChain 27(flattenTemp) 50
+              52:      6(int) Load 51
+                              Store 49(@entryPointOutput_rtai) 52
+              58:     57(ptr) AccessChain 27(flattenTemp) 56
+              59:     11(int) Load 58
+              61:     60(ptr) AccessChain 55(@entryPointOutput) 35
+                              Store 61 59
+                              Return
+                              FunctionEnd
+17(@main(u1[3];struct-S-f1-f1-u1-u1-i11;):       12(S) Function None 14
+    15(VertexID):      9(ptr) FunctionParameter
+16(OutputStream):     13(ptr) FunctionParameter
+              18:             Label
+           19(s):     13(ptr) Variable Function
+              20:       12(S) Load 19(s)
+                              ReturnValue 20
+                              FunctionEnd

+ 373 - 0
3rdparty/glslang/Test/baseResults/hlsl.semantic.vert.out

@@ -0,0 +1,373 @@
+hlsl.semantic.vert
+Shader version: 450
+0:? Sequence
+0:12  Function Definition: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12    Function Parameters: 
+0:12      'ins' (in structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:?     Sequence
+0:14      Branch: Return with expression
+0:14        's' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12  Function Definition: main( (temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      Sequence
+0:12        move second child to first child (temp float)
+0:12          clip: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:?           'clip' (layout(location=0 ) in float)
+0:12        move second child to first child (temp float)
+0:12          clip0: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              1 (const int)
+0:?           'clip0' (layout(location=1 ) in float)
+0:12        move second child to first child (temp float)
+0:12          clip7: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              2 (const int)
+0:?           'clip7' (layout(location=2 ) in float)
+0:12        move second child to first child (temp float)
+0:12          cull: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              3 (const int)
+0:?           'cull' (layout(location=3 ) in float)
+0:12        move second child to first child (temp float)
+0:12          cull2: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              4 (const int)
+0:?           'cull2' (layout(location=4 ) in float)
+0:12        move second child to first child (temp float)
+0:12          cull5: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              5 (const int)
+0:?           'cull5' (layout(location=5 ) in float)
+0:12        move second child to first child (temp int)
+0:12          ii: direct index for structure (temp int)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              6 (const int)
+0:?           'ii' (in int InstanceIndex)
+0:12      Sequence
+0:12        move second child to first child (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12          'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12          Function Call: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_clip7' (out float ClipDistance)
+0:12          clip: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_clip7' (out float ClipDistance)
+0:12          clip0: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              1 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_clip7' (out float ClipDistance)
+0:12          clip7: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              2 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_cull5' (out float CullDistance)
+0:12          cull: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              3 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_cull5' (out float CullDistance)
+0:12          cull2: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              4 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_cull5' (out float CullDistance)
+0:12          cull5: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              5 (const int)
+0:12        move second child to first child (temp int)
+0:12          ii: direct index for structure (temp int)
+0:12            '@entryPointOutput' (layout(location=0 ) out structure{temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:12          ii: direct index for structure (temp int)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              6 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{temp int ii})
+0:?     'clip' (layout(location=0 ) in float)
+0:?     'clip0' (layout(location=1 ) in float)
+0:?     'clip7' (layout(location=2 ) in float)
+0:?     'cull' (layout(location=3 ) in float)
+0:?     'cull2' (layout(location=4 ) in float)
+0:?     'cull5' (layout(location=5 ) in float)
+0:?     'ii' (in int InstanceIndex)
+
+
+Linked vertex stage:
+
+
+Shader version: 450
+0:? Sequence
+0:12  Function Definition: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12    Function Parameters: 
+0:12      'ins' (in structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:?     Sequence
+0:14      Branch: Return with expression
+0:14        's' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12  Function Definition: main( (temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      Sequence
+0:12        move second child to first child (temp float)
+0:12          clip: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:?           'clip' (layout(location=0 ) in float)
+0:12        move second child to first child (temp float)
+0:12          clip0: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              1 (const int)
+0:?           'clip0' (layout(location=1 ) in float)
+0:12        move second child to first child (temp float)
+0:12          clip7: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              2 (const int)
+0:?           'clip7' (layout(location=2 ) in float)
+0:12        move second child to first child (temp float)
+0:12          cull: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              3 (const int)
+0:?           'cull' (layout(location=3 ) in float)
+0:12        move second child to first child (temp float)
+0:12          cull2: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              4 (const int)
+0:?           'cull2' (layout(location=4 ) in float)
+0:12        move second child to first child (temp float)
+0:12          cull5: direct index for structure (temp float)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              5 (const int)
+0:?           'cull5' (layout(location=5 ) in float)
+0:12        move second child to first child (temp int)
+0:12          ii: direct index for structure (temp int)
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              6 (const int)
+0:?           'ii' (in int InstanceIndex)
+0:12      Sequence
+0:12        move second child to first child (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12          'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12          Function Call: @main(struct-S-f1-f1-f1-f1-f1-f1-i11; (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:?             'ins' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_clip7' (out float ClipDistance)
+0:12          clip: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_clip7' (out float ClipDistance)
+0:12          clip0: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              1 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_clip7' (out float ClipDistance)
+0:12          clip7: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              2 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_cull5' (out float CullDistance)
+0:12          cull: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              3 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_cull5' (out float CullDistance)
+0:12          cull2: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              4 (const int)
+0:12        move second child to first child (temp float)
+0:?           '@entryPointOutput_cull5' (out float CullDistance)
+0:12          cull5: direct index for structure (temp float)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              5 (const int)
+0:12        move second child to first child (temp int)
+0:12          ii: direct index for structure (temp int)
+0:12            '@entryPointOutput' (layout(location=0 ) out structure{temp int ii})
+0:12            Constant:
+0:12              0 (const int)
+0:12          ii: direct index for structure (temp int)
+0:12            'flattenTemp' (temp structure{temp float clip, temp float clip0, temp float clip7, temp float cull, temp float cull2, temp float cull5, temp int ii})
+0:12            Constant:
+0:12              6 (const int)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{temp int ii})
+0:?     'clip' (layout(location=0 ) in float)
+0:?     'clip0' (layout(location=1 ) in float)
+0:?     'clip7' (layout(location=2 ) in float)
+0:?     'cull' (layout(location=3 ) in float)
+0:?     'cull2' (layout(location=4 ) in float)
+0:?     'cull5' (layout(location=5 ) in float)
+0:?     'ii' (in int InstanceIndex)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 77
+
+                              Capability Shader
+                              Capability ClipDistance
+                              Capability CullDistance
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 21 26 30 34 38 42 47 56 63 72
+                              Name 4  "main"
+                              Name 8  "S"
+                              MemberName 8(S) 0  "clip"
+                              MemberName 8(S) 1  "clip0"
+                              MemberName 8(S) 2  "clip7"
+                              MemberName 8(S) 3  "cull"
+                              MemberName 8(S) 4  "cull2"
+                              MemberName 8(S) 5  "cull5"
+                              MemberName 8(S) 6  "ii"
+                              Name 12  "@main(struct-S-f1-f1-f1-f1-f1-f1-i11;"
+                              Name 11  "ins"
+                              Name 14  "s"
+                              Name 18  "ins"
+                              Name 21  "clip"
+                              Name 26  "clip0"
+                              Name 30  "clip7"
+                              Name 34  "cull"
+                              Name 38  "cull2"
+                              Name 42  "cull5"
+                              Name 47  "ii"
+                              Name 51  "flattenTemp"
+                              Name 52  "param"
+                              Name 56  "@entryPointOutput_clip7"
+                              Name 63  "@entryPointOutput_cull5"
+                              Name 70  "S"
+                              MemberName 70(S) 0  "ii"
+                              Name 72  "@entryPointOutput"
+                              Decorate 21(clip) Location 0
+                              Decorate 26(clip0) Location 1
+                              Decorate 30(clip7) Location 2
+                              Decorate 34(cull) Location 3
+                              Decorate 38(cull2) Location 4
+                              Decorate 42(cull5) Location 5
+                              Decorate 47(ii) BuiltIn InstanceIndex
+                              Decorate 56(@entryPointOutput_clip7) BuiltIn ClipDistance
+                              Decorate 63(@entryPointOutput_cull5) BuiltIn CullDistance
+                              Decorate 72(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeInt 32 1
+            8(S):             TypeStruct 6(float) 6(float) 6(float) 6(float) 6(float) 6(float) 7(int)
+               9:             TypePointer Function 8(S)
+              10:             TypeFunction 8(S) 9(ptr)
+              19:      7(int) Constant 0
+              20:             TypePointer Input 6(float)
+        21(clip):     20(ptr) Variable Input
+              23:             TypePointer Function 6(float)
+              25:      7(int) Constant 1
+       26(clip0):     20(ptr) Variable Input
+              29:      7(int) Constant 2
+       30(clip7):     20(ptr) Variable Input
+              33:      7(int) Constant 3
+        34(cull):     20(ptr) Variable Input
+              37:      7(int) Constant 4
+       38(cull2):     20(ptr) Variable Input
+              41:      7(int) Constant 5
+       42(cull5):     20(ptr) Variable Input
+              45:      7(int) Constant 6
+              46:             TypePointer Input 7(int)
+          47(ii):     46(ptr) Variable Input
+              49:             TypePointer Function 7(int)
+              55:             TypePointer Output 6(float)
+56(@entryPointOutput_clip7):     55(ptr) Variable Output
+63(@entryPointOutput_cull5):     55(ptr) Variable Output
+           70(S):             TypeStruct 7(int)
+              71:             TypePointer Output 70(S)
+72(@entryPointOutput):     71(ptr) Variable Output
+              75:             TypePointer Output 7(int)
+         4(main):           2 Function None 3
+               5:             Label
+         18(ins):      9(ptr) Variable Function
+ 51(flattenTemp):      9(ptr) Variable Function
+       52(param):      9(ptr) Variable Function
+              22:    6(float) Load 21(clip)
+              24:     23(ptr) AccessChain 18(ins) 19
+                              Store 24 22
+              27:    6(float) Load 26(clip0)
+              28:     23(ptr) AccessChain 18(ins) 25
+                              Store 28 27
+              31:    6(float) Load 30(clip7)
+              32:     23(ptr) AccessChain 18(ins) 29
+                              Store 32 31
+              35:    6(float) Load 34(cull)
+              36:     23(ptr) AccessChain 18(ins) 33
+                              Store 36 35
+              39:    6(float) Load 38(cull2)
+              40:     23(ptr) AccessChain 18(ins) 37
+                              Store 40 39
+              43:    6(float) Load 42(cull5)
+              44:     23(ptr) AccessChain 18(ins) 41
+                              Store 44 43
+              48:      7(int) Load 47(ii)
+              50:     49(ptr) AccessChain 18(ins) 45
+                              Store 50 48
+              53:        8(S) Load 18(ins)
+                              Store 52(param) 53
+              54:        8(S) FunctionCall 12(@main(struct-S-f1-f1-f1-f1-f1-f1-i11;) 52(param)
+                              Store 51(flattenTemp) 54
+              57:     23(ptr) AccessChain 51(flattenTemp) 19
+              58:    6(float) Load 57
+                              Store 56(@entryPointOutput_clip7) 58
+              59:     23(ptr) AccessChain 51(flattenTemp) 25
+              60:    6(float) Load 59
+                              Store 56(@entryPointOutput_clip7) 60
+              61:     23(ptr) AccessChain 51(flattenTemp) 29
+              62:    6(float) Load 61
+                              Store 56(@entryPointOutput_clip7) 62
+              64:     23(ptr) AccessChain 51(flattenTemp) 33
+              65:    6(float) Load 64
+                              Store 63(@entryPointOutput_cull5) 65
+              66:     23(ptr) AccessChain 51(flattenTemp) 37
+              67:    6(float) Load 66
+                              Store 63(@entryPointOutput_cull5) 67
+              68:     23(ptr) AccessChain 51(flattenTemp) 41
+              69:    6(float) Load 68
+                              Store 63(@entryPointOutput_cull5) 69
+              73:     49(ptr) AccessChain 51(flattenTemp) 45
+              74:      7(int) Load 73
+              76:     75(ptr) AccessChain 72(@entryPointOutput) 19
+                              Store 76 74
+                              Return
+                              FunctionEnd
+12(@main(struct-S-f1-f1-f1-f1-f1-f1-i11;):        8(S) Function None 10
+         11(ins):      9(ptr) FunctionParameter
+              13:             Label
+           14(s):      9(ptr) Variable Function
+              15:        8(S) Load 14(s)
+                              ReturnValue 15
+                              FunctionEnd

+ 199 - 0
3rdparty/glslang/Test/baseResults/hlsl.staticMemberFunction.frag.out

@@ -0,0 +1,199 @@
+hlsl.staticMemberFunction.frag
+Shader version: 450
+gl_FragCoord origin is upper left
+0:? Sequence
+0:5  Function Definition: Test::staticMemFun(vf4; (global 4-component vector of float)
+0:5    Function Parameters: 
+0:5      'a' (in 4-component vector of float)
+0:?     Sequence
+0:6      Branch: Return with expression
+0:6        vector-scale (temp 4-component vector of float)
+0:6          Constant:
+0:6            2.000000
+0:6          'a' (in 4-component vector of float)
+0:9  Function Definition: Test::staticMemFun(i1; (global int)
+0:9    Function Parameters: 
+0:9      'a' (in int)
+0:?     Sequence
+0:10      Branch: Return with expression
+0:10        add (temp int)
+0:10          Constant:
+0:10            2 (const int)
+0:10          'a' (in int)
+0:16  Function Definition: @main( (temp 4-component vector of float)
+0:16    Function Parameters: 
+0:?     Sequence
+0:18      Sequence
+0:18        move second child to first child (temp 4-component vector of float)
+0:18          'f4' (temp 4-component vector of float)
+0:?           Constant:
+0:?             1.000000
+0:?             1.000000
+0:?             1.000000
+0:?             1.000000
+0:19      add second child into first child (temp 4-component vector of float)
+0:19        'f4' (temp 4-component vector of float)
+0:19        Function Call: Test::staticMemFun(vf4; (global 4-component vector of float)
+0:?           Constant:
+0:?             5.000000
+0:?             5.000000
+0:?             5.000000
+0:?             5.000000
+0:20      add second child into first child (temp 4-component vector of float)
+0:20        'f4' (temp 4-component vector of float)
+0:20        Convert int to float (temp float)
+0:20          Function Call: Test::staticMemFun(i1; (global int)
+0:20            Constant:
+0:20              7 (const int)
+0:21      Branch: Return with expression
+0:21        'f4' (temp 4-component vector of float)
+0:16  Function Definition: main( (temp void)
+0:16    Function Parameters: 
+0:?     Sequence
+0:16      move second child to first child (temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:16        Function Call: @main( (temp 4-component vector of float)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 450
+gl_FragCoord origin is upper left
+0:? Sequence
+0:5  Function Definition: Test::staticMemFun(vf4; (global 4-component vector of float)
+0:5    Function Parameters: 
+0:5      'a' (in 4-component vector of float)
+0:?     Sequence
+0:6      Branch: Return with expression
+0:6        vector-scale (temp 4-component vector of float)
+0:6          Constant:
+0:6            2.000000
+0:6          'a' (in 4-component vector of float)
+0:9  Function Definition: Test::staticMemFun(i1; (global int)
+0:9    Function Parameters: 
+0:9      'a' (in int)
+0:?     Sequence
+0:10      Branch: Return with expression
+0:10        add (temp int)
+0:10          Constant:
+0:10            2 (const int)
+0:10          'a' (in int)
+0:16  Function Definition: @main( (temp 4-component vector of float)
+0:16    Function Parameters: 
+0:?     Sequence
+0:18      Sequence
+0:18        move second child to first child (temp 4-component vector of float)
+0:18          'f4' (temp 4-component vector of float)
+0:?           Constant:
+0:?             1.000000
+0:?             1.000000
+0:?             1.000000
+0:?             1.000000
+0:19      add second child into first child (temp 4-component vector of float)
+0:19        'f4' (temp 4-component vector of float)
+0:19        Function Call: Test::staticMemFun(vf4; (global 4-component vector of float)
+0:?           Constant:
+0:?             5.000000
+0:?             5.000000
+0:?             5.000000
+0:?             5.000000
+0:20      add second child into first child (temp 4-component vector of float)
+0:20        'f4' (temp 4-component vector of float)
+0:20        Convert int to float (temp float)
+0:20          Function Call: Test::staticMemFun(i1; (global int)
+0:20            Constant:
+0:20              7 (const int)
+0:21      Branch: Return with expression
+0:21        'f4' (temp 4-component vector of float)
+0:16  Function Definition: main( (temp void)
+0:16    Function Parameters: 
+0:?     Sequence
+0:16      move second child to first child (temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+0:16        Function Call: @main( (temp 4-component vector of float)
+0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 54
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 52
+                              ExecutionMode 4 OriginUpperLeft
+                              Name 4  "main"
+                              Name 11  "Test::staticMemFun(vf4;"
+                              Name 10  "a"
+                              Name 17  "Test::staticMemFun(i1;"
+                              Name 16  "a"
+                              Name 20  "@main("
+                              Name 32  "f4"
+                              Name 37  "param"
+                              Name 42  "param"
+                              Name 52  "@entryPointOutput"
+                              Decorate 52(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypePointer Function 7(fvec4)
+               9:             TypeFunction 7(fvec4) 8(ptr)
+              13:             TypeInt 32 1
+              14:             TypePointer Function 13(int)
+              15:             TypeFunction 13(int) 14(ptr)
+              19:             TypeFunction 7(fvec4)
+              22:    6(float) Constant 1073741824
+              27:     13(int) Constant 2
+              33:    6(float) Constant 1065353216
+              34:    7(fvec4) ConstantComposite 33 33 33 33
+              35:    6(float) Constant 1084227584
+              36:    7(fvec4) ConstantComposite 35 35 35 35
+              41:     13(int) Constant 7
+              51:             TypePointer Output 7(fvec4)
+52(@entryPointOutput):     51(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+              53:    7(fvec4) FunctionCall 20(@main()
+                              Store 52(@entryPointOutput) 53
+                              Return
+                              FunctionEnd
+11(Test::staticMemFun(vf4;):    7(fvec4) Function None 9
+           10(a):      8(ptr) FunctionParameter
+              12:             Label
+              23:    7(fvec4) Load 10(a)
+              24:    7(fvec4) VectorTimesScalar 23 22
+                              ReturnValue 24
+                              FunctionEnd
+17(Test::staticMemFun(i1;):     13(int) Function None 15
+           16(a):     14(ptr) FunctionParameter
+              18:             Label
+              28:     13(int) Load 16(a)
+              29:     13(int) IAdd 27 28
+                              ReturnValue 29
+                              FunctionEnd
+      20(@main():    7(fvec4) Function None 19
+              21:             Label
+          32(f4):      8(ptr) Variable Function
+       37(param):      8(ptr) Variable Function
+       42(param):     14(ptr) Variable Function
+                              Store 32(f4) 34
+                              Store 37(param) 36
+              38:    7(fvec4) FunctionCall 11(Test::staticMemFun(vf4;) 37(param)
+              39:    7(fvec4) Load 32(f4)
+              40:    7(fvec4) FAdd 39 38
+                              Store 32(f4) 40
+                              Store 42(param) 41
+              43:     13(int) FunctionCall 17(Test::staticMemFun(i1;) 42(param)
+              44:    6(float) ConvertSToF 43
+              45:    7(fvec4) Load 32(f4)
+              46:    7(fvec4) CompositeConstruct 44 44 44 44
+              47:    7(fvec4) FAdd 45 46
+                              Store 32(f4) 47
+              48:    7(fvec4) Load 32(f4)
+                              ReturnValue 48
+                              FunctionEnd

+ 11 - 2
3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.geom.out

@@ -86,6 +86,7 @@ output primitive = triangle_strip
 0:?         'i' (temp 3-element array of structure{temp 4-component vector of float pos})
 0:?         'ts' (temp structure{temp 4-component vector of float pos})
 0:?   Linker Objects
+0:?     'i' (layout(location=0 ) in 3-element array of structure{})
 
 
 Linked geometry stage:
@@ -178,15 +179,16 @@ output primitive = triangle_strip
 0:?         'i' (temp 3-element array of structure{temp 4-component vector of float pos})
 0:?         'ts' (temp structure{temp 4-component vector of float pos})
 0:?   Linker Objects
+0:?     'i' (layout(location=0 ) in 3-element array of structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 63
+// Id's are bound by 67
 
                               Capability Geometry
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Geometry 4  "main" 46
+                              EntryPoint Geometry 4  "main" 46 66
                               ExecutionMode 4 Triangles
                               ExecutionMode 4 Invocations 1
                               ExecutionMode 4 OutputTriangleStrip
@@ -206,7 +208,10 @@ output primitive = triangle_strip
                               Name 58  "ts"
                               Name 59  "param"
                               Name 61  "param"
+                              Name 63  "PS_IN"
+                              Name 66  "i"
                               Decorate 46(i_pos) BuiltIn Position
+                              Decorate 66(i) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -231,6 +236,10 @@ output primitive = triangle_strip
        46(i_pos):     45(ptr) Variable Input
               47:             TypePointer Input 7(fvec4)
               54:     20(int) Constant 2
+       63(PS_IN):             TypeStruct
+              64:             TypeArray 63(PS_IN) 10
+              65:             TypePointer Input 64
+           66(i):     65(ptr) Variable Input
          4(main):           2 Function None 3
                5:             Label
            43(i):     12(ptr) Variable Function

+ 10 - 2
3rdparty/glslang/Test/baseResults/hlsl.struct.split.trivial.vert.out

@@ -42,6 +42,7 @@ Shader version: 450
 0:16            Constant:
 0:16              0 (const int)
 0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 0:?     'Pos_in' (layout(location=0 ) in 4-component vector of float)
 0:?     'Pos_loose' (layout(location=1 ) in 4-component vector of float)
 
@@ -92,17 +93,18 @@ Shader version: 450
 0:16            Constant:
 0:16              0 (const int)
 0:?   Linker Objects
+0:?     '@entryPointOutput' (layout(location=0 ) out structure{})
 0:?     'Pos_in' (layout(location=0 ) in 4-component vector of float)
 0:?     'Pos_loose' (layout(location=1 ) in 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 45
+// Id's are bound by 48
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 31 35 38
+                              EntryPoint Vertex 4  "main" 31 35 38 47
                               Name 4  "main"
                               Name 8  "VS_INPUT"
                               MemberName 8(VS_INPUT) 0  "Pos_in"
@@ -119,9 +121,12 @@ Shader version: 450
                               Name 38  "@entryPointOutput_Pos"
                               Name 39  "param"
                               Name 41  "param"
+                              Name 45  "VS_OUTPUT"
+                              Name 47  "@entryPointOutput"
                               Decorate 31(Pos_in) Location 0
                               Decorate 35(Pos_loose) Location 1
                               Decorate 38(@entryPointOutput_Pos) BuiltIn Position
+                              Decorate 47(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -139,6 +144,9 @@ Shader version: 450
    35(Pos_loose):     30(ptr) Variable Input
               37:             TypePointer Output 7(fvec4)
 38(@entryPointOutput_Pos):     37(ptr) Variable Output
+   45(VS_OUTPUT):             TypeStruct
+              46:             TypePointer Output 45(VS_OUTPUT)
+47(@entryPointOutput):     46(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
         29(vsin):      9(ptr) Variable Function

+ 92 - 92
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn.frag.out

@@ -2,59 +2,59 @@ hlsl.structbuffer.fn.frag
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:9  Function Definition: get(block--vu4[0]1;u1; (temp 4-component vector of uint)
-0:9    Function Parameters: 
-0:9      'sb' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:9      'bufferOffset' (in uint)
+0:5  Function Definition: get(block--vu4[0]1;u1; (temp 4-component vector of uint)
+0:5    Function Parameters: 
+0:5      'sb' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:5      'bufferOffset' (in uint)
 0:?     Sequence
-0:10      Branch: Return with expression
-0:10        indirect index (layout(row_major std430 ) buffer 4-component vector of uint)
-0:10          @data: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint)
-0:10            'sb' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:10            Constant:
-0:10              0 (const uint)
-0:10          'bufferOffset' (in uint)
-0:14  Function Definition: set(block--vu4[0]1;u1;vu4; (temp void)
-0:14    Function Parameters: 
-0:14      'sb' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:14      'bufferOffset' (in uint)
-0:14      'data' (in 4-component vector of uint)
+0:6      Branch: Return with expression
+0:6        indirect index (layout(row_major std430 ) buffer 4-component vector of uint)
+0:6          @data: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint)
+0:6            'sb' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:6            Constant:
+0:6              0 (const uint)
+0:6          'bufferOffset' (in uint)
+0:10  Function Definition: set(block--vu4[0]1;u1;vu4; (temp void)
+0:10    Function Parameters: 
+0:10      'sb' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:10      'bufferOffset' (in uint)
+0:10      'data' (in 4-component vector of uint)
 0:?     Sequence
-0:15      move second child to first child (temp 4-component vector of uint)
-0:15        indirect index (layout(row_major std430 ) buffer 4-component vector of uint)
-0:15          @data: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint)
-0:15            'sb' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:15            Constant:
-0:15              0 (const uint)
-0:15          'bufferOffset' (in uint)
-0:15        'data' (in 4-component vector of uint)
-0:19  Function Definition: @main(u1; (temp 4-component vector of float)
-0:19    Function Parameters: 
-0:19      'pos' (in uint)
+0:11      move second child to first child (temp 4-component vector of uint)
+0:11        indirect index (buffer 4-component vector of uint)
+0:11          @data: direct index for structure (buffer implicitly-sized array of 4-component vector of uint)
+0:11            'sb' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:11            Constant:
+0:11              0 (const uint)
+0:11          'bufferOffset' (in uint)
+0:11        'data' (in 4-component vector of uint)
+0:20  Function Definition: @main(u1; (temp 4-component vector of float)
+0:20    Function Parameters: 
+0:20      'pos' (in uint)
 0:?     Sequence
-0:20      Function Call: set(block--vu4[0]1;u1;vu4; (temp void)
-0:20        'sbuf2' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:20        Constant:
-0:20          2 (const uint)
-0:20        Function Call: get(block--vu4[0]1;u1; (temp 4-component vector of uint)
-0:20          'sbuf' (layout(binding=10 row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:20          Constant:
-0:20            3 (const uint)
-0:22      Branch: Return with expression
-0:22        Constant:
-0:22          0.000000
-0:22          0.000000
-0:22          0.000000
-0:22          0.000000
-0:19  Function Definition: main( (temp void)
-0:19    Function Parameters: 
+0:21      Function Call: set(block--vu4[0]1;u1;vu4; (temp void)
+0:21        'sbuf2' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:21        Constant:
+0:21          2 (const uint)
+0:21        Function Call: get(block--vu4[0]1;u1; (temp 4-component vector of uint)
+0:21          'sbuf' (layout(binding=10 row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:21          Constant:
+0:21            3 (const uint)
+0:23      Branch: Return with expression
+0:23        Constant:
+0:23          0.000000
+0:23          0.000000
+0:23          0.000000
+0:23          0.000000
+0:20  Function Definition: main( (temp void)
+0:20    Function Parameters: 
 0:?     Sequence
-0:19      move second child to first child (temp uint)
+0:20      move second child to first child (temp uint)
 0:?         'pos' (temp uint)
 0:?         'pos' (layout(location=0 ) in uint)
-0:19      move second child to first child (temp 4-component vector of float)
+0:20      move second child to first child (temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
-0:19        Function Call: @main(u1; (temp 4-component vector of float)
+0:20        Function Call: @main(u1; (temp 4-component vector of float)
 0:?           'pos' (temp uint)
 0:?   Linker Objects
 0:?     'sbuf' (layout(binding=10 row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
@@ -70,59 +70,59 @@ Linked fragment stage:
 Shader version: 450
 gl_FragCoord origin is upper left
 0:? Sequence
-0:9  Function Definition: get(block--vu4[0]1;u1; (temp 4-component vector of uint)
-0:9    Function Parameters: 
-0:9      'sb' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:9      'bufferOffset' (in uint)
+0:5  Function Definition: get(block--vu4[0]1;u1; (temp 4-component vector of uint)
+0:5    Function Parameters: 
+0:5      'sb' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:5      'bufferOffset' (in uint)
 0:?     Sequence
-0:10      Branch: Return with expression
-0:10        indirect index (layout(row_major std430 ) buffer 4-component vector of uint)
-0:10          @data: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint)
-0:10            'sb' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:10            Constant:
-0:10              0 (const uint)
-0:10          'bufferOffset' (in uint)
-0:14  Function Definition: set(block--vu4[0]1;u1;vu4; (temp void)
-0:14    Function Parameters: 
-0:14      'sb' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:14      'bufferOffset' (in uint)
-0:14      'data' (in 4-component vector of uint)
+0:6      Branch: Return with expression
+0:6        indirect index (layout(row_major std430 ) buffer 4-component vector of uint)
+0:6          @data: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint)
+0:6            'sb' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:6            Constant:
+0:6              0 (const uint)
+0:6          'bufferOffset' (in uint)
+0:10  Function Definition: set(block--vu4[0]1;u1;vu4; (temp void)
+0:10    Function Parameters: 
+0:10      'sb' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:10      'bufferOffset' (in uint)
+0:10      'data' (in 4-component vector of uint)
 0:?     Sequence
-0:15      move second child to first child (temp 4-component vector of uint)
-0:15        indirect index (layout(row_major std430 ) buffer 4-component vector of uint)
-0:15          @data: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint)
-0:15            'sb' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:15            Constant:
-0:15              0 (const uint)
-0:15          'bufferOffset' (in uint)
-0:15        'data' (in 4-component vector of uint)
-0:19  Function Definition: @main(u1; (temp 4-component vector of float)
-0:19    Function Parameters: 
-0:19      'pos' (in uint)
+0:11      move second child to first child (temp 4-component vector of uint)
+0:11        indirect index (buffer 4-component vector of uint)
+0:11          @data: direct index for structure (buffer implicitly-sized array of 4-component vector of uint)
+0:11            'sb' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:11            Constant:
+0:11              0 (const uint)
+0:11          'bufferOffset' (in uint)
+0:11        'data' (in 4-component vector of uint)
+0:20  Function Definition: @main(u1; (temp 4-component vector of float)
+0:20    Function Parameters: 
+0:20      'pos' (in uint)
 0:?     Sequence
-0:20      Function Call: set(block--vu4[0]1;u1;vu4; (temp void)
-0:20        'sbuf2' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:20        Constant:
-0:20          2 (const uint)
-0:20        Function Call: get(block--vu4[0]1;u1; (temp 4-component vector of uint)
-0:20          'sbuf' (layout(binding=10 row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
-0:20          Constant:
-0:20            3 (const uint)
-0:22      Branch: Return with expression
-0:22        Constant:
-0:22          0.000000
-0:22          0.000000
-0:22          0.000000
-0:22          0.000000
-0:19  Function Definition: main( (temp void)
-0:19    Function Parameters: 
+0:21      Function Call: set(block--vu4[0]1;u1;vu4; (temp void)
+0:21        'sbuf2' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:21        Constant:
+0:21          2 (const uint)
+0:21        Function Call: get(block--vu4[0]1;u1; (temp 4-component vector of uint)
+0:21          'sbuf' (layout(binding=10 row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})
+0:21          Constant:
+0:21            3 (const uint)
+0:23      Branch: Return with expression
+0:23        Constant:
+0:23          0.000000
+0:23          0.000000
+0:23          0.000000
+0:23          0.000000
+0:20  Function Definition: main( (temp void)
+0:20    Function Parameters: 
 0:?     Sequence
-0:19      move second child to first child (temp uint)
+0:20      move second child to first child (temp uint)
 0:?         'pos' (temp uint)
 0:?         'pos' (layout(location=0 ) in uint)
-0:19      move second child to first child (temp 4-component vector of float)
+0:20      move second child to first child (temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
-0:19        Function Call: @main(u1; (temp 4-component vector of float)
+0:20        Function Call: @main(u1; (temp 4-component vector of float)
 0:?           'pos' (temp uint)
 0:?   Linker Objects
 0:?     'sbuf' (layout(binding=10 row_major std430 ) readonly buffer block{layout(row_major std430 ) buffer implicitly-sized array of 4-component vector of uint @data})

+ 66 - 0
3rdparty/glslang/Test/baseResults/spv.pushConstantAnon.vert.out

@@ -0,0 +1,66 @@
+spv.pushConstantAnon.vert
+Warning, version 400 is not yet complete; most version-specific features are present, but some are missing.
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 38
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 24
+                              Source GLSL 400
+                              Name 4  "main"
+                              Name 11  "Material"
+                              MemberName 11(Material) 0  "kind"
+                              MemberName 11(Material) 1  "fa"
+                              Name 13  ""
+                              Name 24  "color"
+                              Decorate 10 ArrayStride 4
+                              MemberDecorate 11(Material) 0 Offset 0
+                              MemberDecorate 11(Material) 1 Offset 4
+                              Decorate 11(Material) Block
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 1
+               7:             TypeFloat 32
+               8:             TypeInt 32 0
+               9:      8(int) Constant 3
+              10:             TypeArray 7(float) 9
+    11(Material):             TypeStruct 6(int) 10
+              12:             TypePointer PushConstant 11(Material)
+              13:     12(ptr) Variable PushConstant
+              14:      6(int) Constant 0
+              15:             TypePointer PushConstant 6(int)
+              22:             TypeVector 7(float) 4
+              23:             TypePointer Output 22(fvec4)
+       24(color):     23(ptr) Variable Output
+              25:    7(float) Constant 1045220557
+              26:   22(fvec4) ConstantComposite 25 25 25 25
+              28:    7(float) Constant 1056964608
+              29:   22(fvec4) ConstantComposite 28 28 28 28
+              31:      6(int) Constant 1
+              32:             TypePointer PushConstant 7(float)
+         4(main):           2 Function None 3
+               5:             Label
+              16:     15(ptr) AccessChain 13 14
+              17:      6(int) Load 16
+                              SelectionMerge 21 None
+                              Switch 17 20 
+                                     case 1: 18
+                                     case 2: 19
+              20:               Label
+              33:     32(ptr)   AccessChain 13 31 31
+              34:    7(float)   Load 33
+              35:   22(fvec4)   CompositeConstruct 34 34 34 34
+                                Store 24(color) 35
+                                Branch 21
+              18:               Label
+                                Store 24(color) 26
+                                Branch 21
+              19:               Label
+                                Store 24(color) 29
+                                Branch 21
+              21:             Label
+                              Return
+                              FunctionEnd

+ 1 - 2
3rdparty/glslang/Test/baseResults/vulkan.frag.out

@@ -19,7 +19,6 @@ ERROR: 0:39: 'push_constant' : can only be used with a uniform
 ERROR: 0:43: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan 
 ERROR: 0:43: 'push_constant' : can only be used with a block 
 ERROR: 0:45: 'push_constant' : cannot declare a default, can only be used on a block 
-ERROR: 0:47: 'push_constant' : requires an instance name 
 ERROR: 0:52: 'input_attachment_index' : can only be used with a subpass 
 ERROR: 0:53: 'input_attachment_index' : can only be used with a subpass 
 ERROR: 0:54: 'subpass' : requires an input_attachment_index layout qualifier 
@@ -41,7 +40,7 @@ ERROR: 0:93: ',' : sampler constructor must appear at point of use
 ERROR: 0:94: ':' :  wrong operand types: no operation ':' exists that takes a left-hand operand of type 'temp sampler2D' and a right operand of type 'temp sampler2D' (or there is no acceptable conversion)
 ERROR: 0:94: 'call argument' : sampler constructor must appear at point of use 
 ERROR: 0:96: 'gl_NumSamples' : undeclared identifier 
-ERROR: 39 compilation errors.  No code generated.
+ERROR: 38 compilation errors.  No code generated.
 
 
 ERROR: Linking fragment stage: Only one push_constant block is allowed per stage

+ 68 - 65
3rdparty/glslang/Test/hlsl.gathercmpRGBA.offset.dx10.frag

@@ -29,10 +29,10 @@ uniform float2 c2;
 uniform float3 c3;
 uniform float4 c4;
 
-uniform int  o1;
-uniform int2 o2;
-uniform int3 o3;
-uniform int4 o4;
+
+
+
+
 
 PS_OUTPUT main()
 {
@@ -42,69 +42,72 @@ PS_OUTPUT main()
 
    // no 1D gathers
 
-   float4 txval001 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2);
-   int4   txval011 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2);
-   uint4  txval021 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2);
+   float4 txval001 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0));
+   int4   txval011 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,-1));
+   uint4  txval021 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,1));
 
-   float4 txval004 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-   int4   txval014 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-   uint4  txval024 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
+   float4 txval004 = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+   int4   txval014 = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,-1), int2(1,-1), int2(1,-1), int2(1,-1));
+   uint4  txval024 = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,1), int2(1,1), int2(1,1), int2(1,1));
    
-   // float4 txval00s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, status);
-   // int4   txval01s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, status);
-   // uint4  txval02s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, status);
-
-   // float4 txval004s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-   // int4   txval014s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-   // uint4  txval024s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-
-   float4 txval101 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2);
-   int4   txval111 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2);
-   uint4  txval121 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2);
-
-   float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-   int4   txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-   uint4  txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-
-   // float4 txval10s = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, status);
-   // int4   txval11s = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, status);
-   // uint4  txval12s = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, status);
-
-   // float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-   // int4   txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-   // uint4  txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-
-   float4 txval201 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2);
-   int4   txval211 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2);
-   uint4  txval221 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2);
-
-   float4 txval204 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-   int4   txval214 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-   uint4  txval224 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-
-   // float4 txval204s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-   // int4   txval214s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-   // uint4  txval224s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-
-   // float4 txval20s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, status);
-   // int4   txval21s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, status);
-   // uint4  txval22s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, o2, status);
-
-   float4 txval301 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2);
-   int4   txval311 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2);
-   uint4  txval321 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2);
-
-   float4 txval304 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-   int4   txval314 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-   uint4  txval324 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2);
-
-   // float4 txval304s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-   // int4   txval314s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-   // uint4  txval324s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, o2, o2, o2, status);
-
-   // float4 txval30s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, status);
-   // int4   txval31s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, status);
-   // uint4  txval32s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, o2, status);
+   // float4 txval00s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status);
+   // int4   txval01s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status);
+   // uint4  txval02s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), status);
+
+   // float4 txval004s = g_tTex2df4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+   // int4   txval014s = g_tTex2di4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+   // uint4  txval024s = g_tTex2du4 . GatherCmpRed(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+
+   // GatherCmpGreen not implemented pending OpImageDrefGather component input
+   // float4 txval101 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
+   // int4   txval111 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
+   // uint4  txval121 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0));
+
+   // float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+   // int4   txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+   // uint4  txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+
+   // float4 txval10s = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status);
+   // int4   txval11s = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status);
+   // uint4  txval12s = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), status);
+
+   // float4 txval104 = g_tTex2df4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+   // int4   txval114 = g_tTex2di4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+   // uint4  txval124 = g_tTex2du4 . GatherCmpGreen(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+
+   // GatherCmpBlue not implemented pending OpImageDrefGather component input
+   // float4 txval201 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0));
+   // int4   txval211 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0));
+   // uint4  txval221 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0));
+
+   // float4 txval204 = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+   // int4   txval214 = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+   // uint4  txval224 = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+
+   // float4 txval204s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+   // int4   txval214s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+   // uint4  txval224s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+
+   // float4 txval20s = g_tTex2df4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status);
+   // int4   txval21s = g_tTex2di4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status);
+   // uint4  txval22s = g_tTex2du4 . GatherCmpBlue(g_sSampCmp, c2, 0.75, int2(1,0), status);
+
+   // GatherCmpAlpha not implemented pending OpImageDrefGather component input
+   // float4 txval301 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0));
+   // int4   txval311 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0));
+   // uint4  txval321 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0));
+
+   // float4 txval304 = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+   // int4   txval314 = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+   // uint4  txval324 = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0));
+
+   // float4 txval304s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+   // int4   txval314s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+   // uint4  txval324s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), int2(1,0), int2(1,0), int2(1,0), status);
+
+   // float4 txval30s = g_tTex2df4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status);
+   // int4   txval31s = g_tTex2di4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status);
+   // uint4  txval32s = g_tTex2du4 . GatherCmpAlpha(g_sSampCmp, c2, 0.75, int2(1,0), status);
 
    // no 3D gathers with offset
 

+ 2 - 0
3rdparty/glslang/Test/hlsl.if.frag

@@ -30,4 +30,6 @@ float4 PixelShaderFunction(float4 input) : COLOR0
 	if (float ii = input.z)
 	    ++ii;
 	++ii;
+    if (float(ii) == 1.0)
+        ++ii;
 }

+ 15 - 0
3rdparty/glslang/Test/hlsl.semantic.geom

@@ -0,0 +1,15 @@
+struct S {
+    float clip0 : SV_ClipDistance0;
+    float cull0 : SV_CullDistance0;
+    uint vpai   : SV_ViewportArrayIndex;
+    uint rtai   : SV_RenderTargetArrayIndex;
+    int ii      : SV_InstanceID;
+};
+
+[maxvertexcount(4)]
+S main(triangle in uint VertexID[3] : VertexID,
+       inout LineStream<S> OutputStream)
+{
+    S s;
+    return s;
+}

+ 15 - 0
3rdparty/glslang/Test/hlsl.semantic.vert

@@ -0,0 +1,15 @@
+struct S {
+    float clip  : SV_ClipDistance;
+    float clip0 : SV_ClipDistance0;
+    float clip7 : SV_ClipDistance7;
+    float cull  : SV_CullDistance;
+    float cull2 : SV_CullDistance2;
+    float cull5 : SV_CullDistance5;
+    int ii      : SV_InstanceID;
+};
+
+S main(S ins)
+{
+    S s;
+    return s;
+}

+ 22 - 0
3rdparty/glslang/Test/hlsl.staticMemberFunction.frag

@@ -0,0 +1,22 @@
+struct Test
+{
+    float4 memVar;
+    static float4 staticMemFun(float4 a) : SV_Position
+    {
+        return 2 * a;
+    }
+    static int staticMemFun(int a) : SV_Position
+    {
+        return 2 + a;
+    }
+    int i;
+};
+
+float4 main() : SV_Target0
+{
+   Test test;
+   float4 f4 = float4(1.0,1.0,1.0,1.0);
+   f4 += Test::staticMemFun(float4(5.0f,5.0f,5.0f,5.0f));
+   f4 += Test::staticMemFun(7);
+   return f4;
+}

+ 5 - 4
3rdparty/glslang/Test/hlsl.structbuffer.fn.frag

@@ -1,9 +1,5 @@
 
 StructuredBuffer<uint4>  sbuf : register(t10);
-RWStructuredBuffer<uint4> sbuf2;
-
-// Not shared, because of type difference.
-StructuredBuffer<uint3>  sbuf3 : register(t12);
 
 uint4 get(in StructuredBuffer<uint4> sb, uint bufferOffset)
 {
@@ -15,6 +11,11 @@ void set(in RWStructuredBuffer<uint4> sb, uint bufferOffset, uint4 data)
     sb[bufferOffset] = data;
 }
 
+RWStructuredBuffer<uint4> sbuf2;
+
+// Not shared, because of type difference.
+StructuredBuffer<uint3>  sbuf3 : register(t12);
+
 float4 main(uint pos : FOO) : SV_Target0
 {
     set(sbuf2, 2, get(sbuf, 3));

+ 17 - 0
3rdparty/glslang/Test/spv.pushConstantAnon.vert

@@ -0,0 +1,17 @@
+#version 400
+
+layout(push_constant) uniform Material {
+    int kind;
+    float fa[3];
+};
+
+out vec4 color;
+
+void main()
+{
+    switch (kind) {
+    case 1:  color = vec4(0.2); break;
+    case 2:  color = vec4(0.5); break;
+    default: color = vec4(fa[1]); break;
+    }
+}

+ 1 - 1
3rdparty/glslang/Test/vulkan.frag

@@ -46,7 +46,7 @@ layout(push_constant) uniform;                // ERROR, needs an object
 
 layout(push_constant) uniform pcb2 {
     int a;
-};                                            // ERROR, no instance name
+};                                            // Okay now to have no instance name
 
 layout(input_attachment_index = 2) uniform subpassInput subD;
 layout(input_attachment_index = 3) uniform texture2D subDbad1;          // ERROR, not a texture

+ 1 - 0
3rdparty/glslang/glslang/Include/BaseTypes.h

@@ -218,6 +218,7 @@ enum TBuiltInVariable {
     // to one of the above.
     EbvFragDepthGreater,
     EbvFragDepthLesser,
+    EbvStencilRef,
 
     EbvLast
 };

+ 1 - 0
3rdparty/glslang/glslang/Include/intermediate.h

@@ -183,6 +183,7 @@ enum TOperator {
     EOpVectorSwizzle,
 
     EOpMethod,
+    EOpScoping,
 
     //
     // Built-in functions mapped to operators

+ 2 - 2
3rdparty/glslang/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 "Overload400-PrecQual.1875"
-#define GLSLANG_DATE "03-Mar-2017"
+#define GLSLANG_REVISION "Overload400-PrecQual.1899"
+#define GLSLANG_DATE "11-Mar-2017"

+ 4 - 4
3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp

@@ -1158,15 +1158,15 @@ TIntermAggregate* TIntermediate::growAggregate(TIntermNode* left, TIntermNode* r
         return nullptr;
 
     TIntermAggregate* aggNode = nullptr;
-    if (left)
+    if (left != nullptr)
         aggNode = left->getAsAggregate();
-    if (! aggNode || aggNode->getOp() != EOpNull) {
+    if (aggNode == nullptr || aggNode->getOp() != EOpNull) {
         aggNode = new TIntermAggregate;
-        if (left)
+        if (left != nullptr)
             aggNode->getSequence().push_back(left);
     }
 
-    if (right)
+    if (right != nullptr)
         aggNode->getSequence().push_back(right);
 
     return aggNode;

+ 1 - 4
3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp

@@ -5797,11 +5797,8 @@ void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier&
         error(loc, "cannot use sample qualifier on an interface block", "sample", "");
     if (qualifier.invariant)
         error(loc, "cannot use invariant qualifier on an interface block", "invariant", "");
-    if (qualifier.layoutPushConstant) {
+    if (qualifier.layoutPushConstant)
         intermediate.addPushConstantCount();
-        if (! instanceName)
-            error(loc, "requires an instance name", "push_constant", "");
-    }
 }
 
 //

+ 4 - 0
3rdparty/glslang/glslang/MachineIndependent/Scan.cpp

@@ -701,6 +701,10 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
         case PpAtomDecrement:          return DEC_OP;
         case PpAtomIncrement:          return INC_OP;
 
+        case PpAtomColonColon:
+            parseContext.error(loc, "not supported", "::", "");
+            break;
+
         case PpAtomConstInt:           parserToken->sType.lex.i   = ppToken.ival;       return INTCONSTANT;
         case PpAtomConstUint:          parserToken->sType.lex.i   = ppToken.ival;       return UINTCONSTANT;
         case PpAtomConstInt64:         parserToken->sType.lex.i64 = ppToken.i64val;     return INT64CONSTANT;

+ 13 - 0
3rdparty/glslang/glslang/MachineIndependent/Versions.cpp

@@ -332,6 +332,19 @@ void TParseVersions::getPreamble(std::string& preamble)
             "#define GL_GOOGLE_include_directive 1\n"
             ;
 
+    if (version >= 150) {
+        // define GL_core_profile and GL_compatibility_profile
+        preamble +=
+                "#define GL_core_profile 1\n"
+                ;
+
+        if (profile == ECompatibilityProfile) {
+            preamble +=
+                    "#define GL_compatibility_profile 1\n"
+                    ;
+        }
+    }
+
     // #define VULKAN XXXX
     const int numberBufSize = 12;
     char numberBuf[numberBufSize];

+ 2 - 0
3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpAtom.cpp

@@ -120,6 +120,8 @@ const struct {
     { PpAtomDecrement,      "--" },
     { PpAtomIncrement,      "++" },
 
+    { PpAtomColonColon,     "::" },
+
     { PpAtomDefine,         "define" },
     { PpAtomUndef,          "undef" },
     { PpAtomIf,             "if" },

+ 6 - 0
3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp

@@ -691,6 +691,12 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
                 pp->parseContext.ppError(ppToken->loc, "End of line in string", "string", "");
             }
             return PpAtomConstString;
+        case ':':
+            ch = getch();
+            if (ch == ':')
+                return PpAtomColonColon;
+            ungetch();
+            return ':';
         }
 
         ch = getch();

+ 2 - 0
3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.h

@@ -117,6 +117,8 @@ enum EFixedAtoms {
     PpAtomDecrement,
     PpAtomIncrement,
 
+    PpAtomColonColon,
+
     PpAtomPaste,
 
     // Constants

+ 4 - 0
3rdparty/glslang/gtests/Hlsl.FromFile.cpp

@@ -111,6 +111,7 @@ INSTANTIATE_TEST_CASE_P(
         {"hlsl.gather.basic.dx10.vert", "main"},
         {"hlsl.gather.offset.dx10.frag", "main"},
         {"hlsl.gather.offsetarray.dx10.frag", "main"},
+        {"hlsl.gathercmpRGBA.offset.dx10.frag", "main"},
         {"hlsl.gatherRGBA.array.dx10.frag", "main"},
         {"hlsl.gatherRGBA.basic.dx10.frag", "main"},
         {"hlsl.gatherRGBA.offset.dx10.frag", "main"},
@@ -211,6 +212,7 @@ INSTANTIATE_TEST_CASE_P(
         {"hlsl.semicolons.frag", "main"},
         {"hlsl.shapeConv.frag", "main"},
         {"hlsl.shapeConvRet.frag", "main"},
+        {"hlsl.staticMemberFunction.frag", "main"},
         {"hlsl.stringtoken.frag", "main"},
         {"hlsl.string.frag", "main"},
         {"hlsl.struct.split-1.vert", "main"},
@@ -239,6 +241,8 @@ INSTANTIATE_TEST_CASE_P(
         {"hlsl.max.frag", "PixelShaderFunction"},
         {"hlsl.precedence.frag", "PixelShaderFunction"},
         {"hlsl.precedence2.frag", "PixelShaderFunction"},
+        {"hlsl.semantic.geom", "main"},
+        {"hlsl.semantic.vert", "main"},
         {"hlsl.scope.frag", "PixelShaderFunction"},
         {"hlsl.sin.frag", "PixelShaderFunction"},
         {"hlsl.struct.frag", "PixelShaderFunction"},

+ 1 - 0
3rdparty/glslang/gtests/Spv.FromFile.cpp

@@ -295,6 +295,7 @@ INSTANTIATE_TEST_CASE_P(
         "spv.separate.frag",
         "spv.shortCircuit.frag",
         "spv.pushConstant.vert",
+        "spv.pushConstantAnon.vert",
         "spv.subpass.frag",
         "spv.specConstant.vert",
         "spv.specConstant.comp",

+ 212 - 96
3rdparty/glslang/hlsl/hlslGrammar.cpp

@@ -131,18 +131,13 @@ bool HlslGrammar::acceptCompilationUnit()
             continue;
 
         // externalDeclaration
-        TIntermNode* declarationNode1;
-        TIntermNode* declarationNode2 = nullptr;  // sometimes the grammar for a single declaration creates two
-        if (! acceptDeclaration(declarationNode1, declarationNode2))
+        if (! acceptDeclaration(unitNode))
             return false;
-
-        // hook it up
-        unitNode = intermediate.growAggregate(unitNode, declarationNode1);
-        if (declarationNode2 != nullptr)
-            unitNode = intermediate.growAggregate(unitNode, declarationNode2);
     }
 
     // set root of AST
+    if (unitNode && !unitNode->getAsAggregate())
+        unitNode = intermediate.growAggregate(nullptr, unitNode);
     intermediate.setTreeRoot(unitNode);
 
     return true;
@@ -292,22 +287,18 @@ bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/)
 // as above.  (The 'identifier' in the first item in init_declarator list is the
 // same as 'identifier' for function declarations.)
 //
-// 'node' could get populated if the declaration creates code, like an initializer
-// or a function body.
+// This can generate more than one subtree, one per initializer or a function body.
+// All initializer subtrees are put in their own aggregate node, making one top-level
+// node for all the initializers. Each function created is a top-level node to grow
+// into the passed-in nodeList.
 //
-// 'node2' could get populated with a second decoration tree if a single source declaration
-// leads to two subtrees that need to be peers higher up.
+// If 'nodeList' is passed in as non-null, it must an aggregate to extend for
+// each top-level node the declaration creates. Otherwise, if only one top-level
+// node in generated here, that is want is returned in nodeList.
 //
-bool HlslGrammar::acceptDeclaration(TIntermNode*& node)
-{
-    TIntermNode* node2;
-    return acceptDeclaration(node, node2);
-}
-bool HlslGrammar::acceptDeclaration(TIntermNode*& node, TIntermNode*& node2)
+bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
 {
-    node = nullptr;
-    node2 = nullptr;
-    bool list = false;
+    bool declarator_list = false; // true when processing comma separation
 
     // attributes
     TAttributeMap attributes;
@@ -324,35 +315,41 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node, TIntermNode*& node2)
     // HLSL shaders, this will have to be a master level switch
     // As such, the sampler keyword in D3D10+ turns into an automatic sampler type, and is commonly used
     // For that reason, this line is commented out
-
-   // if (acceptSamplerDeclarationDX9(declaredType))
-   //     return true;
+    // if (acceptSamplerDeclarationDX9(declaredType))
+    //     return true;
 
     // fully_specified_type
-    if (! acceptFullySpecifiedType(declaredType))
+    if (! acceptFullySpecifiedType(declaredType, nodeList))
         return false;
 
     // identifier
     HlslToken idToken;
+    TIntermAggregate* initializers = nullptr;
     while (acceptIdentifier(idToken)) {
-        TString* fnName = idToken.string;
+        if (peekTokenClass(EHTokLeftParen)) {
+            // looks like function parameters
+            TString* fnName = idToken.string;
 
-        // Potentially rename shader entry point function.  No-op most of the time.
-        parseContext.renameShaderFunction(fnName);
+            // Potentially rename shader entry point function.  No-op most of the time.
+            parseContext.renameShaderFunction(fnName);
+
+            // function_parameters
+            TFunction& function = *new TFunction(fnName, declaredType);
+            if (!acceptFunctionParameters(function)) {
+                expected("function parameter list");
+                return false;
+            }
 
-        // function_parameters
-        TFunction& function = *new TFunction(fnName, declaredType);
-        if (acceptFunctionParameters(function)) {
             // post_decls
             acceptPostDecls(function.getWritableType().getQualifier());
 
             // compound_statement (function body definition) or just a prototype?
             if (peekTokenClass(EHTokLeftBrace)) {
-                if (list)
+                if (declarator_list)
                     parseContext.error(idToken.loc, "function body can't be in a declarator list", "{", "");
                 if (typedefDecl)
                     parseContext.error(idToken.loc, "function body can't be in a typedef", "{", "");
-                return acceptFunctionDefinition(function, node, node2, attributes);
+                return acceptFunctionDefinition(function, nodeList, attributes);
             } else {
                 if (typedefDecl)
                     parseContext.error(idToken.loc, "function typedefs not implemented", "{", "");
@@ -421,24 +418,29 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node, TIntermNode*& node2)
                         // Declare the variable and add any initializer code to the AST.
                         // The top-level node is always made into an aggregate, as that's
                         // historically how the AST has been.
-                        node = intermediate.growAggregate(node,
-                                                          parseContext.declareVariable(idToken.loc, *idToken.string, variableType,
-                                                                                       expressionNode),
-                                                          idToken.loc);
+                        initializers = intermediate.growAggregate(initializers,
+                            parseContext.declareVariable(idToken.loc, *idToken.string, variableType, expressionNode),
+                            idToken.loc);
                     }
                 }
             }
         }
 
         if (acceptTokenClass(EHTokComma)) {
-            list = true;
+            declarator_list = true;
             continue;
         }
     };
 
-    // The top-level node is a sequence.
-    if (node != nullptr)
-        node->getAsAggregate()->setOperator(EOpSequence);
+    // The top-level initializer node is a sequence.
+    if (initializers != nullptr)
+        initializers->setOperator(EOpSequence);
+
+    // Add the initializers' aggregate to the nodeList we were handed.
+    if (nodeList)
+        nodeList = intermediate.growAggregate(nodeList, initializers);
+    else
+        nodeList = initializers;
 
     // SEMICOLON
     if (! acceptTokenClass(EHTokSemicolon)) {
@@ -469,6 +471,12 @@ bool HlslGrammar::acceptControlDeclaration(TIntermNode*& node)
     if (! acceptFullySpecifiedType(type))
         return false;
 
+    // filter out type casts
+    if (peekTokenClass(EHTokLeftParen)) {
+        recedeToken();
+        return false;
+    }
+
     // identifier
     HlslToken idToken;
     if (! acceptIdentifier(idToken)) {
@@ -499,6 +507,11 @@ bool HlslGrammar::acceptControlDeclaration(TIntermNode*& node)
 //      | type_qualifier type_specifier
 //
 bool HlslGrammar::acceptFullySpecifiedType(TType& type)
+{
+    TIntermNode* nodeList = nullptr;
+    return acceptFullySpecifiedType(type, nodeList);
+}
+bool HlslGrammar::acceptFullySpecifiedType(TType& type, TIntermNode*& nodeList)
 {
     // type_qualifier
     TQualifier qualifier;
@@ -508,7 +521,7 @@ bool HlslGrammar::acceptFullySpecifiedType(TType& type)
     TSourceLoc loc = token.loc;
 
     // type_specifier
-    if (! acceptType(type)) {
+    if (! acceptType(type, nodeList)) {
         // If this is not a type, we may have inadvertently gone down a wrong path
         // by parsing "sample", which can be treated like either an identifier or a
         // qualifier.  Back it out, if we did.
@@ -983,7 +996,7 @@ bool HlslGrammar::acceptAnnotations(TQualifier&)
             break;
 
         // declaration
-        TIntermNode* node;
+        TIntermNode* node = nullptr;
         if (! acceptDeclaration(node)) {
             expected("declaration in annotation");
             return false;
@@ -1179,6 +1192,11 @@ bool HlslGrammar::acceptTextureType(TType& type)
 // and return true and advance.
 // Otherwise, return false, and don't advance
 bool HlslGrammar::acceptType(TType& type)
+{
+    TIntermNode* nodeList = nullptr;
+    return acceptType(type, nodeList);
+}
+bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList)
 {
     // Basic types for min* types, broken out here in case of future
     // changes, e.g, to use native halfs.
@@ -1263,7 +1281,7 @@ bool HlslGrammar::acceptType(TType& type)
     case EHTokStruct:
     case EHTokCBuffer:
     case EHTokTBuffer:
-        return acceptStruct(type);
+        return acceptStruct(type, nodeList);
 
     case EHTokIdentifier:
         // An identifier could be for a user-defined type.
@@ -1737,7 +1755,7 @@ bool HlslGrammar::acceptType(TType& type)
 //      | CBUFFER
 //      | TBUFFER
 //
-bool HlslGrammar::acceptStruct(TType& type)
+bool HlslGrammar::acceptStruct(TType& type, TIntermNode*& nodeList)
 {
     // This storage qualifier will tell us whether it's an AST
     // block type or just a generic structure type.
@@ -1780,7 +1798,7 @@ bool HlslGrammar::acceptStruct(TType& type)
 
     // struct_declaration_list
     TTypeList* typeList;
-    if (! acceptStructDeclarationList(typeList)) {
+    if (! acceptStructDeclarationList(typeList, nodeList, structName)) {
         expected("struct member declarations");
         return false;
     }
@@ -1874,6 +1892,7 @@ bool HlslGrammar::acceptStructBufferType(TType& type)
     TArraySizes unsizedArray;
     unsizedArray.addInnerSize(UnsizedArraySize);
     templateType->newArraySizes(unsizedArray);
+    templateType->getQualifier().storage = storage;
 
     // field name is canonical for all structbuffers
     templateType->setFieldName("@data");
@@ -1904,12 +1923,14 @@ bool HlslGrammar::acceptStructBufferType(TType& type)
 //
 // struct_declaration
 //      : fully_specified_type struct_declarator COMMA struct_declarator ...
+//      | fully_specified_type IDENTIFIER function_parameters post_decls compound_statement // member-function definition
 //
 // struct_declarator
 //      : IDENTIFIER post_decls
 //      | IDENTIFIER array_specifier post_decls
+//      | IDENTIFIER function_parameters post_decls                                         // member-function prototype
 //
-bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
+bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList, TIntermNode*& nodeList, const TString& typeName)
 {
     typeList = new TTypeList();
     HlslToken idToken;
@@ -1920,51 +1941,66 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
             return true;
 
         // struct_declaration
+    
+        bool declarator_list = false;
 
         // fully_specified_type
         TType memberType;
-        if (! acceptFullySpecifiedType(memberType)) {
+        if (! acceptFullySpecifiedType(memberType, nodeList)) {
             expected("member type");
             return false;
         }
 
         // struct_declarator COMMA struct_declarator ...
+        bool functionDefinitionAccepted = false;
         do {
             if (! acceptIdentifier(idToken)) {
                 expected("member name");
                 return false;
             }
 
-            // add it to the list of members
-            TTypeLoc member = { new TType(EbtVoid), token.loc };
-            member.type->shallowCopy(memberType);
-            member.type->setFieldName(*idToken.string);
-            typeList->push_back(member);
-
-            // array_specifier
-            TArraySizes* arraySizes = nullptr;
-            acceptArraySpecifier(arraySizes);
-            if (arraySizes)
-                typeList->back().type->newArraySizes(*arraySizes);
-
-            acceptPostDecls(member.type->getQualifier());
-
-            // EQUAL assignment_expression
-            if (acceptTokenClass(EHTokAssign)) {
-                parseContext.warn(idToken.loc, "struct-member initializers ignored", "typedef", "");
-                TIntermTyped* expressionNode = nullptr;
-                if (! acceptAssignmentExpression(expressionNode)) {
-                    expected("initializer");
-                    return false;
+            if (peekTokenClass(EHTokLeftParen)) {
+                // function_parameters
+                if (!declarator_list) {
+                    functionDefinitionAccepted = acceptMemberFunctionDefinition(nodeList, typeName, memberType, *idToken.string);
+                    if (functionDefinitionAccepted)
+                        break;
+                }
+                expected("member-function definition");
+                return false;
+            } else {
+                // add it to the list of members
+                TTypeLoc member = { new TType(EbtVoid), token.loc };
+                member.type->shallowCopy(memberType);
+                member.type->setFieldName(*idToken.string);
+                typeList->push_back(member);
+
+                // array_specifier
+                TArraySizes* arraySizes = nullptr;
+                acceptArraySpecifier(arraySizes);
+                if (arraySizes)
+                    typeList->back().type->newArraySizes(*arraySizes);
+
+                acceptPostDecls(member.type->getQualifier());
+
+                // EQUAL assignment_expression
+                if (acceptTokenClass(EHTokAssign)) {
+                    parseContext.warn(idToken.loc, "struct-member initializers ignored", "typedef", "");
+                    TIntermTyped* expressionNode = nullptr;
+                    if (! acceptAssignmentExpression(expressionNode)) {
+                        expected("initializer");
+                        return false;
+                    }
                 }
             }
-
             // success on seeing the SEMICOLON coming up
             if (peekTokenClass(EHTokSemicolon))
                 break;
 
             // COMMA
-            if (! acceptTokenClass(EHTokComma)) {
+            if (acceptTokenClass(EHTokComma))
+                declarator_list = true;
+            else {
                 expected(",");
                 return false;
             }
@@ -1972,7 +2008,7 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
         } while (true);
 
         // SEMI_COLON
-        if (! acceptTokenClass(EHTokSemicolon)) {
+        if (! functionDefinitionAccepted && ! acceptTokenClass(EHTokSemicolon)) {
             expected(";");
             return false;
         }
@@ -1980,6 +2016,43 @@ bool HlslGrammar::acceptStructDeclarationList(TTypeList*& typeList)
     } while (true);
 }
 
+// member_function_definition
+//    | function_parameters post_decls compound_statement
+//
+// Expects type to have EvqGlobal for a static member and
+// EvqTemporary for non-static member.
+bool HlslGrammar::acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TString& typeName,
+                                                 const TType& type, const TString& memberName)
+{
+    // watch early returns...
+    parseContext.pushThis(typeName);
+    bool accepted = false;
+
+    TString* functionName = parseContext.getFullMemberFunctionName(memberName, type.getQualifier().storage == EvqGlobal);
+    TFunction& function = *new TFunction(functionName, type);
+
+    // function_parameters
+    if (acceptFunctionParameters(function)) {
+        // post_decls
+        acceptPostDecls(function.getWritableType().getQualifier());
+
+        // compound_statement (function body definition)
+        if (peekTokenClass(EHTokLeftBrace)) {
+            if (function.getType().getQualifier().storage != EvqGlobal) {
+                expected("only static member functions are accepted");
+                return false;
+            }
+
+            TAttributeMap attributes;
+            accepted = acceptFunctionDefinition(function, nodeList, attributes);
+        }
+    } else
+        expected("function parameter list");
+
+    parseContext.popThis();
+    return accepted;
+}
+
 // function_parameters
 //      : LEFT_PAREN parameter_declaration COMMA parameter_declaration ... RIGHT_PAREN
 //      | LEFT_PAREN VOID RIGHT_PAREN
@@ -2107,20 +2180,29 @@ bool HlslGrammar::acceptParameterDeclaration(TFunction& function)
 
 // Do the work to create the function definition in addition to
 // parsing the body (compound_statement).
-bool HlslGrammar::acceptFunctionDefinition(TFunction& function, TIntermNode*& node, TIntermNode*& node2, const TAttributeMap& attributes)
+bool HlslGrammar::acceptFunctionDefinition(TFunction& function, TIntermNode*& nodeList, const TAttributeMap& attributes)
 {
     TFunction& functionDeclarator = parseContext.handleFunctionDeclarator(token.loc, function, false /* not prototype */);
     TSourceLoc loc = token.loc;
 
+    // we might get back and entry-point
+    TIntermNode* entryPointNode = nullptr;
+
     // This does a pushScope()
-    node = parseContext.handleFunctionDefinition(loc, functionDeclarator, attributes, node2);
+    TIntermNode* functionNode = parseContext.handleFunctionDefinition(loc, functionDeclarator, attributes,
+                                                                      entryPointNode);
 
     // compound_statement
     TIntermNode* functionBody = nullptr;
     if (! acceptCompoundStatement(functionBody))
         return false;
 
-    parseContext.handleFunctionBody(loc, functionDeclarator, functionBody, node);
+    // this does a popScope()
+    parseContext.handleFunctionBody(loc, functionDeclarator, functionBody, functionNode);
+
+    // Hook up the 1 or 2 function definitions.
+    nodeList = intermediate.growAggregate(nodeList, functionNode);
+    nodeList = intermediate.growAggregate(nodeList, entryPointNode);
 
     return true;
 }
@@ -2472,17 +2554,22 @@ bool HlslGrammar::acceptUnaryExpression(TIntermTyped*& node)
 //      | function_call
 //      | postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET
 //      | postfix_expression DOT IDENTIFIER
+//      | postfix_expression DOT IDENTIFIER arguments
+//      | postfix_expression COLONCOLON IDENTIFIER arguments
 //      | postfix_expression INC_OP
 //      | postfix_expression DEC_OP
 //
 bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node)
 {
     // Not implemented as self-recursive:
-    // The logical "right recursion" is done with an loop at the end
+    // The logical "right recursion" is done with a loop at the end
 
     // idToken will pick up either a variable or a function name in a function call
     HlslToken idToken;
 
+    // scopeBase will pick up the type symbol on the left of '::'
+    TSymbol* scopeBase = nullptr;
+
     // Find something before the postfix operations, as they can't operate
     // on nothing.  So, no "return true", they fall through, only "return false".
     if (acceptTokenClass(EHTokLeftParen)) {
@@ -2500,8 +2587,15 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node)
     } else if (acceptConstructor(node)) {
         // constructor (nothing else to do yet)
     } else if (acceptIdentifier(idToken)) {
-        // identifier or function_call name
-        if (! peekTokenClass(EHTokLeftParen)) {
+        // user-type, identifier, or function name
+        if (peekTokenClass(EHTokColonColon)) {
+            TType type;
+            scopeBase = parseContext.lookupUserType(*idToken.string, type);
+            if (scopeBase == nullptr) {
+                expected("type left of ::");
+                return false;
+            }
+        } else if (! peekTokenClass(EHTokLeftParen)) {
             node = parseContext.handleVariable(idToken.loc, idToken.symbol, idToken.string);
         } else if (acceptFunctionCall(idToken, node)) {
             // function_call (nothing else to do yet)
@@ -2521,7 +2615,7 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node)
         ~tFinalize() { parseContext.finalizeFlattening(); }
         HlslParseContext& parseContext;
     private:
-        const tFinalize& operator=(const tFinalize& f) { return *this; }
+        const tFinalize& operator=(const tFinalize&) { return *this; }
         tFinalize(const tFinalize& f) : parseContext(f.parseContext) { }
     } finalize(parseContext);
 
@@ -2542,6 +2636,7 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node)
         case EOpIndexIndirect:
         case EOpPostIncrement:
         case EOpPostDecrement:
+        case EOpScoping:
             advanceToken();
             break;
         default:
@@ -2550,26 +2645,28 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node)
 
         // We have a valid post-unary operator, process it.
         switch (postOp) {
+        case EOpScoping:
         case EOpIndexDirectStruct:
         {
             // DOT IDENTIFIER
-            // includes swizzles and struct members
+            // includes swizzles, member variables, and member functions
             HlslToken field;
             if (! acceptIdentifier(field)) {
                 expected("swizzle or member");
                 return false;
             }
 
-            TIntermTyped* base = node; // preserve for method function calls
-            node = parseContext.handleDotDereference(field.loc, node, *field.string);
+            if (peekTokenClass(EHTokLeftParen)) {
+                // member function
+                TIntermTyped* thisNode = node;
 
-            // In the event of a method node, we look for an open paren and accept the function call.
-            if (node != nullptr && node->getAsMethodNode() != nullptr && peekTokenClass(EHTokLeftParen)) {
-                if (! acceptFunctionCall(field, node, base)) {
+                // arguments
+                if (! acceptFunctionCall(field, node, thisNode, scopeBase)) {
                     expected("function parameters");
                     return false;
                 }
-            }
+            } else
+                node = parseContext.handleDotDereference(field.loc, node, *field.string);
 
             break;
         }
@@ -2636,20 +2733,39 @@ bool HlslGrammar::acceptConstructor(TIntermTyped*& node)
 // function_call
 //      : [idToken] arguments
 //
-bool HlslGrammar::acceptFunctionCall(HlslToken idToken, TIntermTyped*& node, TIntermTyped* base)
+bool HlslGrammar::acceptFunctionCall(HlslToken callToken, TIntermTyped*& node, TIntermTyped* baseObject,
+                                     const TSymbol* baseType)
 {
-    // arguments
-    TFunction* function = new TFunction(idToken.string, TType(EbtVoid));
-    TIntermTyped* arguments = nullptr;
+    // name
+    TString* functionName = nullptr;
+    if ((baseObject == nullptr && baseType == nullptr)
+        || parseContext.isBuiltInMethod(callToken.loc, baseObject, *callToken.string))
+        functionName = callToken.string;
+    else {
+        functionName = NewPoolTString("");
+        if (baseObject != nullptr) {
+            functionName->append(baseObject->getType().getTypeName().c_str());
+            functionName->append(".");
+        } else if (baseType != nullptr) {
+            functionName->append(baseType->getType().getTypeName());
+            functionName->append("::");
+        }
+        functionName->append(*callToken.string);
+    }
 
-    // methods have an implicit first argument of the calling object.
-    if (base != nullptr)
-        parseContext.handleFunctionArgument(function, arguments, base);
+    // function
+    TFunction* function = new TFunction(functionName, TType(EbtVoid));
 
+    // arguments
+    // Non-static member functions have an implicit first argument of the base object.
+    TIntermTyped* arguments = nullptr;
+    if (baseObject != nullptr)
+        parseContext.handleFunctionArgument(function, arguments, baseObject);
     if (! acceptArguments(function, arguments))
         return false;
 
-    node = parseContext.handleFunctionCall(idToken.loc, function, arguments);
+    // call
+    node = parseContext.handleFunctionCall(callToken.loc, function, arguments);
 
     return true;
 }
@@ -3258,7 +3374,7 @@ void HlslGrammar::acceptArraySpecifier(TArraySizes*& arraySizes)
         TSourceLoc loc = token.loc;
         TIntermTyped* sizeExpr = nullptr;
 
-        // Array sizing expression is optional.  If ommitted, array will be later sized by initializer list.
+        // Array sizing expression is optional.  If omitted, array will be later sized by initializer list.
         const bool hasArraySize = acceptAssignmentExpression(sizeExpr);
 
         if (! acceptTokenClass(EHTokRightBracket)) {
@@ -3377,7 +3493,7 @@ bool HlslGrammar::acceptPostDecls(TQualifier& qualifier)
                 parseContext.handleRegister(registerDesc.loc, qualifier, profile.string, *registerDesc.string, subComponent, spaceDesc.string);
             } else {
                 // semantic, in idToken.string
-                parseContext.handleSemantic(idToken.loc, qualifier, *idToken.string);
+                parseContext.handleSemantic(idToken.loc, qualifier, mapSemantic(*idToken.string));
             }
         } else if (peekTokenClass(EHTokLeftAngle)) {
             found = true;

+ 9 - 5
3rdparty/glslang/hlsl/hlslGrammar.h

@@ -65,14 +65,15 @@ namespace glslang {
         bool acceptIdentifier(HlslToken&);
         bool acceptCompilationUnit();
         bool acceptDeclaration(TIntermNode*&);
-        bool acceptDeclaration(TIntermNode*& node1, TIntermNode*& node2);
         bool acceptControlDeclaration(TIntermNode*& node);
         bool acceptSamplerDeclarationDX9(TType&);
         bool acceptSamplerState();
         bool acceptFullySpecifiedType(TType&);
+        bool acceptFullySpecifiedType(TType&, TIntermNode*& nodeList);
         bool acceptQualifier(TQualifier&);
         bool acceptLayoutQualifierList(TQualifier&);
         bool acceptType(TType&);
+        bool acceptType(TType&, TIntermNode*& nodeList);
         bool acceptTemplateVecMatBasicType(TBasicType&);
         bool acceptVectorTemplateType(TType&);
         bool acceptMatrixTemplateType(TType&);
@@ -84,11 +85,13 @@ namespace glslang {
         bool acceptSamplerType(TType&);
         bool acceptTextureType(TType&);
         bool acceptStructBufferType(TType&);
-        bool acceptStruct(TType&);
-        bool acceptStructDeclarationList(TTypeList*&);
+        bool acceptStruct(TType&, TIntermNode*& nodeList);
+        bool acceptStructDeclarationList(TTypeList*&, TIntermNode*& nodeList, const TString& typeName);
+        bool acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TString& typeName,
+                                            const TType&, const TString& memberName);
         bool acceptFunctionParameters(TFunction&);
         bool acceptParameterDeclaration(TFunction&);
-        bool acceptFunctionDefinition(TFunction&, TIntermNode*& node1, TIntermNode*& node2, const TAttributeMap&);
+        bool acceptFunctionDefinition(TFunction&, TIntermNode*& nodeList, const TAttributeMap&);
         bool acceptParenExpression(TIntermTyped*&);
         bool acceptExpression(TIntermTyped*&);
         bool acceptInitializer(TIntermTyped*&);
@@ -98,7 +101,8 @@ namespace glslang {
         bool acceptUnaryExpression(TIntermTyped*&);
         bool acceptPostfixExpression(TIntermTyped*&);
         bool acceptConstructor(TIntermTyped*&);
-        bool acceptFunctionCall(HlslToken, TIntermTyped*&, TIntermTyped* base = nullptr);
+        bool acceptFunctionCall(HlslToken, TIntermTyped*&, TIntermTyped* objectBase = nullptr,
+                                const TSymbol* typeBase = nullptr);
         bool acceptArguments(TFunction*, TIntermTyped*&);
         bool acceptLiteral(TIntermTyped*&);
         bool acceptCompoundStatement(TIntermNode*&);

+ 2 - 0
3rdparty/glslang/hlsl/hlslOpMap.cpp

@@ -118,6 +118,8 @@ TOperator HlslOpMap::postUnary(EHlslTokenClass op)
     case EHTokIncOp:       return EOpPostIncrement;
     case EHTokDecOp:       return EOpPostDecrement;
 
+    case EHTokColonColon:  return EOpScoping;
+
     default:               return EOpNull;             // means not a post-unary op
     }
 }

+ 122 - 236
3rdparty/glslang/hlsl/hlslParseHelper.cpp

@@ -805,36 +805,6 @@ TIntermTyped* HlslParseContext::handleUnaryMath(const TSourceLoc& loc, const cha
 
     return childNode;
 }
-
-//
-// Return true if the name is a sampler method
-//
-bool HlslParseContext::isSamplerMethod(const TString& name) const
-{
-    return
-        name == "CalculateLevelOfDetail"          ||
-        name == "CalculateLevelOfDetailUnclamped" ||
-        name == "Gather"                          ||
-        name == "GatherRed"                       ||
-        name == "GatherGreen"                     ||
-        name == "GatherBlue"                      ||
-        name == "GatherAlpha"                     ||
-        name == "GatherCmp"                       ||
-        name == "GatherCmpRed"                    ||
-        name == "GatherCmpGreen"                  ||
-        name == "GatherCmpBlue"                   ||
-        name == "GatherCmpAlpha"                  ||
-        name == "GetDimensions"                   ||
-        name == "GetSamplePosition"               ||
-        name == "Load"                            ||
-        name == "Sample"                          ||
-        name == "SampleBias"                      ||
-        name == "SampleCmp"                       ||
-        name == "SampleCmpLevelZero"              ||
-        name == "SampleGrad"                      ||
-        name == "SampleLevel";
-}
-
 //
 // Return true if the name is a struct buffer method
 //
@@ -862,47 +832,18 @@ bool HlslParseContext::isStructBufferMethod(const TString& name) const
 }
 
 //
-// Handle seeing a base.field dereference in the grammar.
+// Handle seeing a base.field dereference in the grammar, where 'field' is a
+// swizzle or member variable.
 //
 TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TIntermTyped* base, const TString& field)
 {
     variableCheck(base);
 
-    //
-    // methods can't be resolved until we later see the function-calling syntax.
-    // Save away the name in the AST for now.  Processing is completed in
-    // handleLengthMethod(), etc.
-    //
-    if (field == "length") {
-        return intermediate.addMethod(base, TType(EbtInt), &field, loc);
-    } else if (isSamplerMethod(field) && base->getType().getBasicType() == EbtSampler) {
-        // If it's not a method on a sampler object, we fall through to let other objects have a go.
-        const TSampler& sampler = base->getType().getSampler();
-        if (! sampler.isPureSampler()) {
-            const int vecSize = sampler.isShadow() ? 1 : 4; // TODO: handle arbitrary sample return sizes
-            return intermediate.addMethod(base, TType(sampler.type, EvqTemporary, vecSize), &field, loc);
-        }
-    } else if (isStructBufferType(base->getType())) {
-        TType retType(base->getType(), 0);
-        return intermediate.addMethod(base, retType, &field, loc);
-    } else if (field == "Append" ||
-               field == "RestartStrip") {
-        // We cannot check the type here: it may be sanitized if we're not compiling a geometry shader, but
-        // the code is around in the shader source.
-        return intermediate.addMethod(base, TType(EbtVoid), &field, loc);
-    }
-
-    // It's not .length() if we get to here.
-
     if (base->isArray()) {
         error(loc, "cannot apply to an array:", ".", field.c_str());
-
         return base;
     }
 
-    // It's neither an array nor .length() if we get here,
-    // leaving swizzles and struct/block dereferences.
-
     TIntermTyped* result = base;
     if (base->isVector() || base->isScalar()) {
         TSwizzleSelectors<TVectorSelector> selectors;
@@ -1011,6 +952,30 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt
     return result;
 }
 
+//
+// Return true if the field should be treated as a built-in method.
+// Return false otherwise.
+//
+bool HlslParseContext::isBuiltInMethod(const TSourceLoc& loc, TIntermTyped* base, const TString& field)
+{
+    if (base == nullptr)
+        return false;
+
+    variableCheck(base);
+
+    if (base->getType().getBasicType() == EbtSampler) {
+        return true;
+    } else if (isStructBufferType(base->getType()) && isStructBufferMethod(field)) {
+        return true;
+    } else if (field == "Append" ||
+               field == "RestartStrip") {
+        // We cannot check the type here: it may be sanitized if we're not compiling a geometry shader, but
+        // the code is around in the shader source.
+        return true;
+    } else
+        return false;
+}
+
 // Split the type of the given node into two structs:
 //   1. interstage IO
 //   2. everything else
@@ -1439,12 +1404,7 @@ void HlslParseContext::assignLocations(TVariable& variable)
             assignLocation(**member);
     } else if (wasSplit(variable.getUniqueId())) {
         TVariable* splitIoVar = getSplitIoVar(&variable);
-        const TTypeList* structure = splitIoVar->getType().getStruct();
-        // Struct splitting can produce empty structures if the only members of the
-        // struct were builtin interstage IO types.  Only assign locations if it
-        // isn't a struct, or is a non-empty struct.
-        if (structure == nullptr || !structure->empty())
-            assignLocation(*splitIoVar);
+        assignLocation(*splitIoVar);
     } else {
         assignLocation(variable);
     }
@@ -1521,6 +1481,8 @@ void HlslParseContext::addInterstageIoToLinkage()
 // Handle seeing the function prototype in front of a function definition in the grammar.
 // The body is handled after this function returns.
 //
+// Returns an aggregate of parameter-symbol nodes.
+//
 TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function,
                                                              const TAttributeMap& attributes, TIntermNode*& entryPointTree)
 {
@@ -1885,7 +1847,7 @@ void HlslParseContext::remapEntryPointIO(TFunction& function, TVariable*& return
 {
     // Do the actual work to make a type be a shader input or output variable,
     // and clear the original to be non-IO (for use as a normal function parameter/return).
-    const auto makeIoVariable = [this](const char* name, TType& type, TStorageQualifier storage) {
+    const auto makeIoVariable = [this](const char* name, TType& type, TStorageQualifier storage) -> TVariable* {
         TVariable* ioVariable = makeInternalVariable(name, type);
         clearUniformInputOutput(type.getQualifier());
         if (type.getStruct() != nullptr) {
@@ -2071,7 +2033,7 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
 
         if (split && derefType.isBuiltInInterstageIO(language)) {
             // copy from interstage IO builtin if needed
-            subTree = intermediate.addSymbol(*interstageBuiltInIo.find(tInterstageIoData(derefType, outer->getType()))->second);
+            subTree = intermediate.addSymbol(*interstageBuiltInIo.find(HlslParseContext::tInterstageIoData(derefType, outer->getType()))->second);
 
             // Arrayness of builtIn symbols isn't handled by the normal recursion: it's been extracted and moved to the builtin.
             if (subTree->getType().isArray() && !arrayElement.empty()) {
@@ -2701,6 +2663,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
             const TSampler& sampler = texType.getSampler();
             const TSamplerDim dim = sampler.dim;
             const bool isImage = sampler.isImage();
+            const bool isMs = sampler.isMultiSample();
             const int numArgs = (int)argAggregate->getSequence().size();
 
             int numDims = 0;
@@ -2711,6 +2674,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
             case Esd3D:     numDims = 3; break; // W, H, D
             case EsdCube:   numDims = 2; break; // W, H (cube)
             case EsdBuffer: numDims = 1; break; // W (buffers)
+            case EsdRect:   numDims = 2; break; // W, H (rect)
             default:
                 assert(0 && "unhandled texture dimension");
             }
@@ -2719,17 +2683,31 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
             if (sampler.isArrayed())
                 ++numDims;
 
-            // Establish whether we're querying mip levels
-            const bool mipQuery = (numArgs > (numDims + 1)) && (!sampler.isMultiSample());
+            // Establish whether the method itself is querying mip levels.  This can be false even
+            // if the underlying query requires a MIP level, due to the available HLSL method overloads.
+            const bool mipQuery = (numArgs > (numDims + 1 + (isMs ? 1 : 0)));
+
+            // Establish whether we must use the LOD form of query (even if the method did not supply a mip level to query).
+            // True if:
+            //   1. 1D/2D/3D/Cube AND multisample==0 AND NOT image (those can be sent to the non-LOD query)
+            // or,
+            //   2. There is a LOD (because the non-LOD query cannot be used in that case, per spec)
+            const bool mipRequired =
+                ((dim == Esd1D || dim == Esd2D || dim == Esd3D || dim == EsdCube) && !isMs && !isImage) || // 1...
+                mipQuery; // 2...
 
             // AST assumes integer return.  Will be converted to float if required.
             TIntermAggregate* sizeQuery = new TIntermAggregate(isImage ? EOpImageQuerySize : EOpTextureQuerySize);
             sizeQuery->getSequence().push_back(argTex);
-            // If we're querying an explicit LOD, add the LOD, which is always arg #1
-            if (mipQuery) {
-                TIntermTyped* queryLod = argAggregate->getSequence()[1]->getAsTyped();
+
+            // If we're building an LOD query, add the LOD.
+            if (mipRequired) {
+                // If the base HLSL query had no MIP level given, use level 0.
+                TIntermTyped* queryLod = mipQuery ? argAggregate->getSequence()[1]->getAsTyped() :
+                    intermediate.addConstantUnion(0, loc, true);
                 sizeQuery->getSequence().push_back(queryLod);
             }
+
             sizeQuery->setType(TType(EbtUint, EvqTemporary, numDims));
             sizeQuery->setLoc(loc);
 
@@ -3020,8 +2998,10 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
             // For now, we have nothing to map the component-wise comparison forms
             // to, because neither GLSL nor SPIR-V has such an opcode.  Issue an
             // unimplemented error instead.  Most of the machinery is here if that
-            // should ever become available.
-            if (cmpValues) {
+            // should ever become available.  However, red can be passed through
+            // to OpImageDrefGather.  G/B/A cannot, because that opcode does not
+            // accept a component.
+            if (cmpValues != 0 && op != EOpMethodGatherCmpRed) {
                 error(loc, "unimplemented: component-level gather compare", "", "");
                 return;
             }
@@ -3102,7 +3082,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
             }
 
             // Add comparison value if we have one
-            if (argTex->getType().getSampler().isShadow())
+            if (argCmp != nullptr)
                 txgather->getSequence().push_back(argCmp);
 
             // Add offset (either 1, or an array of 4) if we have one
@@ -3732,9 +3712,7 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct
     TIntermTyped* result = nullptr;
 
     TOperator op = function->getBuiltInOp();
-    if (op == EOpArrayLength)
-        result = handleLengthMethod(loc, function, arguments);
-    else if (op != EOpNull) {
+    if (op != EOpNull) {
         //
         // Then this should be a constructor.
         // Don't go through the symbol table for constructors.
@@ -3848,41 +3826,6 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct
     return result;
 }
 
-// Finish processing object.length(). This started earlier in handleDotDereference(), where
-// the ".length" part was recognized and semantically checked, and finished here where the
-// function syntax "()" is recognized.
-//
-// Return resulting tree node.
-TIntermTyped* HlslParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction* function, TIntermNode* intermNode)
-{
-    int length = 0;
-
-    if (function->getParamCount() > 0)
-        error(loc, "method does not accept any arguments", function->getName().c_str(), "");
-    else {
-        const TType& type = intermNode->getAsTyped()->getType();
-        if (type.isArray()) {
-            if (type.isRuntimeSizedArray()) {
-                // Create a unary op and let the back end handle it
-                return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt));
-            } else
-                length = type.getOuterArraySize();
-        } else if (type.isMatrix())
-            length = type.getMatrixCols();
-        else if (type.isVector())
-            length = type.getVectorSize();
-        else {
-            // we should not get here, because earlier semantic checking should have prevented this path
-            error(loc, ".length()", "unexpected use of .length()", "");
-        }
-    }
-
-    if (length == 0)
-        length = 1;
-
-    return intermediate.addConstantUnion(length, loc);
-}
-
 //
 // Add any needed implicit conversions for function-call arguments to input parameters.
 //
@@ -4206,118 +4149,23 @@ TFunction* HlslParseContext::handleConstructorCall(const TSourceLoc& loc, const
 // Handle seeing a "COLON semantic" at the end of a type declaration,
 // by updating the type according to the semantic.
 //
-void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, const TString& semantic)
-{
-    // TODO: need to know if it's an input or an output
-    // The following sketches what needs to be done, but can't be right
-    // without taking into account stage and input/output.
-
-    TString semanticUpperCase = semantic;
-    std::transform(semanticUpperCase.begin(), semanticUpperCase.end(), semanticUpperCase.begin(), ::toupper);
-    // in DX9, all outputs had to have a semantic associated with them, that was either consumed
-    // by the system or was a specific register assignment
-    // in DX10+, only semantics with the SV_ prefix have any meaning beyond decoration
-    // Fxc will only accept DX9 style semantics in compat mode
-    // Also, in DX10 if a SV value is present as the input of a stage, but isn't appropriate for that
-    // stage, it would just be ignored as it is likely there as part of an output struct from one stage
-    // to the next
-
-    bool bParseDX9 = false;
-    if (bParseDX9) {
-        if (semanticUpperCase == "PSIZE")
-            qualifier.builtIn = EbvPointSize;
-        else if (semantic == "FOG")
-            qualifier.builtIn = EbvFogFragCoord;
-        else if (semanticUpperCase == "DEPTH")
-            qualifier.builtIn = EbvFragDepth;
-        else if (semanticUpperCase == "VFACE")
-            qualifier.builtIn = EbvFace;
-        else if (semanticUpperCase == "VPOS")
-            qualifier.builtIn = EbvFragCoord;
-    }
-
-    // SV Position has a different meaning in vertex vs fragment
-    if (semanticUpperCase == "SV_POSITION" && language != EShLangFragment)
-        qualifier.builtIn = EbvPosition;
-    else if (semanticUpperCase == "SV_POSITION" && language == EShLangFragment)
-        qualifier.builtIn = EbvFragCoord;
-    else if (semanticUpperCase == "SV_CLIPDISTANCE")
-        qualifier.builtIn = EbvClipDistance;
-    else if (semanticUpperCase == "SV_CULLDISTANCE")
-        qualifier.builtIn = EbvCullDistance;
-    else if (semanticUpperCase == "SV_VERTEXID")
-        qualifier.builtIn = EbvVertexIndex;
-    else if (semanticUpperCase == "SV_VIEWPORTARRAYINDEX")
-        qualifier.builtIn = EbvViewportIndex;
-    else if (semanticUpperCase == "SV_TESSFACTOR")
-        qualifier.builtIn = EbvTessLevelOuter;
-
-    // Targets are defined 0-7
-    else if (semanticUpperCase == "SV_TARGET") {
-        qualifier.builtIn = EbvNone;
-        // qualifier.layoutLocation = 0;
-    } else if (semanticUpperCase == "SV_TARGET0") {
-        qualifier.builtIn = EbvNone;
-        // qualifier.layoutLocation = 0;
-    } else if (semanticUpperCase == "SV_TARGET1") {
-        qualifier.builtIn = EbvNone;
-        // qualifier.layoutLocation = 1;
-    } else if (semanticUpperCase == "SV_TARGET2") {
-        qualifier.builtIn = EbvNone;
-        // qualifier.layoutLocation = 2;
-    } else if (semanticUpperCase == "SV_TARGET3") {
-        qualifier.builtIn = EbvNone;
-        // qualifier.layoutLocation = 3;
-    } else if (semanticUpperCase == "SV_TARGET4") {
-        qualifier.builtIn = EbvNone;
-        // qualifier.layoutLocation = 4;
-    } else if (semanticUpperCase == "SV_TARGET5") {
-        qualifier.builtIn = EbvNone;
-        // qualifier.layoutLocation = 5;
-    } else if (semanticUpperCase == "SV_TARGET6") {
-        qualifier.builtIn = EbvNone;
-        // qualifier.layoutLocation = 6;
-    } else if (semanticUpperCase == "SV_TARGET7") {
-        qualifier.builtIn = EbvNone;
-        // qualifier.layoutLocation = 7;
-    } else if (semanticUpperCase == "SV_SAMPLEINDEX")
-        qualifier.builtIn = EbvSampleId;
-    else if (semanticUpperCase == "SV_RENDERTARGETARRAYINDEX")
-        qualifier.builtIn = EbvLayer;
-    else if (semanticUpperCase == "SV_PRIMITIVEID")
-        qualifier.builtIn = EbvPrimitiveId;
-    else if (semanticUpperCase == "SV_OUTPUTCONTROLPOINTID")
-        qualifier.builtIn = EbvInvocationId;
-    else if (semanticUpperCase == "SV_ISFRONTFACE")
-        qualifier.builtIn = EbvFace;
-    else if (semanticUpperCase == "SV_INSTANCEID")
-        qualifier.builtIn = EbvInstanceIndex;
-    else if (semanticUpperCase == "SV_INSIDETESSFACTOR")
-        qualifier.builtIn = EbvTessLevelInner;
-    else if (semanticUpperCase == "SV_GSINSTANCEID")
-        qualifier.builtIn = EbvInvocationId;
-    else if (semanticUpperCase == "SV_DISPATCHTHREADID")
-        qualifier.builtIn = EbvGlobalInvocationId;
-    else if (semanticUpperCase == "SV_GROUPTHREADID")
-        qualifier.builtIn = EbvLocalInvocationId;
-    else if (semanticUpperCase == "SV_GROUPINDEX")
-        qualifier.builtIn = EbvLocalInvocationIndex;
-    else if (semanticUpperCase == "SV_GROUPID")
-        qualifier.builtIn = EbvWorkGroupId;
-    else if (semanticUpperCase == "SV_DOMAINLOCATION")
-        qualifier.builtIn = EbvTessCoord;
-    else if (semanticUpperCase == "SV_DEPTH")
-        qualifier.builtIn = EbvFragDepth;
-    else if( semanticUpperCase == "SV_COVERAGE")
-        qualifier.builtIn = EbvSampleMask;
-
-    // TODO, these need to get refined to be more specific
-    else if( semanticUpperCase == "SV_DEPTHGREATEREQUAL")
-        qualifier.builtIn = EbvFragDepthGreater;
-    else if( semanticUpperCase == "SV_DEPTHLESSEQUAL")
-        qualifier.builtIn = EbvFragDepthLesser;
-    else if( semanticUpperCase == "SV_STENCILREF")
+void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, TBuiltInVariable builtIn)
+{
+    // adjust for stage in/out
+
+    switch(builtIn) {
+    case EbvPosition:
+        if (language == EShLangFragment)
+            builtIn = EbvFragCoord;
+        break;
+    case EbvStencilRef:
         error(loc, "unimplemented; need ARB_shader_stencil_export", "SV_STENCILREF", "");
+        break;
+    default:
+        break;
+    }
+
+    qualifier.builtIn = builtIn;
 }
 
 //
@@ -5223,10 +5071,6 @@ void HlslParseContext::shareStructBufferType(TType& type)
         return compareQualifiers(lhs, rhs) && lhs == rhs;
     };
 
-    // TString typeName;
-    // type.appendMangledName(typeName);
-    // type.setTypeName(typeName);
-
     // This is an exhaustive O(N) search, but real world shaders have
     // only a small number of these.
     for (int idx = 0; idx < int(structBufferTypes.size()); ++idx) {
@@ -5241,8 +5085,6 @@ void HlslParseContext::shareStructBufferType(TType& type)
     TType* typeCopy = new TType;
     typeCopy->shallowCopy(type);
     structBufferTypes.push_back(typeCopy);
-
-    // structBuffTypes.push_back(type.getWritableStruct());
 }
 
 void HlslParseContext::paramFix(TType& type)
@@ -7247,6 +7089,49 @@ TIntermNode* HlslParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* ex
     return switchNode;
 }
 
+// Track levels of class/struct nesting with a prefix string using
+// the type names separated by the scoping operator. E.g., two levels
+// would look like:
+//
+//   outer::inner
+//
+// The string is empty when at normal global level.
+//
+void HlslParseContext::pushThis(const TString& typeName)
+{
+    // make new type prefix
+    TString newPrefix;
+    if (currentTypePrefix.size() > 0) {
+        newPrefix = currentTypePrefix.back();
+        newPrefix.append("::");
+    }
+    newPrefix.append(typeName);
+    currentTypePrefix.push_back(newPrefix);
+}
+
+// Opposite of pushThis(), see above
+void HlslParseContext::popThis()
+{
+    currentTypePrefix.pop_back();
+}
+
+// Use the class/struct nesting string to create a global name for
+// a member of a class/struct.  Static members use "::" for the final
+// step, while non-static members use ".".
+TString* HlslParseContext::getFullMemberFunctionName(const TString& memberName, bool isStatic) const
+{
+    TString* name = NewPoolTString("");
+    if (currentTypePrefix.size() > 0)
+        name->append(currentTypePrefix.back());
+    if (isStatic)
+        name->append("::");
+    else
+        name->append(".");
+    name->append(memberName);
+
+    return name;
+}
+
 // Potentially rename shader entry point function
 void HlslParseContext::renameShaderFunction(TString*& name) const
 {
@@ -7493,9 +7378,9 @@ void HlslParseContext::addPatchConstantInvocation()
             const TStorageQualifier storage = function[p].type->getQualifier().storage;
 
             if (function[p].declaredBuiltIn != EbvNone)
-                builtIns.insert(tInterstageIoData(function[p].declaredBuiltIn, storage));
+                builtIns.insert(HlslParseContext::tInterstageIoData(function[p].declaredBuiltIn, storage));
             else
-                builtIns.insert(tInterstageIoData(function[p].type->getQualifier().builtIn, storage));
+                builtIns.insert(HlslParseContext::tInterstageIoData(function[p].type->getQualifier().builtIn, storage));
         }
     };
 
@@ -7581,8 +7466,9 @@ void HlslParseContext::addPatchConstantInvocation()
 
         notInEntryPoint = pcfBuiltIns;
 
-        for (auto bi : epfBuiltIns) // std::set_difference not usable on unordered containers
-            notInEntryPoint.erase(bi);
+        // std::set_difference not usable on unordered containers
+        for (auto bi = epfBuiltIns.begin(); bi != epfBuiltIns.end(); ++bi)
+            notInEntryPoint.erase(*bi);
 
         // Now we'll add those to the entry and to the linkage.
         for (int p=0; p<pcfParamCount; ++p) {

+ 7 - 3
3rdparty/glslang/hlsl/hlslParseHelper.h

@@ -70,6 +70,7 @@ public:
     TIntermTyped* handleBinaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right);
     TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode);
     TIntermTyped* handleDotDereference(const TSourceLoc&, TIntermTyped* base, const TString& field);
+    bool isBuiltInMethod(const TSourceLoc&, TIntermTyped* base, const TString& field);
     void assignLocations(TVariable& variable);
     TFunction& handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype);
     TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&, const TAttributeMap&, TIntermNode*& entryPointTree);
@@ -86,12 +87,11 @@ public:
     void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
     void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
     void decomposeGeometryMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
-    TIntermTyped* handleLengthMethod(const TSourceLoc&, TFunction*, TIntermNode*);
     void addInputArgumentConversions(const TFunction&, TIntermTyped*&);
     TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermOperator&);
     void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&);
     TFunction* handleConstructorCall(const TSourceLoc&, const TType&);
-    void handleSemantic(TSourceLoc, TQualifier&, const TString& semantic);
+    void handleSemantic(TSourceLoc, TQualifier&, TBuiltInVariable);
     void handlePackOffset(const TSourceLoc&, TQualifier&, const glslang::TString& location,
                           const glslang::TString* component);
     void handleRegister(const TSourceLoc&, TQualifier&, const glslang::TString* profile, const glslang::TString& desc,
@@ -160,6 +160,10 @@ public:
     void pushScope()         { symbolTable.push(); }
     void popScope()          { symbolTable.pop(0); }
 
+    void pushThis(const TString& name);
+    void popThis();
+    TString* getFullMemberFunctionName(const TString& name, bool isStatic) const;
+
     void pushSwitchSequence(TIntermSequence* sequence) { switchSequenceStack.push_back(sequence); }
     void popSwitchSequence() { switchSequenceStack.pop_back(); }
 
@@ -249,7 +253,6 @@ protected:
     void clearUniformInputOutput(TQualifier& qualifier);
 
     // Test method names
-    bool isSamplerMethod(const TString& name) const;
     bool isStructBufferMethod(const TString& name) const;
 
     TType* getStructBufferContentType(const TType& type) const;
@@ -383,6 +386,7 @@ protected:
     TString patchConstantFunctionName; // hull shader patch constant function name, from function level attribute.
     TMap<TBuiltInVariable, TSymbol*> builtInLinkageSymbols; // used for tessellation, finding declared builtins
 
+    TVector<TString> currentTypePrefix;
 };
 
 } // end namespace glslang

+ 85 - 2
3rdparty/glslang/hlsl/hlslScanContext.cpp

@@ -47,7 +47,6 @@
 #include "../glslang/MachineIndependent/ParseHelper.h"
 #include "hlslScanContext.h"
 #include "hlslTokens.h"
-//#include "Scan.h"
 
 // preprocessor includes
 #include "../glslang/MachineIndependent/preprocessor/PpContext.h"
@@ -82,6 +81,7 @@ struct str_hash
 // After a single process-level initialization, this is read only and thread safe
 std::unordered_map<const char*, glslang::EHlslTokenClass, str_hash, str_eq>* KeywordMap = nullptr;
 std::unordered_set<const char*, str_hash, str_eq>* ReservedSet = nullptr;
+std::unordered_map<const char*, glslang::TBuiltInVariable, str_hash, str_eq>* SemanticMap = nullptr;
 
 };
 
@@ -381,6 +381,73 @@ void HlslScanContext::fillInKeywordMap()
     ReservedSet->insert("unsigned");
     ReservedSet->insert("using");
     ReservedSet->insert("virtual");
+
+    SemanticMap = new std::unordered_map<const char*, glslang::TBuiltInVariable, str_hash, str_eq>;
+
+    // in DX9, all outputs had to have a semantic associated with them, that was either consumed
+    // by the system or was a specific register assignment
+    // in DX10+, only semantics with the SV_ prefix have any meaning beyond decoration
+    // Fxc will only accept DX9 style semantics in compat mode
+    // Also, in DX10 if a SV value is present as the input of a stage, but isn't appropriate for that
+    // stage, it would just be ignored as it is likely there as part of an output struct from one stage
+    // to the next
+    bool bParseDX9 = false;
+    if (bParseDX9) {
+        (*SemanticMap)["PSIZE"] = EbvPointSize;
+        (*SemanticMap)["FOG"] =   EbvFogFragCoord;
+        (*SemanticMap)["DEPTH"] = EbvFragDepth;
+        (*SemanticMap)["VFACE"] = EbvFace;
+        (*SemanticMap)["VPOS"] =  EbvFragCoord;
+    }
+
+    (*SemanticMap)["SV_POSITION"] =               EbvPosition;
+    (*SemanticMap)["SV_CLIPDISTANCE"] =           EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE0"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE1"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE2"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE3"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE4"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE5"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE6"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE7"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE8"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE9"] =          EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE10"] =         EbvClipDistance;
+    (*SemanticMap)["SV_CLIPDISTANCE11"] =         EbvClipDistance;
+    (*SemanticMap)["SV_CULLDISTANCE"] =           EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE0"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE1"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE2"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE3"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE4"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE5"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE6"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE7"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE8"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE9"] =          EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE10"] =         EbvCullDistance;
+    (*SemanticMap)["SV_CULLDISTANCE11"] =         EbvCullDistance;
+    (*SemanticMap)["SV_VERTEXID"] =               EbvVertexIndex;
+    (*SemanticMap)["SV_VIEWPORTARRAYINDEX"] =     EbvViewportIndex;
+    (*SemanticMap)["SV_TESSFACTOR"] =             EbvTessLevelOuter;
+    (*SemanticMap)["SV_SAMPLEINDEX"] =            EbvSampleId;
+    (*SemanticMap)["SV_RENDERTARGETARRAYINDEX"] = EbvLayer;
+    (*SemanticMap)["SV_PRIMITIVEID"] =            EbvPrimitiveId;
+    (*SemanticMap)["SV_OUTPUTCONTROLPOINTID"] =   EbvInvocationId;
+    (*SemanticMap)["SV_ISFRONTFACE"] =            EbvFace;
+    (*SemanticMap)["SV_INSTANCEID"] =             EbvInstanceIndex;
+    (*SemanticMap)["SV_INSIDETESSFACTOR"] =       EbvTessLevelInner;
+    (*SemanticMap)["SV_GSINSTANCEID"] =           EbvInvocationId;
+    (*SemanticMap)["SV_DISPATCHTHREADID"] =       EbvGlobalInvocationId;
+    (*SemanticMap)["SV_GROUPTHREADID"] =          EbvLocalInvocationId;
+    (*SemanticMap)["SV_GROUPINDEX"] =             EbvLocalInvocationIndex;
+    (*SemanticMap)["SV_GROUPID"] =                EbvWorkGroupId;
+    (*SemanticMap)["SV_DOMAINLOCATION"] =         EbvTessCoord;
+    (*SemanticMap)["SV_DEPTH"] =                  EbvFragDepth;
+    (*SemanticMap)["SV_COVERAGE"] =               EbvSampleMask;
+    (*SemanticMap)["SV_DEPTHGREATEREQUAL"] =      EbvFragDepthGreater;
+    (*SemanticMap)["SV_DEPTHLESSEQUAL"] =         EbvFragDepthLesser;
+    (*SemanticMap)["SV_STENCILREF"] =             EbvStencilRef;
 }
 
 void HlslScanContext::deleteKeywordMap()
@@ -389,15 +456,29 @@ void HlslScanContext::deleteKeywordMap()
     KeywordMap = nullptr;
     delete ReservedSet;
     ReservedSet = nullptr;
+    delete SemanticMap;
+    SemanticMap = nullptr;
 }
 
-// Wrapper for tokenizeClass()"] =  to get everything inside the token.
+// Wrapper for tokenizeClass() to get everything inside the token.
 void HlslScanContext::tokenize(HlslToken& token)
 {
     EHlslTokenClass tokenClass = tokenizeClass(token);
     token.tokenClass = tokenClass;
 }
 
+glslang::TBuiltInVariable HlslScanContext::mapSemantic(const TString& semantic)
+{
+    TString semanticUpperCase = semantic;
+    std::transform(semanticUpperCase.begin(), semanticUpperCase.end(), semanticUpperCase.begin(), ::toupper);
+
+    auto it = SemanticMap->find(semanticUpperCase.c_str());
+    if (it != SemanticMap->end())
+        return it->second;
+    else
+        return glslang::EbvNone;
+}
+
 //
 // Fill in token information for the next token, except for the token class.
 // Returns the enum value of the token class of the next token found.
@@ -471,6 +552,8 @@ EHlslTokenClass HlslScanContext::tokenizeClass(HlslToken& token)
         case PpAtomDecrement:          return EHTokDecOp;
         case PpAtomIncrement:          return EHTokIncOp;
 
+        case PpAtomColonColon:         return EHTokColonColon;
+
         case PpAtomConstInt:           parserToken->i = ppToken.ival;       return EHTokIntConstant;
         case PpAtomConstUint:          parserToken->i = ppToken.ival;       return EHTokUintConstant;
         case PpAtomConstFloat:         parserToken->d = ppToken.dval;       return EHTokFloatConstant;

+ 1 - 0
3rdparty/glslang/hlsl/hlslScanContext.h

@@ -82,6 +82,7 @@ public:
     static void deleteKeywordMap();
 
     void tokenize(HlslToken&);
+    glslang::TBuiltInVariable mapSemantic(const TString& semantic);
 
 protected:
     HlslScanContext(HlslScanContext&);

+ 1 - 0
3rdparty/glslang/hlsl/hlslTokenStream.h

@@ -52,6 +52,7 @@ namespace glslang {
         bool acceptTokenClass(EHlslTokenClass);
         EHlslTokenClass peek() const;
         bool peekTokenClass(EHlslTokenClass) const;
+        glslang::TBuiltInVariable mapSemantic(const TString& semantic) { return scanner.mapSemantic(semantic); }
 
     protected:
         HlslToken token;                  // the token we are currently looking at, but have not yet accepted

+ 1 - 1
3rdparty/glslang/hlsl/hlslTokens.h

@@ -267,7 +267,6 @@ enum EHlslTokenClass {
 
     // variable, user type, ...
     EHTokIdentifier,
-    EHTokTypeName,
     EHTokClass,
     EHTokStruct,
     EHTokCBuffer,
@@ -328,6 +327,7 @@ enum EHlslTokenClass {
     EHTokDot,
     EHTokComma,
     EHTokColon,
+    EHTokColonColon,
     EHTokSemicolon,
     EHTokBang,
     EHTokDash,