Explorar el Código

Updated glslang.

Branimir Karadžić hace 8 años
padre
commit
4ee3b81c61
Se han modificado 61 ficheros con 4361 adiciones y 1887 borrados
  1. 8 6
      3rdparty/glslang/SPIRV/GlslangToSpv.cpp
  2. 2 1
      3rdparty/glslang/SPIRV/doc.cpp
  3. 25 1
      3rdparty/glslang/StandAlone/StandAlone.cpp
  4. 3 3
      3rdparty/glslang/Test/400.frag
  5. 1 1
      3rdparty/glslang/Test/baseResults/100.frag.out
  6. 1 1
      3rdparty/glslang/Test/baseResults/120.frag.out
  7. 1 1
      3rdparty/glslang/Test/baseResults/300.frag.out
  8. 26 1
      3rdparty/glslang/Test/baseResults/400.frag.out
  9. 1 1
      3rdparty/glslang/Test/baseResults/badChars.frag.out
  10. 1 1
      3rdparty/glslang/Test/baseResults/cppBad.vert.out
  11. 1 1
      3rdparty/glslang/Test/baseResults/cppIndent.vert.out
  12. 1 1
      3rdparty/glslang/Test/baseResults/glspv.frag.out
  13. 1 1
      3rdparty/glslang/Test/baseResults/glspv.vert.out
  14. 29 0
      3rdparty/glslang/Test/baseResults/hlsl.automap.frag.out
  15. 21 8
      3rdparty/glslang/Test/baseResults/hlsl.buffer.frag.out
  16. 731 582
      3rdparty/glslang/Test/baseResults/hlsl.conditional.frag.out
  17. 168 64
      3rdparty/glslang/Test/baseResults/hlsl.doLoop.frag.out
  18. 6 4
      3rdparty/glslang/Test/baseResults/hlsl.implicitBool.frag.out
  19. 15 12
      3rdparty/glslang/Test/baseResults/hlsl.layout.frag.out
  20. 96 0
      3rdparty/glslang/Test/baseResults/hlsl.samplecmp.negative.frag.out
  21. 80 0
      3rdparty/glslang/Test/baseResults/hlsl.samplecmp.negative2.frag.out
  22. 173 44
      3rdparty/glslang/Test/baseResults/hlsl.shapeConv.frag.out
  23. 223 0
      3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out
  24. 326 0
      3rdparty/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out
  25. 243 0
      3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out
  26. 323 0
      3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out
  27. 1 1
      3rdparty/glslang/Test/baseResults/lineContinuation.vert.out
  28. 80 76
      3rdparty/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out
  29. 68 0
      3rdparty/glslang/Test/baseResults/spv.storageBuffer.vert.out
  30. 1 1
      3rdparty/glslang/Test/baseResults/syntaxError.frag.out
  31. 57 0
      3rdparty/glslang/Test/hlsl.automap.frag
  32. 9 2
      3rdparty/glslang/Test/hlsl.conditional.frag
  33. 5 2
      3rdparty/glslang/Test/hlsl.doLoop.frag
  34. 12 0
      3rdparty/glslang/Test/hlsl.samplecmp.negative.frag
  35. 10 0
      3rdparty/glslang/Test/hlsl.samplecmp.negative2.frag
  36. 15 0
      3rdparty/glslang/Test/hlsl.shapeConv.frag
  37. 11 0
      3rdparty/glslang/Test/hlsl.structbuffer.append.frag
  38. 19 0
      3rdparty/glslang/Test/hlsl.structbuffer.floatidx.comp
  39. 15 0
      3rdparty/glslang/Test/hlsl.structbuffer.fn2.comp
  40. 19 0
      3rdparty/glslang/Test/hlsl.structbuffer.incdec.frag
  41. 2 1
      3rdparty/glslang/Test/runtests
  42. 16 0
      3rdparty/glslang/Test/spv.storageBuffer.vert
  43. 7 0
      3rdparty/glslang/glslang/Include/BaseTypes.h
  44. 4 0
      3rdparty/glslang/glslang/Include/intermediate.h
  45. 153 26
      3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
  46. 4 0
      3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
  47. 13 0
      3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
  48. 2 0
      3rdparty/glslang/glslang/MachineIndependent/glslang.y
  49. 432 590
      3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
  50. 308 321
      3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
  51. 234 77
      3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
  52. 16 2
      3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
  53. 15 0
      3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
  54. 12 2
      3rdparty/glslang/glslang/MachineIndependent/reflection.h
  55. 4 0
      3rdparty/glslang/glslang/Public/ShaderLang.h
  56. 6 0
      3rdparty/glslang/gtests/Hlsl.FromFile.cpp
  57. 1 0
      3rdparty/glslang/gtests/Spv.FromFile.cpp
  58. 26 18
      3rdparty/glslang/hlsl/hlslGrammar.cpp
  59. 258 34
      3rdparty/glslang/hlsl/hlslParseHelper.cpp
  60. 13 0
      3rdparty/glslang/hlsl/hlslParseHelper.h
  61. 7 0
      3rdparty/glslang/hlsl/hlslParseables.cpp

+ 8 - 6
3rdparty/glslang/SPIRV/GlslangToSpv.cpp

@@ -245,7 +245,7 @@ spv::ExecutionModel TranslateExecutionModel(EShLanguage stage)
 }
 
 // Translate glslang type to SPIR-V storage class.
-spv::StorageClass TranslateStorageClass(const glslang::TType& type)
+spv::StorageClass TranslateStorageClass(const glslang::TType& type, bool useStorageBuffer)
 {
     if (type.getQualifier().isPipeInput())
         return spv::StorageClassInput;
@@ -255,6 +255,8 @@ spv::StorageClass TranslateStorageClass(const glslang::TType& type)
         return spv::StorageClassAtomicCounter;
     else if (type.containsOpaque())
         return spv::StorageClassUniformConstant;
+    else if (useStorageBuffer && type.getQualifier().storage == glslang::EvqBuffer)
+        return spv::StorageClassStorageBuffer;
     else if (type.getQualifier().isUniformOrBuffer()) {
         if (type.getQualifier().layoutPushConstant)
             return spv::StorageClassPushConstant;
@@ -310,12 +312,12 @@ spv::Decoration TranslatePrecisionDecoration(const glslang::TType& type)
 }
 
 // Translate glslang type to SPIR-V block decorations.
-spv::Decoration TranslateBlockDecoration(const glslang::TType& type)
+spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useStorageBuffer)
 {
     if (type.getBasicType() == glslang::EbtBlock) {
         switch (type.getQualifier().storage) {
         case glslang::EvqUniform:      return spv::DecorationBlock;
-        case glslang::EvqBuffer:       return spv::DecorationBufferBlock;
+        case glslang::EvqBuffer:       return useStorageBuffer ? spv::DecorationBlock : spv::DecorationBufferBlock;
         case glslang::EvqVaryingIn:    return spv::DecorationBlock;
         case glslang::EvqVaryingOut:   return spv::DecorationBlock;
         default:
@@ -2071,7 +2073,7 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
     }
 
     // Now, handle actual variables
-    spv::StorageClass storageClass = TranslateStorageClass(node->getType());
+    spv::StorageClass storageClass = TranslateStorageClass(node->getType(), glslangIntermediate->usingStorageBuffer());
     spv::Id spvType = convertGlslangToSpvType(node->getType());
 
 #ifdef AMD_EXTENSIONS
@@ -2491,7 +2493,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
 
     // Decorate the structure
     addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix));
-    addDecoration(spvType, TranslateBlockDecoration(type));
+    addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer()));
     if (type.getQualifier().hasStream() && glslangIntermediate->isMultiStream()) {
         builder.addCapability(spv::CapabilityGeometryStreams);
         builder.addDecoration(spvType, spv::DecorationStream, type.getQualifier().layoutStream);
@@ -2834,7 +2836,7 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
                 (paramType.getBasicType() == glslang::EbtBlock &&
                  paramType.getQualifier().storage == glslang::EvqBuffer) ||  // SSBO
                 (p == 0 && implicitThis))                                    // implicit 'this'
-                typeId = builder.makePointer(TranslateStorageClass(paramType), typeId);
+                typeId = builder.makePointer(TranslateStorageClass(paramType, glslangIntermediate->usingStorageBuffer()), typeId);
             else if (paramType.getQualifier().storage != glslang::EvqConstReadOnly)
                 typeId = builder.makePointer(spv::StorageClassFunction, typeId);
             else

+ 2 - 1
3rdparty/glslang/SPIRV/doc.cpp

@@ -180,7 +180,7 @@ const char* ExecutionModeString(int mode)
     }
 }
 
-const int StorageClassCeiling = 12;
+const int StorageClassCeiling = 13;
 
 const char* StorageClassString(int StorageClass)
 {
@@ -197,6 +197,7 @@ const char* StorageClassString(int StorageClass)
     case 9:  return "PushConstant";
     case 10: return "AtomicCounter";
     case 11: return "Image";
+    case 12: return "StorageBuffer";
 
     case StorageClassCeiling:
     default: return "Bad";

+ 25 - 1
3rdparty/glslang/StandAlone/StandAlone.cpp

@@ -87,6 +87,7 @@ enum TOptions {
     EOptionNoStorageFormat      = (1 << 21),
     EOptionKeepUncalled         = (1 << 22),
     EOptionHlslOffsets          = (1 << 23),
+    EOptionHlslIoMapping        = (1 << 24),
 };
 
 //
@@ -166,6 +167,7 @@ std::array<unsigned int, EShLangCount> baseTextureBinding;
 std::array<unsigned int, EShLangCount> baseImageBinding;
 std::array<unsigned int, EShLangCount> baseUboBinding;
 std::array<unsigned int, EShLangCount> baseSsboBinding;
+std::array<unsigned int, EShLangCount> baseUavBinding;
 
 //
 // Create the default name for saving a binary if -o is not provided.
@@ -256,6 +258,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
     baseImageBinding.fill(0);
     baseUboBinding.fill(0);
     baseSsboBinding.fill(0);
+    baseUavBinding.fill(0);
 
     ExecutableName = argv[0];
     workItems.reserve(argc);
@@ -285,12 +288,19 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
                         ProcessBindingBase(argc, argv, baseImageBinding);
                     } else if (lowerword == "shift-ubo-bindings" ||  // synonyms
                                lowerword == "shift-ubo-binding"  ||
-                               lowerword == "sub") {
+                               lowerword == "shift-cbuffer-bindings" ||
+                               lowerword == "shift-cbuffer-binding"  ||
+                               lowerword == "sub" ||
+                               lowerword == "scb") {
                         ProcessBindingBase(argc, argv, baseUboBinding);
                     } else if (lowerword == "shift-ssbo-bindings" ||  // synonyms
                                lowerword == "shift-ssbo-binding"  ||
                                lowerword == "sbb") {
                         ProcessBindingBase(argc, argv, baseSsboBinding);
+                    } else if (lowerword == "shift-uav-bindings" ||  // synonyms
+                               lowerword == "shift-uav-binding"  ||
+                               lowerword == "suavb") {
+                        ProcessBindingBase(argc, argv, baseUavBinding);
                     } else if (lowerword == "auto-map-bindings" ||  // synonyms
                                lowerword == "auto-map-binding"  ||
                                lowerword == "amb") {
@@ -326,6 +336,10 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
                         Options |= EOptionKeepUncalled;
                     } else if (lowerword == "hlsl-offsets") {
                         Options |= EOptionHlslOffsets;
+                    } else if (lowerword == "hlsl-iomap" ||
+                               lowerword == "hlsl-iomapper" ||
+                               lowerword == "hlsl-iomapping") {
+                        Options |= EOptionHlslIoMapping;
                     } else {
                         usage();
                     }
@@ -577,9 +591,13 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
         shader->setShiftImageBinding(baseImageBinding[compUnit.stage]);
         shader->setShiftUboBinding(baseUboBinding[compUnit.stage]);
         shader->setShiftSsboBinding(baseSsboBinding[compUnit.stage]);
+        shader->setShiftUavBinding(baseUavBinding[compUnit.stage]);
         shader->setFlattenUniformArrays((Options & EOptionFlattenUniformArrays) != 0);
         shader->setNoStorageFormat((Options & EOptionNoStorageFormat) != 0);
 
+        if (Options & EOptionHlslIoMapping)
+            shader->setHlslIoMapping(true);
+
         if (Options & EOptionAutoMapBindings)
             shader->setAutoMapBindings(true);
 
@@ -982,11 +1000,15 @@ void usage()
            "  --sib [stage] num                       synonym for --shift-image-binding\n"
            "\n"
            "  --shift-UBO-binding [stage] num         set base binding number for UBOs\n"
+           "  --shift-cbuffer-binding [stage] num     synonym for --shift-UBO-binding\n"
            "  --sub [stage] num                       synonym for --shift-UBO-binding\n"
            "\n"
            "  --shift-ssbo-binding [stage] num        set base binding number for SSBOs\n"
            "  --sbb [stage] num                       synonym for --shift-ssbo-binding\n"
            "\n"
+           "  --shift-uav-binding [stage] num         set base binding number for UAVs\n"
+           "  --suavb [stage] num                     synonym for --shift-uav-binding\n"
+           "\n"
            "  --auto-map-bindings                     automatically bind uniform variables without\n"
            "                                          explicit bindings.\n"
            "  --amb                                   synonym for --auto-map-bindings\n"
@@ -1009,6 +1031,8 @@ void usage()
            "\n"
            "  --hlsl-offsets                          Allow block offsets to follow HLSL rules instead of GLSL rules.\n"
            "                                          Works independently of source language.\n"
+           "\n"
+           "  --hlsl-iomap                            Perform IO mapping in HLSL register space.\n"
            );
 
     exit(EFailUsage);

+ 3 - 3
3rdparty/glslang/Test/400.frag

@@ -184,10 +184,8 @@ void qlod()
     lod = textureQueryLod(sampRect, pf2);   // ERROR
 }
 
-struct SKeyMem { int precise; } KeyMem;     // ERROR, keyword can't be a member
-
 uniform uint uu;
-out int iout;
+out uint iout;
 
 void bitwiseConv()
 {
@@ -195,3 +193,5 @@ void bitwiseConv()
     iout += uu ^ i;
     iout += i | uu;
 }
+
+struct SKeyMem { int precise; } KeyMem;     // ERROR, keyword can't be a member

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

@@ -84,7 +84,7 @@ ERROR: 0:194: '.' : cannot apply to an array: method
 ERROR: 0:194: 'a' : can't use function syntax on variable 
 ERROR: 0:214: 'non-constant global initializer (needs GL_EXT_shader_non_constant_global_initializers)' : not supported for this version or the enabled extensions 
 ERROR: 0:3000: '#error' : line of this error should be 3000  
-ERROR: 0:3002: '' :  syntax error
+ERROR: 0:3002: '' :  syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
 ERROR: 77 compilation errors.  No code generated.
 
 

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

@@ -52,7 +52,7 @@ ERROR: 0:209: 'assign' :  cannot convert from ' const float' to ' temp 4-compone
 ERROR: 0:212: 'sampler2DRect' : Reserved word. 
 ERROR: 0:244: ':' :  wrong operand types: no operation ':' exists that takes a left-hand operand of type ' global void' and a right operand of type ' const int' (or there is no acceptable conversion)
 ERROR: 0:245: ':' :  wrong operand types: no operation ':' exists that takes a left-hand operand of type ' const int' and a right operand of type ' global void' (or there is no acceptable conversion)
-ERROR: 0:248: '' :  syntax error
+ERROR: 0:248: '' :  syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
 ERROR: 54 compilation errors.  No code generated.
 
 

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

@@ -43,7 +43,7 @@ ERROR: 0:156: 'invariant' : can only apply to an output
 ERROR: 0:157: 'invariant' : can only apply to an output 
 ERROR: 0:158: 'invariant' : can only apply to an output 
 ERROR: 0:160: 'imageBuffer' : Reserved word. 
-ERROR: 0:160: '' :  syntax error
+ERROR: 0:160: '' :  syntax error, unexpected IMAGEBUFFER, expecting COMMA or SEMICOLON
 ERROR: 45 compilation errors.  No code generated.
 
 

+ 26 - 1
3rdparty/glslang/Test/baseResults/400.frag.out

@@ -34,7 +34,7 @@ ERROR: 0:183: 'textureQueryLod' : no matching overloaded function found
 ERROR: 0:183: 'assign' :  cannot convert from ' const float' to ' temp 2-component vector of float'
 ERROR: 0:184: 'textureQueryLod' : no matching overloaded function found 
 ERROR: 0:184: 'assign' :  cannot convert from ' const float' to ' temp 2-component vector of float'
-ERROR: 0:187: '' :  syntax error
+ERROR: 0:197: '' :  syntax error, unexpected PRECISE, expecting IDENTIFIER
 ERROR: 35 compilation errors.  No code generated.
 
 
@@ -469,6 +469,27 @@ ERROR: node is still EOpNull!
 0:181          'pf3' ( temp 3-component vector of float)
 0:183      'lod' ( temp 2-component vector of float)
 0:184      'lod' ( temp 2-component vector of float)
+0:190  Function Definition: bitwiseConv( ( global void)
+0:190    Function Parameters: 
+0:192    Sequence
+0:192      move second child to first child ( temp uint)
+0:192        'iout' ( out uint)
+0:192        bitwise and ( temp uint)
+0:192          'uu' ( uniform uint)
+0:192          Convert int to uint ( temp uint)
+0:192            'i' ( flat in int)
+0:193      add second child into first child ( temp uint)
+0:193        'iout' ( out uint)
+0:193        exclusive-or ( temp uint)
+0:193          'uu' ( uniform uint)
+0:193          Convert int to uint ( temp uint)
+0:193            'i' ( flat in int)
+0:194      add second child into first child ( temp uint)
+0:194        'iout' ( out uint)
+0:194        inclusive-or ( temp uint)
+0:194          Convert int to uint ( temp uint)
+0:194            'i' ( flat in int)
+0:194          'uu' ( uniform uint)
 0:?   Linker Objects
 0:?     'c2D' ( smooth in 2-component vector of float)
 0:?     'i' ( flat in int)
@@ -512,6 +533,8 @@ ERROR: node is still EOpNull!
 0:?     'sampCubeAs' ( uniform samplerCubeArrayShadow)
 0:?     'sampBuf' ( uniform samplerBuffer)
 0:?     'sampRect' ( uniform sampler2DRect)
+0:?     'uu' ( uniform uint)
+0:?     'iout' ( out uint)
 
 
 Linked fragment stage:
@@ -685,4 +708,6 @@ ERROR: node is still EOpNull!
 0:?     'sampCubeAs' ( uniform samplerCubeArrayShadow)
 0:?     'sampBuf' ( uniform samplerBuffer)
 0:?     'sampRect' ( uniform sampler2DRect)
+0:?     'uu' ( uniform uint)
+0:?     'iout' ( out uint)
 

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

@@ -6,7 +6,7 @@ ERROR: 0:4: 'preprocessor evaluation' : bad expression
 ERROR: 0:4: '#if' : unexpected tokens following directive 
 ERROR: 0:6: '€' : unexpected token 
 ERROR: 0:7: 'string' : End of line in string 
-ERROR: 0:7: '' :  syntax error
+ERROR: 0:7: '' :  syntax error, unexpected INT, expecting COMMA or SEMICOLON
 ERROR: 8 compilation errors.  No code generated.
 
 

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

@@ -4,7 +4,7 @@ ERROR: 0:2: '#if' : unexpected tokens following directive
 ERROR: 0:5: 'string' : End of line in string 
 ERROR: 0:5: 'macro expansion' : expected '(' following n
 ERROR: 0:5: '""' : string literals not supported 
-ERROR: 0:5: '' :  syntax error
+ERROR: 0:5: '' :  syntax error, unexpected INT, expecting COMMA or SEMICOLON
 ERROR: 6 compilation errors.  No code generated.
 
 

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

@@ -1,6 +1,6 @@
 cppIndent.vert
 ERROR: 0:61: 'macro expansion' : Too few args in Macro FUNC
-ERROR: 0:61: '' :  syntax error
+ERROR: 0:61: '' :  syntax error, unexpected COMMA
 ERROR: 2 compilation errors.  No code generated.
 
 

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

@@ -2,7 +2,7 @@ glspv.frag
 ERROR: 0:4: '#error' : GL_SPIRV is set ( correct , not an error )  
 ERROR: 0:6: '#error' : GL_SPIR is 100  
 ERROR: 0:14: 'input_attachment_index' : only allowed when using GLSL for Vulkan 
-ERROR: 0:14: '' :  syntax error
+ERROR: 0:14: '' :  syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
 ERROR: 4 compilation errors.  No code generated.
 
 

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

@@ -7,7 +7,7 @@ ERROR: 0:9: 'packed' : not allowed when generating SPIR-V
 ERROR: 0:13: 'gl_VertexIndex' : undeclared identifier 
 ERROR: 0:14: 'gl_InstanceIndex' : undeclared identifier 
 ERROR: 0:17: 'gl_DepthRangeParameters' : undeclared identifier 
-ERROR: 0:20: '' :  syntax error
+ERROR: 0:20: '' :  syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
 ERROR: 8 compilation errors.  No code generated.
 
 

+ 29 - 0
3rdparty/glslang/Test/baseResults/hlsl.automap.frag.out

@@ -0,0 +1,29 @@
+hlsl.automap.frag
+Uniform reflection:
+t1: offset -1, type 8b5d, size 1, index -1, binding 11
+t2: offset -1, type 8b5e, size 1, index -1, binding 12
+t3: offset -1, type 8b5f, size 1, index -1, binding 13
+t4.@data: offset 0, type 8b52, size 1, index 0, binding -1
+t5.@data: offset 0, type 1405, size 0, index 1, binding -1
+t6: offset -1, type 8dc2, size 1, index -1, binding 16
+s1: offset -1, type 0, size 1, index -1, binding 31
+s2: offset -1, type 0, size 1, index -1, binding 32
+u1: offset -1, type 904c, size 1, index -1, binding 41
+u2: offset -1, type 904d, size 1, index -1, binding 42
+u3: offset -1, type 904e, size 1, index -1, binding 43
+u4: offset -1, type 9051, size 1, index -1, binding 44
+u5.@data: offset 0, type 1405, size 0, index 2, binding -1
+u6.@data: offset 0, type 1406, size 1, index 3, binding -1
+cb1: offset 0, type 1404, size 1, index 4, binding -1
+tb1: offset 0, type 1404, size 1, index 5, binding -1
+
+Uniform block reflection:
+t4: offset -1, type ffffffff, size 0, index -1, binding 14
+t5: offset -1, type ffffffff, size 0, index -1, binding 15
+u5: offset -1, type ffffffff, size 0, index -1, binding 45
+u6: offset -1, type ffffffff, size 0, index -1, binding 46
+cb: offset -1, type ffffffff, size 4, index -1, binding 51
+tb: offset -1, type ffffffff, size 4, index -1, binding 17
+
+Vertex attribute reflection:
+

+ 21 - 8
3rdparty/glslang/Test/baseResults/hlsl.buffer.frag.out

@@ -17,7 +17,7 @@ gl_FragCoord origin is upper left
 0:31                  Constant:
 0:31                    0 (const uint)
 0:31              v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float)
-0:31                'anon@1' (layout( row_major std430) buffer block{layout( row_major std430) buffer 4-component vector of float v2})
+0:31                'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
 0:31                Constant:
 0:31                  0 (const uint)
 0:31            v3: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
@@ -25,7 +25,7 @@ gl_FragCoord origin is upper left
 0:31              Constant:
 0:31                0 (const uint)
 0:31          v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
-0:31            'anon@3' (layout( binding=8 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
+0:31            'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
 0:31            Constant:
 0:31              0 (const uint)
 0:30  Function Definition: PixelShaderFunction( ( temp void)
@@ -40,9 +40,9 @@ gl_FragCoord origin is upper left
 0:?           'input' ( temp 4-component vector of float)
 0:?   Linker Objects
 0:?     'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
-0:?     'anon@1' (layout( row_major std430) buffer block{layout( row_major std430) buffer 4-component vector of float v2})
+0:?     'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
 0:?     'anon@2' (layout( set=10 binding=2 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
-0:?     'anon@3' (layout( binding=8 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
+0:?     'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:?     'input' (layout( location=0) in 4-component vector of float)
 
@@ -68,7 +68,7 @@ gl_FragCoord origin is upper left
 0:31                  Constant:
 0:31                    0 (const uint)
 0:31              v2: direct index for structure (layout( row_major std430) buffer 4-component vector of float)
-0:31                'anon@1' (layout( row_major std430) buffer block{layout( row_major std430) buffer 4-component vector of float v2})
+0:31                'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
 0:31                Constant:
 0:31                  0 (const uint)
 0:31            v3: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
@@ -76,7 +76,7 @@ gl_FragCoord origin is upper left
 0:31              Constant:
 0:31                0 (const uint)
 0:31          v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
-0:31            'anon@3' (layout( binding=8 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
+0:31            'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
 0:31            Constant:
 0:31              0 (const uint)
 0:30  Function Definition: PixelShaderFunction( ( temp void)
@@ -91,9 +91,9 @@ gl_FragCoord origin is upper left
 0:?           'input' ( temp 4-component vector of float)
 0:?   Linker Objects
 0:?     'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
-0:?     'anon@1' (layout( row_major std430) buffer block{layout( row_major std430) buffer 4-component vector of float v2})
+0:?     'anon@1' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer 4-component vector of float v2})
 0:?     'anon@2' (layout( set=10 binding=2 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
-0:?     'anon@3' (layout( binding=8 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
+0:?     'anon@3' (layout( binding=8 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:?     'input' (layout( location=0) in 4-component vector of float)
 
@@ -141,6 +141,7 @@ gl_FragCoord origin is upper left
                               MemberDecorate 14 0 Offset 0
                               Decorate 14 Block
                               Decorate 16 DescriptorSet 0
+                              MemberDecorate 23 0 NonWritable
                               MemberDecorate 23 0 Offset 0
                               Decorate 23 BufferBlock
                               Decorate 25 DescriptorSet 0
@@ -149,24 +150,36 @@ gl_FragCoord origin is upper left
                               Decorate 29(cbufName) Block
                               Decorate 31 DescriptorSet 10
                               Decorate 31 Binding 2
+                              MemberDecorate 36(tbufName) 0 NonWritable
                               MemberDecorate 36(tbufName) 0 Offset 16
+                              MemberDecorate 36(tbufName) 1 NonWritable
                               MemberDecorate 36(tbufName) 1 Offset 48
+                              MemberDecorate 36(tbufName) 2 NonWritable
                               MemberDecorate 36(tbufName) 2 Offset 60
+                              MemberDecorate 36(tbufName) 3 NonWritable
                               MemberDecorate 36(tbufName) 3 Offset 64
+                              MemberDecorate 36(tbufName) 4 NonWritable
                               MemberDecorate 36(tbufName) 4 Offset 68
+                              MemberDecorate 36(tbufName) 5 NonWritable
                               MemberDecorate 36(tbufName) 5 Offset 72
+                              MemberDecorate 36(tbufName) 6 NonWritable
                               MemberDecorate 36(tbufName) 6 Offset 76
+                              MemberDecorate 36(tbufName) 7 NonWritable
                               MemberDecorate 36(tbufName) 7 Offset 80
                               MemberDecorate 36(tbufName) 8 RowMajor
+                              MemberDecorate 36(tbufName) 8 NonWritable
                               MemberDecorate 36(tbufName) 8 Offset 96
                               MemberDecorate 36(tbufName) 8 MatrixStride 16
                               MemberDecorate 36(tbufName) 9 ColMajor
+                              MemberDecorate 36(tbufName) 9 NonWritable
                               MemberDecorate 36(tbufName) 9 Offset 160
                               MemberDecorate 36(tbufName) 9 MatrixStride 16
                               MemberDecorate 36(tbufName) 10 RowMajor
+                              MemberDecorate 36(tbufName) 10 NonWritable
                               MemberDecorate 36(tbufName) 10 Offset 208
                               MemberDecorate 36(tbufName) 10 MatrixStride 16
                               MemberDecorate 36(tbufName) 11 RowMajor
+                              MemberDecorate 36(tbufName) 11 NonWritable
                               MemberDecorate 36(tbufName) 11 Offset 272
                               MemberDecorate 36(tbufName) 11 MatrixStride 16
                               Decorate 36(tbufName) BufferBlock

+ 731 - 582
3rdparty/glslang/Test/baseResults/hlsl.conditional.frag.out

@@ -5,178 +5,231 @@ gl_FragCoord origin is upper left
 0:8  Function Definition: vectorCond( ( temp 4-component vector of float)
 0:8    Function Parameters: 
 0:?     Sequence
-0:11      Branch: Return with expression
-0:10        add ( temp 4-component vector of float)
-0:9          add ( temp 4-component vector of float)
-0:9            mix ( temp 4-component vector of float)
-0:9              f4: direct index for structure ( uniform 4-component vector of float)
-0:9                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:9                Constant:
-0:9                  2 (const uint)
-0:9              t4: direct index for structure ( uniform 4-component vector of float)
-0:9                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:9                Constant:
-0:9                  1 (const uint)
-0:9              Convert float to bool ( temp 4-component vector of bool)
-0:9                c4: direct index for structure ( uniform 4-component vector of float)
+0:12      Branch: Return with expression
+0:11        add ( temp 4-component vector of float)
+0:10          add ( temp 4-component vector of float)
+0:9            add ( temp 4-component vector of float)
+0:9              mix ( temp 4-component vector of float)
+0:9                f4: direct index for structure ( uniform 4-component vector of float)
 0:9                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
 0:9                  Constant:
-0:9                    0 (const uint)
-0:10            mix ( temp 4-component vector of float)
-0:10              Construct vec4 ( temp 4-component vector of float)
-0:10                f: direct index for structure ( uniform float)
-0:10                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:10                  Constant:
-0:10                    4 (const uint)
-0:10              Construct vec4 ( temp 4-component vector of float)
-0:10                t: direct index for structure ( uniform float)
-0:10                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:10                  Constant:
-0:10                    3 (const uint)
-0:10              Convert float to bool ( temp 4-component vector of bool)
-0:10                c4: direct index for structure ( uniform 4-component vector of float)
-0:10                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:10                  Constant:
-0:10                    0 (const uint)
-0:11          mix ( temp 4-component vector of float)
-0:11            f4: direct index for structure ( uniform 4-component vector of float)
-0:11              'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:11              Constant:
-0:11                2 (const uint)
-0:11            t4: direct index for structure ( uniform 4-component vector of float)
-0:11              'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:11              Constant:
-0:11                1 (const uint)
-0:11            Compare Less Than ( temp 4-component vector of bool)
-0:11              t4: direct index for structure ( uniform 4-component vector of float)
-0:11                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:11                Constant:
-0:11                  1 (const uint)
+0:9                    2 (const uint)
+0:9                t4: direct index for structure ( uniform 4-component vector of float)
+0:9                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:9                  Constant:
+0:9                    1 (const uint)
+0:9                Convert float to bool ( temp 4-component vector of bool)
+0:9                  c4: direct index for structure ( uniform 4-component vector of float)
+0:9                    'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:9                    Constant:
+0:9                      0 (const uint)
+0:10              mix ( temp 4-component vector of float)
+0:10                Construct vec4 ( temp 4-component vector of float)
+0:10                  f: direct index for structure ( uniform float)
+0:10                    'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:10                    Constant:
+0:10                      4 (const uint)
+0:10                Construct vec4 ( temp 4-component vector of float)
+0:10                  t: direct index for structure ( uniform float)
+0:10                    'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:10                    Constant:
+0:10                      3 (const uint)
+0:10                Convert float to bool ( temp 4-component vector of bool)
+0:10                  c4: direct index for structure ( uniform 4-component vector of float)
+0:10                    'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:10                    Constant:
+0:10                      0 (const uint)
+0:11            mix ( temp 4-component vector of float)
 0:11              f4: direct index for structure ( uniform 4-component vector of float)
 0:11                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
 0:11                Constant:
 0:11                  2 (const uint)
-0:15  Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
-0:15    Function Parameters: 
-0:15      'cnd' ( in 2-component vector of bool)
-0:15      'src0' ( in 2-component vector of float)
-0:15      'src1' ( in 2-component vector of float)
+0:11              t4: direct index for structure ( uniform 4-component vector of float)
+0:11                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:11                Constant:
+0:11                  1 (const uint)
+0:11              Compare Less Than ( temp 4-component vector of bool)
+0:11                t4: direct index for structure ( uniform 4-component vector of float)
+0:11                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:11                  Constant:
+0:11                    1 (const uint)
+0:11                f4: direct index for structure ( uniform 4-component vector of float)
+0:11                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:11                  Constant:
+0:11                    2 (const uint)
+0:12          mix ( temp 4-component vector of float)
+0:12            f4: direct index for structure ( uniform 4-component vector of float)
+0:12              'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:12              Constant:
+0:12                2 (const uint)
+0:12            Construct vec4 ( temp 4-component vector of float)
+0:12              t: direct index for structure ( uniform float)
+0:12                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:12                Constant:
+0:12                  3 (const uint)
+0:12            Convert float to bool ( temp 4-component vector of bool)
+0:12              c4: direct index for structure ( uniform 4-component vector of float)
+0:12                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:12                Constant:
+0:12                  0 (const uint)
+0:16  Function Definition: scalarCond( ( temp 4-component vector of float)
+0:16    Function Parameters: 
 0:?     Sequence
-0:16      Branch: Return with expression
-0:16        mix ( temp 2-component vector of float)
-0:16          'src1' ( in 2-component vector of float)
-0:16          'src0' ( in 2-component vector of float)
-0:16          'cnd' ( in 2-component vector of bool)
-0:20  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
-0:20    Function Parameters: 
-0:20      'input' ( in 4-component vector of float)
+0:17      Sequence
+0:17        move second child to first child ( temp 4-component vector of float)
+0:17          'ret' ( temp 4-component vector of float)
+0:17          Test condition and select ( temp 4-component vector of float)
+0:17            Condition
+0:17            Compare Not Equal ( temp bool)
+0:17              t: direct index for structure ( uniform float)
+0:17                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:17                Constant:
+0:17                  3 (const uint)
+0:17              f: direct index for structure ( uniform float)
+0:17                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:17                Constant:
+0:17                  4 (const uint)
+0:17            true case
+0:17            vector-scale ( temp 4-component vector of float)
+0:17              t: direct index for structure ( uniform float)
+0:17                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:17                Constant:
+0:17                  3 (const uint)
+0:17              f4: direct index for structure ( uniform 4-component vector of float)
+0:17                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:17                Constant:
+0:17                  2 (const uint)
+0:17            false case
+0:17            Constant:
+0:17              1.000000
+0:17              1.000000
+0:17              1.000000
+0:17              1.000000
+0:18      Branch: Return with expression
+0:18        'ret' ( temp 4-component vector of float)
+0:22  Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
+0:22    Function Parameters: 
+0:22      'cnd' ( in 2-component vector of bool)
+0:22      'src0' ( in 2-component vector of float)
+0:22      'src1' ( in 2-component vector of float)
 0:?     Sequence
-0:21      Sequence
-0:21        move second child to first child ( temp int)
-0:21          'a' ( temp int)
-0:21          Constant:
-0:21            5 (const int)
-0:22      Sequence
-0:22        move second child to first child ( temp int)
-0:22          'b' ( temp int)
-0:22          Constant:
-0:22            6 (const int)
-0:23      Sequence
-0:23        move second child to first child ( temp int)
-0:23          'c' ( temp int)
-0:23          Constant:
-0:23            7 (const int)
-0:24      Sequence
-0:24        move second child to first child ( temp int)
-0:24          'd' ( temp int)
-0:24          Constant:
-0:24            7 (const int)
-0:25      Sequence
-0:25        move second child to first child ( temp 4-component vector of float)
-0:25          'ret' ( temp 4-component vector of float)
-0:27          add ( temp 4-component vector of float)
-0:26            add ( temp 4-component vector of float)
-0:25              add ( temp 4-component vector of float)
-0:25                vector-scale ( temp 4-component vector of float)
-0:25                  Convert int to float ( temp float)
-0:25                    'a' ( temp int)
-0:25                  'input' ( in 4-component vector of float)
-0:26                vector-scale ( temp 4-component vector of float)
-0:26                  Convert int to float ( temp float)
-0:26                    'b' ( temp int)
-0:26                  'input' ( in 4-component vector of float)
-0:27              vector-scale ( temp 4-component vector of float)
-0:27                Convert int to float ( temp float)
-0:27                  'c' ( temp int)
-0:27                'input' ( in 4-component vector of float)
-0:28            vector-scale ( temp 4-component vector of float)
-0:28              Convert int to float ( temp float)
-0:28                'd' ( temp int)
-0:28              'input' ( in 4-component vector of float)
-0:30      Comma ( temp int)
-0:30        move second child to first child ( temp int)
-0:30          'e' ( temp int)
-0:30          move second child to first child ( temp int)
-0:30            'a' ( temp int)
-0:30            Test condition and select ( temp int)
-0:30              Condition
-0:30              Convert int to bool ( temp bool)
-0:30                'b' ( temp int)
-0:30              true case
-0:30              move second child to first child ( temp int)
-0:30                'c' ( temp int)
-0:30                'd' ( temp int)
-0:30              false case
-0:30              Constant:
-0:30                10 (const int)
+0:23      Branch: Return with expression
+0:23        mix ( temp 2-component vector of float)
+0:23          'src1' ( in 2-component vector of float)
+0:23          'src0' ( in 2-component vector of float)
+0:23          'cnd' ( in 2-component vector of bool)
+0:27  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:27    Function Parameters: 
+0:27      'input' ( in 4-component vector of float)
+0:?     Sequence
+0:28      Sequence
+0:28        move second child to first child ( temp int)
+0:28          'a' ( temp int)
+0:28          Constant:
+0:28            5 (const int)
+0:29      Sequence
+0:29        move second child to first child ( temp int)
+0:29          'b' ( temp int)
+0:29          Constant:
+0:29            6 (const int)
+0:30      Sequence
 0:30        move second child to first child ( temp int)
-0:30          'b' ( temp int)
-0:30          Test condition and select ( temp int)
-0:30            Condition
-0:30            Convert int to bool ( temp bool)
-0:30              'a' ( temp int)
-0:30            true case
-0:30            move second child to first child ( temp int)
-0:30              'd' ( temp int)
-0:30              'c' ( temp int)
-0:30            false case
-0:30            Constant:
-0:30              11 (const int)
-0:32      move second child to first child ( temp 4-component vector of float)
-0:32        'f' ( temp 4-component vector of float)
-0:32        Test condition and select ( temp 4-component vector of float)
-0:32          Condition
-0:32          Compare Less Than ( temp bool)
-0:32            direct index ( temp float)
-0:32              'ret' ( temp 4-component vector of float)
-0:32              Constant:
-0:32                0 (const int)
-0:32            direct index ( temp float)
-0:32              'input' ( in 4-component vector of float)
-0:32              Constant:
-0:32                1 (const int)
-0:32          true case
-0:32          vector-scale ( temp 4-component vector of float)
-0:32            Convert int to float ( temp float)
-0:32              'c' ( temp int)
-0:32            'input' ( in 4-component vector of float)
-0:32          false case
-0:32          vector-scale ( temp 4-component vector of float)
-0:32            Convert int to float ( temp float)
-0:32              'd' ( temp int)
-0:32            'input' ( in 4-component vector of float)
-0:34      Branch: Return with expression
-0:33        add ( temp 4-component vector of float)
-0:33          add ( temp 4-component vector of float)
+0:30          'c' ( temp int)
+0:30          Constant:
+0:30            7 (const int)
+0:31      Sequence
+0:31        move second child to first child ( temp int)
+0:31          'd' ( temp int)
+0:31          Constant:
+0:31            7 (const int)
+0:32      Sequence
+0:32        move second child to first child ( temp 4-component vector of float)
+0:32          'ret' ( temp 4-component vector of float)
+0:34          add ( temp 4-component vector of float)
 0:33            add ( temp 4-component vector of float)
-0:33              vector-scale ( temp 4-component vector of float)
-0:33                Convert int to float ( temp float)
-0:33                  'e' ( temp int)
-0:33                'ret' ( temp 4-component vector of float)
-0:33              'f' ( temp 4-component vector of float)
-0:33            Function Call: vectorCond( ( temp 4-component vector of float)
+0:32              add ( temp 4-component vector of float)
+0:32                vector-scale ( temp 4-component vector of float)
+0:32                  Convert int to float ( temp float)
+0:32                    'a' ( temp int)
+0:32                  'input' ( in 4-component vector of float)
+0:33                vector-scale ( temp 4-component vector of float)
+0:33                  Convert int to float ( temp float)
+0:33                    'b' ( temp int)
+0:33                  'input' ( in 4-component vector of float)
+0:34              vector-scale ( temp 4-component vector of float)
+0:34                Convert int to float ( temp float)
+0:34                  'c' ( temp int)
+0:34                'input' ( in 4-component vector of float)
+0:35            vector-scale ( temp 4-component vector of float)
+0:35              Convert int to float ( temp float)
+0:35                'd' ( temp int)
+0:35              'input' ( in 4-component vector of float)
+0:37      Comma ( temp int)
+0:37        move second child to first child ( temp int)
+0:37          'e' ( temp int)
+0:37          move second child to first child ( temp int)
+0:37            'a' ( temp int)
+0:37            Test condition and select ( temp int)
+0:37              Condition
+0:37              Convert int to bool ( temp bool)
+0:37                'b' ( temp int)
+0:37              true case
+0:37              move second child to first child ( temp int)
+0:37                'c' ( temp int)
+0:37                'd' ( temp int)
+0:37              false case
+0:37              Constant:
+0:37                10 (const int)
+0:37        move second child to first child ( temp int)
+0:37          'b' ( temp int)
+0:37          Test condition and select ( temp int)
+0:37            Condition
+0:37            Convert int to bool ( temp bool)
+0:37              'a' ( temp int)
+0:37            true case
+0:37            move second child to first child ( temp int)
+0:37              'd' ( temp int)
+0:37              'c' ( temp int)
+0:37            false case
+0:37            Constant:
+0:37              11 (const int)
+0:39      move second child to first child ( temp 4-component vector of float)
+0:39        'f' ( temp 4-component vector of float)
+0:39        Test condition and select ( temp 4-component vector of float)
+0:39          Condition
+0:39          Compare Less Than ( temp bool)
+0:39            direct index ( temp float)
+0:39              'ret' ( temp 4-component vector of float)
+0:39              Constant:
+0:39                0 (const int)
+0:39            direct index ( temp float)
+0:39              'input' ( in 4-component vector of float)
+0:39              Constant:
+0:39                1 (const int)
+0:39          true case
+0:39          vector-scale ( temp 4-component vector of float)
+0:39            Convert int to float ( temp float)
+0:39              'c' ( temp int)
+0:39            'input' ( in 4-component vector of float)
+0:39          false case
+0:39          vector-scale ( temp 4-component vector of float)
+0:39            Convert int to float ( temp float)
+0:39              'd' ( temp int)
+0:39            'input' ( in 4-component vector of float)
+0:41      Branch: Return with expression
+0:40        add ( temp 4-component vector of float)
+0:40          add ( temp 4-component vector of float)
+0:40            add ( temp 4-component vector of float)
+0:40              add ( temp 4-component vector of float)
+0:40                vector-scale ( temp 4-component vector of float)
+0:40                  Convert int to float ( temp float)
+0:40                    'e' ( temp int)
+0:40                  'ret' ( temp 4-component vector of float)
+0:40                'f' ( temp 4-component vector of float)
+0:40              Function Call: vectorCond( ( temp 4-component vector of float)
+0:40            Function Call: scalarCond( ( temp 4-component vector of float)
 0:?           Construct vec4 ( temp 4-component vector of float)
-0:34            Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
+0:41            Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
 0:?               Constant:
 0:?                 true (const bool)
 0:?                 false (const bool)
@@ -186,19 +239,19 @@ gl_FragCoord origin is upper left
 0:?               Constant:
 0:?                 3.000000
 0:?                 4.000000
-0:34            Constant:
-0:34              10.000000
-0:34            Constant:
-0:34              10.000000
-0:20  Function Definition: PixelShaderFunction( ( temp void)
-0:20    Function Parameters: 
+0:41            Constant:
+0:41              10.000000
+0:41            Constant:
+0:41              10.000000
+0:27  Function Definition: PixelShaderFunction( ( temp void)
+0:27    Function Parameters: 
 0:?     Sequence
-0:20      move second child to first child ( temp 4-component vector of float)
+0:27      move second child to first child ( temp 4-component vector of float)
 0:?         'input' ( temp 4-component vector of float)
 0:?         'input' (layout( location=0) in 4-component vector of float)
-0:20      move second child to first child ( temp 4-component vector of float)
+0:27      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:20        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:27        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
 0:?           'input' ( temp 4-component vector of float)
 0:?   Linker Objects
 0:?     'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
@@ -215,178 +268,231 @@ gl_FragCoord origin is upper left
 0:8  Function Definition: vectorCond( ( temp 4-component vector of float)
 0:8    Function Parameters: 
 0:?     Sequence
-0:11      Branch: Return with expression
-0:10        add ( temp 4-component vector of float)
-0:9          add ( temp 4-component vector of float)
-0:9            mix ( temp 4-component vector of float)
-0:9              f4: direct index for structure ( uniform 4-component vector of float)
-0:9                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:9                Constant:
-0:9                  2 (const uint)
-0:9              t4: direct index for structure ( uniform 4-component vector of float)
-0:9                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:9                Constant:
-0:9                  1 (const uint)
-0:9              Convert float to bool ( temp 4-component vector of bool)
-0:9                c4: direct index for structure ( uniform 4-component vector of float)
+0:12      Branch: Return with expression
+0:11        add ( temp 4-component vector of float)
+0:10          add ( temp 4-component vector of float)
+0:9            add ( temp 4-component vector of float)
+0:9              mix ( temp 4-component vector of float)
+0:9                f4: direct index for structure ( uniform 4-component vector of float)
 0:9                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
 0:9                  Constant:
-0:9                    0 (const uint)
-0:10            mix ( temp 4-component vector of float)
-0:10              Construct vec4 ( temp 4-component vector of float)
-0:10                f: direct index for structure ( uniform float)
-0:10                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:10                  Constant:
-0:10                    4 (const uint)
-0:10              Construct vec4 ( temp 4-component vector of float)
-0:10                t: direct index for structure ( uniform float)
-0:10                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:10                  Constant:
-0:10                    3 (const uint)
-0:10              Convert float to bool ( temp 4-component vector of bool)
-0:10                c4: direct index for structure ( uniform 4-component vector of float)
-0:10                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:10                  Constant:
-0:10                    0 (const uint)
-0:11          mix ( temp 4-component vector of float)
-0:11            f4: direct index for structure ( uniform 4-component vector of float)
-0:11              'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:11              Constant:
-0:11                2 (const uint)
-0:11            t4: direct index for structure ( uniform 4-component vector of float)
-0:11              'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:11              Constant:
-0:11                1 (const uint)
-0:11            Compare Less Than ( temp 4-component vector of bool)
-0:11              t4: direct index for structure ( uniform 4-component vector of float)
-0:11                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
-0:11                Constant:
-0:11                  1 (const uint)
+0:9                    2 (const uint)
+0:9                t4: direct index for structure ( uniform 4-component vector of float)
+0:9                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:9                  Constant:
+0:9                    1 (const uint)
+0:9                Convert float to bool ( temp 4-component vector of bool)
+0:9                  c4: direct index for structure ( uniform 4-component vector of float)
+0:9                    'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:9                    Constant:
+0:9                      0 (const uint)
+0:10              mix ( temp 4-component vector of float)
+0:10                Construct vec4 ( temp 4-component vector of float)
+0:10                  f: direct index for structure ( uniform float)
+0:10                    'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:10                    Constant:
+0:10                      4 (const uint)
+0:10                Construct vec4 ( temp 4-component vector of float)
+0:10                  t: direct index for structure ( uniform float)
+0:10                    'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:10                    Constant:
+0:10                      3 (const uint)
+0:10                Convert float to bool ( temp 4-component vector of bool)
+0:10                  c4: direct index for structure ( uniform 4-component vector of float)
+0:10                    'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:10                    Constant:
+0:10                      0 (const uint)
+0:11            mix ( temp 4-component vector of float)
 0:11              f4: direct index for structure ( uniform 4-component vector of float)
 0:11                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
 0:11                Constant:
 0:11                  2 (const uint)
-0:15  Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
-0:15    Function Parameters: 
-0:15      'cnd' ( in 2-component vector of bool)
-0:15      'src0' ( in 2-component vector of float)
-0:15      'src1' ( in 2-component vector of float)
+0:11              t4: direct index for structure ( uniform 4-component vector of float)
+0:11                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:11                Constant:
+0:11                  1 (const uint)
+0:11              Compare Less Than ( temp 4-component vector of bool)
+0:11                t4: direct index for structure ( uniform 4-component vector of float)
+0:11                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:11                  Constant:
+0:11                    1 (const uint)
+0:11                f4: direct index for structure ( uniform 4-component vector of float)
+0:11                  'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:11                  Constant:
+0:11                    2 (const uint)
+0:12          mix ( temp 4-component vector of float)
+0:12            f4: direct index for structure ( uniform 4-component vector of float)
+0:12              'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:12              Constant:
+0:12                2 (const uint)
+0:12            Construct vec4 ( temp 4-component vector of float)
+0:12              t: direct index for structure ( uniform float)
+0:12                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:12                Constant:
+0:12                  3 (const uint)
+0:12            Convert float to bool ( temp 4-component vector of bool)
+0:12              c4: direct index for structure ( uniform 4-component vector of float)
+0:12                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:12                Constant:
+0:12                  0 (const uint)
+0:16  Function Definition: scalarCond( ( temp 4-component vector of float)
+0:16    Function Parameters: 
 0:?     Sequence
-0:16      Branch: Return with expression
-0:16        mix ( temp 2-component vector of float)
-0:16          'src1' ( in 2-component vector of float)
-0:16          'src0' ( in 2-component vector of float)
-0:16          'cnd' ( in 2-component vector of bool)
-0:20  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
-0:20    Function Parameters: 
-0:20      'input' ( in 4-component vector of float)
+0:17      Sequence
+0:17        move second child to first child ( temp 4-component vector of float)
+0:17          'ret' ( temp 4-component vector of float)
+0:17          Test condition and select ( temp 4-component vector of float)
+0:17            Condition
+0:17            Compare Not Equal ( temp bool)
+0:17              t: direct index for structure ( uniform float)
+0:17                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:17                Constant:
+0:17                  3 (const uint)
+0:17              f: direct index for structure ( uniform float)
+0:17                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:17                Constant:
+0:17                  4 (const uint)
+0:17            true case
+0:17            vector-scale ( temp 4-component vector of float)
+0:17              t: direct index for structure ( uniform float)
+0:17                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:17                Constant:
+0:17                  3 (const uint)
+0:17              f4: direct index for structure ( uniform 4-component vector of float)
+0:17                'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
+0:17                Constant:
+0:17                  2 (const uint)
+0:17            false case
+0:17            Constant:
+0:17              1.000000
+0:17              1.000000
+0:17              1.000000
+0:17              1.000000
+0:18      Branch: Return with expression
+0:18        'ret' ( temp 4-component vector of float)
+0:22  Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
+0:22    Function Parameters: 
+0:22      'cnd' ( in 2-component vector of bool)
+0:22      'src0' ( in 2-component vector of float)
+0:22      'src1' ( in 2-component vector of float)
 0:?     Sequence
-0:21      Sequence
-0:21        move second child to first child ( temp int)
-0:21          'a' ( temp int)
-0:21          Constant:
-0:21            5 (const int)
-0:22      Sequence
-0:22        move second child to first child ( temp int)
-0:22          'b' ( temp int)
-0:22          Constant:
-0:22            6 (const int)
-0:23      Sequence
-0:23        move second child to first child ( temp int)
-0:23          'c' ( temp int)
-0:23          Constant:
-0:23            7 (const int)
-0:24      Sequence
-0:24        move second child to first child ( temp int)
-0:24          'd' ( temp int)
-0:24          Constant:
-0:24            7 (const int)
-0:25      Sequence
-0:25        move second child to first child ( temp 4-component vector of float)
-0:25          'ret' ( temp 4-component vector of float)
-0:27          add ( temp 4-component vector of float)
-0:26            add ( temp 4-component vector of float)
-0:25              add ( temp 4-component vector of float)
-0:25                vector-scale ( temp 4-component vector of float)
-0:25                  Convert int to float ( temp float)
-0:25                    'a' ( temp int)
-0:25                  'input' ( in 4-component vector of float)
-0:26                vector-scale ( temp 4-component vector of float)
-0:26                  Convert int to float ( temp float)
-0:26                    'b' ( temp int)
-0:26                  'input' ( in 4-component vector of float)
-0:27              vector-scale ( temp 4-component vector of float)
-0:27                Convert int to float ( temp float)
-0:27                  'c' ( temp int)
-0:27                'input' ( in 4-component vector of float)
-0:28            vector-scale ( temp 4-component vector of float)
-0:28              Convert int to float ( temp float)
-0:28                'd' ( temp int)
-0:28              'input' ( in 4-component vector of float)
-0:30      Comma ( temp int)
-0:30        move second child to first child ( temp int)
-0:30          'e' ( temp int)
-0:30          move second child to first child ( temp int)
-0:30            'a' ( temp int)
-0:30            Test condition and select ( temp int)
-0:30              Condition
-0:30              Convert int to bool ( temp bool)
-0:30                'b' ( temp int)
-0:30              true case
-0:30              move second child to first child ( temp int)
-0:30                'c' ( temp int)
-0:30                'd' ( temp int)
-0:30              false case
-0:30              Constant:
-0:30                10 (const int)
+0:23      Branch: Return with expression
+0:23        mix ( temp 2-component vector of float)
+0:23          'src1' ( in 2-component vector of float)
+0:23          'src0' ( in 2-component vector of float)
+0:23          'cnd' ( in 2-component vector of bool)
+0:27  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:27    Function Parameters: 
+0:27      'input' ( in 4-component vector of float)
+0:?     Sequence
+0:28      Sequence
+0:28        move second child to first child ( temp int)
+0:28          'a' ( temp int)
+0:28          Constant:
+0:28            5 (const int)
+0:29      Sequence
+0:29        move second child to first child ( temp int)
+0:29          'b' ( temp int)
+0:29          Constant:
+0:29            6 (const int)
+0:30      Sequence
 0:30        move second child to first child ( temp int)
-0:30          'b' ( temp int)
-0:30          Test condition and select ( temp int)
-0:30            Condition
-0:30            Convert int to bool ( temp bool)
-0:30              'a' ( temp int)
-0:30            true case
-0:30            move second child to first child ( temp int)
-0:30              'd' ( temp int)
-0:30              'c' ( temp int)
-0:30            false case
-0:30            Constant:
-0:30              11 (const int)
-0:32      move second child to first child ( temp 4-component vector of float)
-0:32        'f' ( temp 4-component vector of float)
-0:32        Test condition and select ( temp 4-component vector of float)
-0:32          Condition
-0:32          Compare Less Than ( temp bool)
-0:32            direct index ( temp float)
-0:32              'ret' ( temp 4-component vector of float)
-0:32              Constant:
-0:32                0 (const int)
-0:32            direct index ( temp float)
-0:32              'input' ( in 4-component vector of float)
-0:32              Constant:
-0:32                1 (const int)
-0:32          true case
-0:32          vector-scale ( temp 4-component vector of float)
-0:32            Convert int to float ( temp float)
-0:32              'c' ( temp int)
-0:32            'input' ( in 4-component vector of float)
-0:32          false case
-0:32          vector-scale ( temp 4-component vector of float)
-0:32            Convert int to float ( temp float)
-0:32              'd' ( temp int)
-0:32            'input' ( in 4-component vector of float)
-0:34      Branch: Return with expression
-0:33        add ( temp 4-component vector of float)
-0:33          add ( temp 4-component vector of float)
+0:30          'c' ( temp int)
+0:30          Constant:
+0:30            7 (const int)
+0:31      Sequence
+0:31        move second child to first child ( temp int)
+0:31          'd' ( temp int)
+0:31          Constant:
+0:31            7 (const int)
+0:32      Sequence
+0:32        move second child to first child ( temp 4-component vector of float)
+0:32          'ret' ( temp 4-component vector of float)
+0:34          add ( temp 4-component vector of float)
 0:33            add ( temp 4-component vector of float)
-0:33              vector-scale ( temp 4-component vector of float)
-0:33                Convert int to float ( temp float)
-0:33                  'e' ( temp int)
-0:33                'ret' ( temp 4-component vector of float)
-0:33              'f' ( temp 4-component vector of float)
-0:33            Function Call: vectorCond( ( temp 4-component vector of float)
+0:32              add ( temp 4-component vector of float)
+0:32                vector-scale ( temp 4-component vector of float)
+0:32                  Convert int to float ( temp float)
+0:32                    'a' ( temp int)
+0:32                  'input' ( in 4-component vector of float)
+0:33                vector-scale ( temp 4-component vector of float)
+0:33                  Convert int to float ( temp float)
+0:33                    'b' ( temp int)
+0:33                  'input' ( in 4-component vector of float)
+0:34              vector-scale ( temp 4-component vector of float)
+0:34                Convert int to float ( temp float)
+0:34                  'c' ( temp int)
+0:34                'input' ( in 4-component vector of float)
+0:35            vector-scale ( temp 4-component vector of float)
+0:35              Convert int to float ( temp float)
+0:35                'd' ( temp int)
+0:35              'input' ( in 4-component vector of float)
+0:37      Comma ( temp int)
+0:37        move second child to first child ( temp int)
+0:37          'e' ( temp int)
+0:37          move second child to first child ( temp int)
+0:37            'a' ( temp int)
+0:37            Test condition and select ( temp int)
+0:37              Condition
+0:37              Convert int to bool ( temp bool)
+0:37                'b' ( temp int)
+0:37              true case
+0:37              move second child to first child ( temp int)
+0:37                'c' ( temp int)
+0:37                'd' ( temp int)
+0:37              false case
+0:37              Constant:
+0:37                10 (const int)
+0:37        move second child to first child ( temp int)
+0:37          'b' ( temp int)
+0:37          Test condition and select ( temp int)
+0:37            Condition
+0:37            Convert int to bool ( temp bool)
+0:37              'a' ( temp int)
+0:37            true case
+0:37            move second child to first child ( temp int)
+0:37              'd' ( temp int)
+0:37              'c' ( temp int)
+0:37            false case
+0:37            Constant:
+0:37              11 (const int)
+0:39      move second child to first child ( temp 4-component vector of float)
+0:39        'f' ( temp 4-component vector of float)
+0:39        Test condition and select ( temp 4-component vector of float)
+0:39          Condition
+0:39          Compare Less Than ( temp bool)
+0:39            direct index ( temp float)
+0:39              'ret' ( temp 4-component vector of float)
+0:39              Constant:
+0:39                0 (const int)
+0:39            direct index ( temp float)
+0:39              'input' ( in 4-component vector of float)
+0:39              Constant:
+0:39                1 (const int)
+0:39          true case
+0:39          vector-scale ( temp 4-component vector of float)
+0:39            Convert int to float ( temp float)
+0:39              'c' ( temp int)
+0:39            'input' ( in 4-component vector of float)
+0:39          false case
+0:39          vector-scale ( temp 4-component vector of float)
+0:39            Convert int to float ( temp float)
+0:39              'd' ( temp int)
+0:39            'input' ( in 4-component vector of float)
+0:41      Branch: Return with expression
+0:40        add ( temp 4-component vector of float)
+0:40          add ( temp 4-component vector of float)
+0:40            add ( temp 4-component vector of float)
+0:40              add ( temp 4-component vector of float)
+0:40                vector-scale ( temp 4-component vector of float)
+0:40                  Convert int to float ( temp float)
+0:40                    'e' ( temp int)
+0:40                  'ret' ( temp 4-component vector of float)
+0:40                'f' ( temp 4-component vector of float)
+0:40              Function Call: vectorCond( ( temp 4-component vector of float)
+0:40            Function Call: scalarCond( ( temp 4-component vector of float)
 0:?           Construct vec4 ( temp 4-component vector of float)
-0:34            Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
+0:41            Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
 0:?               Constant:
 0:?                 true (const bool)
 0:?                 false (const bool)
@@ -396,19 +502,19 @@ gl_FragCoord origin is upper left
 0:?               Constant:
 0:?                 3.000000
 0:?                 4.000000
-0:34            Constant:
-0:34              10.000000
-0:34            Constant:
-0:34              10.000000
-0:20  Function Definition: PixelShaderFunction( ( temp void)
-0:20    Function Parameters: 
+0:41            Constant:
+0:41              10.000000
+0:41            Constant:
+0:41              10.000000
+0:27  Function Definition: PixelShaderFunction( ( temp void)
+0:27    Function Parameters: 
 0:?     Sequence
-0:20      move second child to first child ( temp 4-component vector of float)
+0:27      move second child to first child ( temp 4-component vector of float)
 0:?         'input' ( temp 4-component vector of float)
 0:?         'input' (layout( location=0) in 4-component vector of float)
-0:20      move second child to first child ( temp 4-component vector of float)
+0:27      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:20        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:27        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
 0:?           'input' ( temp 4-component vector of float)
 0:?   Linker Objects
 0:?     'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4,  uniform 4-component vector of float t4,  uniform 4-component vector of float f4,  uniform float t,  uniform float f})
@@ -417,270 +523,313 @@ gl_FragCoord origin is upper left
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 186
+// Id's are bound by 220
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 179 182
+                              EntryPoint Fragment 4  "PixelShaderFunction" 213 216
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "PixelShaderFunction"
                               Name 9  "vectorCond("
-                              Name 20  "fbSelect(vb2;vf2;vf2;"
-                              Name 17  "cnd"
-                              Name 18  "src0"
-                              Name 19  "src1"
-                              Name 25  "@PixelShaderFunction(vf4;"
-                              Name 24  "input"
-                              Name 27  "$Global"
-                              MemberName 27($Global) 0  "c4"
-                              MemberName 27($Global) 1  "t4"
-                              MemberName 27($Global) 2  "f4"
-                              MemberName 27($Global) 3  "t"
-                              MemberName 27($Global) 4  "f"
-                              Name 29  ""
-                              Name 80  "a"
-                              Name 82  "b"
-                              Name 84  "c"
-                              Name 86  "d"
-                              Name 87  "ret"
-                              Name 107  "e"
-                              Name 128  "f"
-                              Name 166  "param"
-                              Name 167  "param"
-                              Name 168  "param"
-                              Name 177  "input"
-                              Name 179  "input"
-                              Name 182  "@entryPointOutput"
-                              Name 183  "param"
-                              MemberDecorate 27($Global) 0 Offset 0
-                              MemberDecorate 27($Global) 1 Offset 16
-                              MemberDecorate 27($Global) 2 Offset 32
-                              MemberDecorate 27($Global) 3 Offset 48
-                              MemberDecorate 27($Global) 4 Offset 52
-                              Decorate 27($Global) Block
-                              Decorate 29 DescriptorSet 0
-                              Decorate 179(input) Location 0
-                              Decorate 182(@entryPointOutput) Location 0
+                              Name 11  "scalarCond("
+                              Name 22  "fbSelect(vb2;vf2;vf2;"
+                              Name 19  "cnd"
+                              Name 20  "src0"
+                              Name 21  "src1"
+                              Name 27  "@PixelShaderFunction(vf4;"
+                              Name 26  "input"
+                              Name 29  "$Global"
+                              MemberName 29($Global) 0  "c4"
+                              MemberName 29($Global) 1  "t4"
+                              MemberName 29($Global) 2  "f4"
+                              MemberName 29($Global) 3  "t"
+                              MemberName 29($Global) 4  "f"
+                              Name 31  ""
+                              Name 85  "ret"
+                              Name 113  "a"
+                              Name 115  "b"
+                              Name 117  "c"
+                              Name 119  "d"
+                              Name 120  "ret"
+                              Name 140  "e"
+                              Name 161  "f"
+                              Name 200  "param"
+                              Name 201  "param"
+                              Name 202  "param"
+                              Name 211  "input"
+                              Name 213  "input"
+                              Name 216  "@entryPointOutput"
+                              Name 217  "param"
+                              MemberDecorate 29($Global) 0 Offset 0
+                              MemberDecorate 29($Global) 1 Offset 16
+                              MemberDecorate 29($Global) 2 Offset 32
+                              MemberDecorate 29($Global) 3 Offset 48
+                              MemberDecorate 29($Global) 4 Offset 52
+                              Decorate 29($Global) Block
+                              Decorate 31 DescriptorSet 0
+                              Decorate 213(input) Location 0
+                              Decorate 216(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
                7:             TypeVector 6(float) 4
                8:             TypeFunction 7(fvec4)
-              11:             TypeBool
-              12:             TypeVector 11(bool) 2
-              13:             TypePointer Function 12(bvec2)
-              14:             TypeVector 6(float) 2
-              15:             TypePointer Function 14(fvec2)
-              16:             TypeFunction 14(fvec2) 13(ptr) 15(ptr) 15(ptr)
-              22:             TypePointer Function 7(fvec4)
-              23:             TypeFunction 7(fvec4) 22(ptr)
-     27($Global):             TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) 6(float) 6(float)
-              28:             TypePointer Uniform 27($Global)
-              29:     28(ptr) Variable Uniform
-              30:             TypeInt 32 1
-              31:     30(int) Constant 2
-              32:             TypePointer Uniform 7(fvec4)
-              35:     30(int) Constant 1
-              38:     30(int) Constant 0
-              41:             TypeVector 11(bool) 4
-              42:    6(float) Constant 0
-              43:    7(fvec4) ConstantComposite 42 42 42 42
-              46:     30(int) Constant 4
-              47:             TypePointer Uniform 6(float)
-              51:     30(int) Constant 3
-              79:             TypePointer Function 30(int)
-              81:     30(int) Constant 5
-              83:     30(int) Constant 6
-              85:     30(int) Constant 7
-             110:             TypeInt 32 0
-             111:    110(int) Constant 0
-             117:     30(int) Constant 10
-             126:     30(int) Constant 11
-             130:             TypePointer Function 6(float)
-             133:    110(int) Constant 1
-             157:    11(bool) ConstantTrue
-             158:    11(bool) ConstantFalse
-             159:   12(bvec2) ConstantComposite 157 158
-             160:    6(float) Constant 1065353216
-             161:    6(float) Constant 1073741824
-             162:   14(fvec2) ConstantComposite 160 161
-             163:    6(float) Constant 1077936128
-             164:    6(float) Constant 1082130432
-             165:   14(fvec2) ConstantComposite 163 164
-             170:    6(float) Constant 1092616192
-             178:             TypePointer Input 7(fvec4)
-      179(input):    178(ptr) Variable Input
-             181:             TypePointer Output 7(fvec4)
-182(@entryPointOutput):    181(ptr) Variable Output
+              13:             TypeBool
+              14:             TypeVector 13(bool) 2
+              15:             TypePointer Function 14(bvec2)
+              16:             TypeVector 6(float) 2
+              17:             TypePointer Function 16(fvec2)
+              18:             TypeFunction 16(fvec2) 15(ptr) 17(ptr) 17(ptr)
+              24:             TypePointer Function 7(fvec4)
+              25:             TypeFunction 7(fvec4) 24(ptr)
+     29($Global):             TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) 6(float) 6(float)
+              30:             TypePointer Uniform 29($Global)
+              31:     30(ptr) Variable Uniform
+              32:             TypeInt 32 1
+              33:     32(int) Constant 2
+              34:             TypePointer Uniform 7(fvec4)
+              37:     32(int) Constant 1
+              40:     32(int) Constant 0
+              43:             TypeVector 13(bool) 4
+              44:    6(float) Constant 0
+              45:    7(fvec4) ConstantComposite 44 44 44 44
+              48:     32(int) Constant 4
+              49:             TypePointer Uniform 6(float)
+              53:     32(int) Constant 3
+             100:    6(float) Constant 1065353216
+             101:    7(fvec4) ConstantComposite 100 100 100 100
+             112:             TypePointer Function 32(int)
+             114:     32(int) Constant 5
+             116:     32(int) Constant 6
+             118:     32(int) Constant 7
+             143:             TypeInt 32 0
+             144:    143(int) Constant 0
+             150:     32(int) Constant 10
+             159:     32(int) Constant 11
+             163:             TypePointer Function 6(float)
+             166:    143(int) Constant 1
+             192:    13(bool) ConstantTrue
+             193:    13(bool) ConstantFalse
+             194:   14(bvec2) ConstantComposite 192 193
+             195:    6(float) Constant 1073741824
+             196:   16(fvec2) ConstantComposite 100 195
+             197:    6(float) Constant 1077936128
+             198:    6(float) Constant 1082130432
+             199:   16(fvec2) ConstantComposite 197 198
+             204:    6(float) Constant 1092616192
+             212:             TypePointer Input 7(fvec4)
+      213(input):    212(ptr) Variable Input
+             215:             TypePointer Output 7(fvec4)
+216(@entryPointOutput):    215(ptr) Variable Output
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
-      177(input):     22(ptr) Variable Function
-      183(param):     22(ptr) Variable Function
-             180:    7(fvec4) Load 179(input)
-                              Store 177(input) 180
-             184:    7(fvec4) Load 177(input)
-                              Store 183(param) 184
-             185:    7(fvec4) FunctionCall 25(@PixelShaderFunction(vf4;) 183(param)
-                              Store 182(@entryPointOutput) 185
+      211(input):     24(ptr) Variable Function
+      217(param):     24(ptr) Variable Function
+             214:    7(fvec4) Load 213(input)
+                              Store 211(input) 214
+             218:    7(fvec4) Load 211(input)
+                              Store 217(param) 218
+             219:    7(fvec4) FunctionCall 27(@PixelShaderFunction(vf4;) 217(param)
+                              Store 216(@entryPointOutput) 219
                               Return
                               FunctionEnd
   9(vectorCond():    7(fvec4) Function None 8
               10:             Label
-              33:     32(ptr) AccessChain 29 31
-              34:    7(fvec4) Load 33
-              36:     32(ptr) AccessChain 29 35
-              37:    7(fvec4) Load 36
-              39:     32(ptr) AccessChain 29 38
-              40:    7(fvec4) Load 39
-              44:   41(bvec4) FOrdNotEqual 40 43
-              45:    7(fvec4) Select 44 37 34
-              48:     47(ptr) AccessChain 29 46
-              49:    6(float) Load 48
-              50:    7(fvec4) CompositeConstruct 49 49 49 49
-              52:     47(ptr) AccessChain 29 51
-              53:    6(float) Load 52
-              54:    7(fvec4) CompositeConstruct 53 53 53 53
-              55:     32(ptr) AccessChain 29 38
-              56:    7(fvec4) Load 55
-              57:   41(bvec4) FOrdNotEqual 56 43
-              58:    7(fvec4) Select 57 54 50
-              59:    7(fvec4) FAdd 45 58
-              60:     32(ptr) AccessChain 29 31
-              61:    7(fvec4) Load 60
-              62:     32(ptr) AccessChain 29 35
+              35:     34(ptr) AccessChain 31 33
+              36:    7(fvec4) Load 35
+              38:     34(ptr) AccessChain 31 37
+              39:    7(fvec4) Load 38
+              41:     34(ptr) AccessChain 31 40
+              42:    7(fvec4) Load 41
+              46:   43(bvec4) FOrdNotEqual 42 45
+              47:    7(fvec4) Select 46 39 36
+              50:     49(ptr) AccessChain 31 48
+              51:    6(float) Load 50
+              52:    7(fvec4) CompositeConstruct 51 51 51 51
+              54:     49(ptr) AccessChain 31 53
+              55:    6(float) Load 54
+              56:    7(fvec4) CompositeConstruct 55 55 55 55
+              57:     34(ptr) AccessChain 31 40
+              58:    7(fvec4) Load 57
+              59:   43(bvec4) FOrdNotEqual 58 45
+              60:    7(fvec4) Select 59 56 52
+              61:    7(fvec4) FAdd 47 60
+              62:     34(ptr) AccessChain 31 33
               63:    7(fvec4) Load 62
-              64:     32(ptr) AccessChain 29 35
+              64:     34(ptr) AccessChain 31 37
               65:    7(fvec4) Load 64
-              66:     32(ptr) AccessChain 29 31
+              66:     34(ptr) AccessChain 31 37
               67:    7(fvec4) Load 66
-              68:   41(bvec4) FOrdLessThan 65 67
-              69:    7(fvec4) Select 68 63 61
-              70:    7(fvec4) FAdd 59 69
-                              ReturnValue 70
+              68:     34(ptr) AccessChain 31 33
+              69:    7(fvec4) Load 68
+              70:   43(bvec4) FOrdLessThan 67 69
+              71:    7(fvec4) Select 70 65 63
+              72:    7(fvec4) FAdd 61 71
+              73:     34(ptr) AccessChain 31 33
+              74:    7(fvec4) Load 73
+              75:     49(ptr) AccessChain 31 53
+              76:    6(float) Load 75
+              77:    7(fvec4) CompositeConstruct 76 76 76 76
+              78:     34(ptr) AccessChain 31 40
+              79:    7(fvec4) Load 78
+              80:   43(bvec4) FOrdNotEqual 79 45
+              81:    7(fvec4) Select 80 77 74
+              82:    7(fvec4) FAdd 72 81
+                              ReturnValue 82
+                              FunctionEnd
+ 11(scalarCond():    7(fvec4) Function None 8
+              12:             Label
+         85(ret):     24(ptr) Variable Function
+              86:     24(ptr) Variable Function
+              87:     49(ptr) AccessChain 31 53
+              88:    6(float) Load 87
+              89:     49(ptr) AccessChain 31 48
+              90:    6(float) Load 89
+              91:    13(bool) FOrdNotEqual 88 90
+                              SelectionMerge 93 None
+                              BranchConditional 91 92 99
+              92:               Label
+              94:     49(ptr)   AccessChain 31 53
+              95:    6(float)   Load 94
+              96:     34(ptr)   AccessChain 31 33
+              97:    7(fvec4)   Load 96
+              98:    7(fvec4)   VectorTimesScalar 97 95
+                                Store 86 98
+                                Branch 93
+              99:               Label
+                                Store 86 101
+                                Branch 93
+              93:             Label
+             102:    7(fvec4) Load 86
+                              Store 85(ret) 102
+             103:    7(fvec4) Load 85(ret)
+                              ReturnValue 103
                               FunctionEnd
-20(fbSelect(vb2;vf2;vf2;):   14(fvec2) Function None 16
-         17(cnd):     13(ptr) FunctionParameter
-        18(src0):     15(ptr) FunctionParameter
-        19(src1):     15(ptr) FunctionParameter
-              21:             Label
-              73:   14(fvec2) Load 19(src1)
-              74:   14(fvec2) Load 18(src0)
-              75:   12(bvec2) Load 17(cnd)
-              76:   14(fvec2) Select 75 74 73
-                              ReturnValue 76
+22(fbSelect(vb2;vf2;vf2;):   16(fvec2) Function None 18
+         19(cnd):     15(ptr) FunctionParameter
+        20(src0):     17(ptr) FunctionParameter
+        21(src1):     17(ptr) FunctionParameter
+              23:             Label
+             106:   16(fvec2) Load 21(src1)
+             107:   16(fvec2) Load 20(src0)
+             108:   14(bvec2) Load 19(cnd)
+             109:   16(fvec2) Select 108 107 106
+                              ReturnValue 109
                               FunctionEnd
-25(@PixelShaderFunction(vf4;):    7(fvec4) Function None 23
-       24(input):     22(ptr) FunctionParameter
-              26:             Label
-           80(a):     79(ptr) Variable Function
-           82(b):     79(ptr) Variable Function
-           84(c):     79(ptr) Variable Function
-           86(d):     79(ptr) Variable Function
-         87(ret):     22(ptr) Variable Function
-          107(e):     79(ptr) Variable Function
-             108:     79(ptr) Variable Function
-             119:     79(ptr) Variable Function
-          128(f):     22(ptr) Variable Function
-             129:     22(ptr) Variable Function
-      166(param):     13(ptr) Variable Function
-      167(param):     15(ptr) Variable Function
-      168(param):     15(ptr) Variable Function
-                              Store 80(a) 81
-                              Store 82(b) 83
-                              Store 84(c) 85
-                              Store 86(d) 85
-              88:     30(int) Load 80(a)
-              89:    6(float) ConvertSToF 88
-              90:    7(fvec4) Load 24(input)
-              91:    7(fvec4) VectorTimesScalar 90 89
-              92:     30(int) Load 82(b)
-              93:    6(float) ConvertSToF 92
-              94:    7(fvec4) Load 24(input)
-              95:    7(fvec4) VectorTimesScalar 94 93
-              96:    7(fvec4) FAdd 91 95
-              97:     30(int) Load 84(c)
-              98:    6(float) ConvertSToF 97
-              99:    7(fvec4) Load 24(input)
-             100:    7(fvec4) VectorTimesScalar 99 98
-             101:    7(fvec4) FAdd 96 100
-             102:     30(int) Load 86(d)
-             103:    6(float) ConvertSToF 102
-             104:    7(fvec4) Load 24(input)
-             105:    7(fvec4) VectorTimesScalar 104 103
-             106:    7(fvec4) FAdd 101 105
-                              Store 87(ret) 106
-             109:     30(int) Load 82(b)
-             112:    11(bool) INotEqual 109 111
-                              SelectionMerge 114 None
-                              BranchConditional 112 113 116
-             113:               Label
-             115:     30(int)   Load 86(d)
-                                Store 84(c) 115
-                                Store 108 115
-                                Branch 114
-             116:               Label
-                                Store 108 117
-                                Branch 114
-             114:             Label
-             118:     30(int) Load 108
-                              Store 80(a) 118
-                              Store 107(e) 118
-             120:     30(int) Load 80(a)
-             121:    11(bool) INotEqual 120 111
-                              SelectionMerge 123 None
-                              BranchConditional 121 122 125
-             122:               Label
-             124:     30(int)   Load 84(c)
-                                Store 86(d) 124
-                                Store 119 124
-                                Branch 123
-             125:               Label
-                                Store 119 126
-                                Branch 123
-             123:             Label
-             127:     30(int) Load 119
-                              Store 82(b) 127
-             131:    130(ptr) AccessChain 87(ret) 111
-             132:    6(float) Load 131
-             134:    130(ptr) AccessChain 24(input) 133
-             135:    6(float) Load 134
-             136:    11(bool) FOrdLessThan 132 135
-                              SelectionMerge 138 None
-                              BranchConditional 136 137 143
-             137:               Label
-             139:     30(int)   Load 84(c)
-             140:    6(float)   ConvertSToF 139
-             141:    7(fvec4)   Load 24(input)
-             142:    7(fvec4)   VectorTimesScalar 141 140
-                                Store 129 142
-                                Branch 138
-             143:               Label
-             144:     30(int)   Load 86(d)
-             145:    6(float)   ConvertSToF 144
-             146:    7(fvec4)   Load 24(input)
-             147:    7(fvec4)   VectorTimesScalar 146 145
-                                Store 129 147
-                                Branch 138
-             138:             Label
-             148:    7(fvec4) Load 129
-                              Store 128(f) 148
-             149:     30(int) Load 107(e)
-             150:    6(float) ConvertSToF 149
-             151:    7(fvec4) Load 87(ret)
-             152:    7(fvec4) VectorTimesScalar 151 150
-             153:    7(fvec4) Load 128(f)
-             154:    7(fvec4) FAdd 152 153
-             155:    7(fvec4) FunctionCall 9(vectorCond()
-             156:    7(fvec4) FAdd 154 155
-                              Store 166(param) 159
-                              Store 167(param) 162
-                              Store 168(param) 165
-             169:   14(fvec2) FunctionCall 20(fbSelect(vb2;vf2;vf2;) 166(param) 167(param) 168(param)
-             171:    6(float) CompositeExtract 169 0
-             172:    6(float) CompositeExtract 169 1
-             173:    7(fvec4) CompositeConstruct 171 172 170 170
-             174:    7(fvec4) FAdd 156 173
-                              ReturnValue 174
+27(@PixelShaderFunction(vf4;):    7(fvec4) Function None 25
+       26(input):     24(ptr) FunctionParameter
+              28:             Label
+          113(a):    112(ptr) Variable Function
+          115(b):    112(ptr) Variable Function
+          117(c):    112(ptr) Variable Function
+          119(d):    112(ptr) Variable Function
+        120(ret):     24(ptr) Variable Function
+          140(e):    112(ptr) Variable Function
+             141:    112(ptr) Variable Function
+             152:    112(ptr) Variable Function
+          161(f):     24(ptr) Variable Function
+             162:     24(ptr) Variable Function
+      200(param):     15(ptr) Variable Function
+      201(param):     17(ptr) Variable Function
+      202(param):     17(ptr) Variable Function
+                              Store 113(a) 114
+                              Store 115(b) 116
+                              Store 117(c) 118
+                              Store 119(d) 118
+             121:     32(int) Load 113(a)
+             122:    6(float) ConvertSToF 121
+             123:    7(fvec4) Load 26(input)
+             124:    7(fvec4) VectorTimesScalar 123 122
+             125:     32(int) Load 115(b)
+             126:    6(float) ConvertSToF 125
+             127:    7(fvec4) Load 26(input)
+             128:    7(fvec4) VectorTimesScalar 127 126
+             129:    7(fvec4) FAdd 124 128
+             130:     32(int) Load 117(c)
+             131:    6(float) ConvertSToF 130
+             132:    7(fvec4) Load 26(input)
+             133:    7(fvec4) VectorTimesScalar 132 131
+             134:    7(fvec4) FAdd 129 133
+             135:     32(int) Load 119(d)
+             136:    6(float) ConvertSToF 135
+             137:    7(fvec4) Load 26(input)
+             138:    7(fvec4) VectorTimesScalar 137 136
+             139:    7(fvec4) FAdd 134 138
+                              Store 120(ret) 139
+             142:     32(int) Load 115(b)
+             145:    13(bool) INotEqual 142 144
+                              SelectionMerge 147 None
+                              BranchConditional 145 146 149
+             146:               Label
+             148:     32(int)   Load 119(d)
+                                Store 117(c) 148
+                                Store 141 148
+                                Branch 147
+             149:               Label
+                                Store 141 150
+                                Branch 147
+             147:             Label
+             151:     32(int) Load 141
+                              Store 113(a) 151
+                              Store 140(e) 151
+             153:     32(int) Load 113(a)
+             154:    13(bool) INotEqual 153 144
+                              SelectionMerge 156 None
+                              BranchConditional 154 155 158
+             155:               Label
+             157:     32(int)   Load 117(c)
+                                Store 119(d) 157
+                                Store 152 157
+                                Branch 156
+             158:               Label
+                                Store 152 159
+                                Branch 156
+             156:             Label
+             160:     32(int) Load 152
+                              Store 115(b) 160
+             164:    163(ptr) AccessChain 120(ret) 144
+             165:    6(float) Load 164
+             167:    163(ptr) AccessChain 26(input) 166
+             168:    6(float) Load 167
+             169:    13(bool) FOrdLessThan 165 168
+                              SelectionMerge 171 None
+                              BranchConditional 169 170 176
+             170:               Label
+             172:     32(int)   Load 117(c)
+             173:    6(float)   ConvertSToF 172
+             174:    7(fvec4)   Load 26(input)
+             175:    7(fvec4)   VectorTimesScalar 174 173
+                                Store 162 175
+                                Branch 171
+             176:               Label
+             177:     32(int)   Load 119(d)
+             178:    6(float)   ConvertSToF 177
+             179:    7(fvec4)   Load 26(input)
+             180:    7(fvec4)   VectorTimesScalar 179 178
+                                Store 162 180
+                                Branch 171
+             171:             Label
+             181:    7(fvec4) Load 162
+                              Store 161(f) 181
+             182:     32(int) Load 140(e)
+             183:    6(float) ConvertSToF 182
+             184:    7(fvec4) Load 120(ret)
+             185:    7(fvec4) VectorTimesScalar 184 183
+             186:    7(fvec4) Load 161(f)
+             187:    7(fvec4) FAdd 185 186
+             188:    7(fvec4) FunctionCall 9(vectorCond()
+             189:    7(fvec4) FAdd 187 188
+             190:    7(fvec4) FunctionCall 11(scalarCond()
+             191:    7(fvec4) FAdd 189 190
+                              Store 200(param) 194
+                              Store 201(param) 196
+                              Store 202(param) 199
+             203:   16(fvec2) FunctionCall 22(fbSelect(vb2;vf2;vf2;) 200(param) 201(param) 202(param)
+             205:    6(float) CompositeExtract 203 0
+             206:    6(float) CompositeExtract 203 1
+             207:    7(fvec4) CompositeConstruct 205 206 204 204
+             208:    7(fvec4) FAdd 191 207
+                              ReturnValue 208
                               FunctionEnd

+ 168 - 64
3rdparty/glslang/Test/baseResults/hlsl.doLoop.frag.out

@@ -2,9 +2,9 @@ hlsl.doLoop.frag
 Shader version: 500
 gl_FragCoord origin is upper left
 0:? Sequence
-0:2  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:2  Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' ( in 4-component vector of float)
+0:2      'input' ( in float)
 0:?     Sequence
 0:3      Loop with condition not tested first
 0:3        Loop Condition
@@ -18,26 +18,56 @@ gl_FragCoord origin is upper left
 0:4        No loop body
 0:5      Loop with condition not tested first
 0:5        Loop Condition
-0:5        all ( temp bool)
-0:5          Equal ( temp 4-component vector of bool)
-0:5            'input' ( in 4-component vector of float)
-0:5            'input' ( in 4-component vector of float)
+0:5        Compare Greater Than ( temp bool)
+0:5          'input' ( in float)
+0:5          Constant:
+0:5            2.000000
 0:5        Loop Body
-0:5        Branch: Return with expression
-0:5          'input' ( in 4-component vector of float)
+0:?         Sequence
+0:5          Branch: Return with expression
+0:5            Construct vec4 ( temp 4-component vector of float)
+0:5              'input' ( in float)
+0:6      Loop with condition not tested first
+0:6        Loop Condition
+0:6        Compare Less Than ( temp bool)
+0:6          'input' ( in float)
+0:6          Constant:
+0:6            10.000000
+0:6        Loop Body
+0:6        Pre-Increment ( temp float)
+0:6          'input' ( in float)
+0:7      Loop with condition not tested first
+0:7        Loop Condition
+0:7        Compare Less Than ( temp bool)
+0:7          Pre-Increment ( temp float)
+0:7            'input' ( in float)
+0:7          Constant:
+0:7            10.000000
+0:7        Loop Body
+0:7        Loop with condition tested first
+0:7          Loop Condition
+0:7          Compare Less Than ( temp bool)
+0:7            Pre-Increment ( temp float)
+0:7              'input' ( in float)
+0:7            Constant:
+0:7              10.000000
+0:7          No loop body
+0:8      Branch: Return with expression
+0:8        Construct vec4 ( temp 4-component vector of float)
+0:8          'input' ( in float)
 0:2  Function Definition: PixelShaderFunction( ( temp void)
 0:2    Function Parameters: 
 0:?     Sequence
-0:2      move second child to first child ( temp 4-component vector of float)
-0:?         'input' ( temp 4-component vector of float)
-0:?         'input' (layout( location=0) in 4-component vector of float)
+0:2      move second child to first child ( temp float)
+0:?         'input' ( temp float)
+0:?         'input' (layout( location=0) in float)
 0:2      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:2        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
-0:?           'input' ( temp 4-component vector of float)
+0:2        Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
+0:?           'input' ( temp float)
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'input' (layout( location=0) in 4-component vector of float)
+0:?     'input' (layout( location=0) in float)
 
 
 Linked fragment stage:
@@ -46,9 +76,9 @@ Linked fragment stage:
 Shader version: 500
 gl_FragCoord origin is upper left
 0:? Sequence
-0:2  Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
+0:2  Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
 0:2    Function Parameters: 
-0:2      'input' ( in 4-component vector of float)
+0:2      'input' ( in float)
 0:?     Sequence
 0:3      Loop with condition not tested first
 0:3        Loop Condition
@@ -62,73 +92,105 @@ gl_FragCoord origin is upper left
 0:4        No loop body
 0:5      Loop with condition not tested first
 0:5        Loop Condition
-0:5        all ( temp bool)
-0:5          Equal ( temp 4-component vector of bool)
-0:5            'input' ( in 4-component vector of float)
-0:5            'input' ( in 4-component vector of float)
+0:5        Compare Greater Than ( temp bool)
+0:5          'input' ( in float)
+0:5          Constant:
+0:5            2.000000
 0:5        Loop Body
-0:5        Branch: Return with expression
-0:5          'input' ( in 4-component vector of float)
+0:?         Sequence
+0:5          Branch: Return with expression
+0:5            Construct vec4 ( temp 4-component vector of float)
+0:5              'input' ( in float)
+0:6      Loop with condition not tested first
+0:6        Loop Condition
+0:6        Compare Less Than ( temp bool)
+0:6          'input' ( in float)
+0:6          Constant:
+0:6            10.000000
+0:6        Loop Body
+0:6        Pre-Increment ( temp float)
+0:6          'input' ( in float)
+0:7      Loop with condition not tested first
+0:7        Loop Condition
+0:7        Compare Less Than ( temp bool)
+0:7          Pre-Increment ( temp float)
+0:7            'input' ( in float)
+0:7          Constant:
+0:7            10.000000
+0:7        Loop Body
+0:7        Loop with condition tested first
+0:7          Loop Condition
+0:7          Compare Less Than ( temp bool)
+0:7            Pre-Increment ( temp float)
+0:7              'input' ( in float)
+0:7            Constant:
+0:7              10.000000
+0:7          No loop body
+0:8      Branch: Return with expression
+0:8        Construct vec4 ( temp 4-component vector of float)
+0:8          'input' ( in float)
 0:2  Function Definition: PixelShaderFunction( ( temp void)
 0:2    Function Parameters: 
 0:?     Sequence
-0:2      move second child to first child ( temp 4-component vector of float)
-0:?         'input' ( temp 4-component vector of float)
-0:?         'input' (layout( location=0) in 4-component vector of float)
+0:2      move second child to first child ( temp float)
+0:?         'input' ( temp float)
+0:?         'input' (layout( location=0) in float)
 0:2      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:2        Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
-0:?           'input' ( temp 4-component vector of float)
+0:2        Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
+0:?           'input' ( temp float)
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'input' (layout( location=0) in 4-component vector of float)
+0:?     'input' (layout( location=0) in float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 44
+// Id's are bound by 71
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "PixelShaderFunction" 37 40
+                              EntryPoint Fragment 4  "PixelShaderFunction" 64 67
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "PixelShaderFunction"
-                              Name 11  "@PixelShaderFunction(vf4;"
+                              Name 11  "@PixelShaderFunction(f1;"
                               Name 10  "input"
-                              Name 35  "input"
-                              Name 37  "input"
-                              Name 40  "@entryPointOutput"
-                              Name 41  "param"
-                              Decorate 37(input) Location 0
-                              Decorate 40(@entryPointOutput) Location 0
+                              Name 62  "input"
+                              Name 64  "input"
+                              Name 67  "@entryPointOutput"
+                              Name 68  "param"
+                              Decorate 64(input) Location 0
+                              Decorate 67(@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)
+               7:             TypePointer Function 6(float)
+               8:             TypeVector 6(float) 4
+               9:             TypeFunction 8(fvec4) 7(ptr)
               17:             TypeBool
               18:    17(bool) ConstantFalse
-              31:             TypeVector 17(bool) 4
-              36:             TypePointer Input 7(fvec4)
-       37(input):     36(ptr) Variable Input
-              39:             TypePointer Output 7(fvec4)
-40(@entryPointOutput):     39(ptr) Variable Output
+              31:    6(float) Constant 1073741824
+              38:    6(float) Constant 1065353216
+              41:    6(float) Constant 1092616192
+              63:             TypePointer Input 6(float)
+       64(input):     63(ptr) Variable Input
+              66:             TypePointer Output 8(fvec4)
+67(@entryPointOutput):     66(ptr) Variable Output
 4(PixelShaderFunction):           2 Function None 3
                5:             Label
-       35(input):      8(ptr) Variable Function
-       41(param):      8(ptr) Variable Function
-              38:    7(fvec4) Load 37(input)
-                              Store 35(input) 38
-              42:    7(fvec4) Load 35(input)
-                              Store 41(param) 42
-              43:    7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 41(param)
-                              Store 40(@entryPointOutput) 43
+       62(input):      7(ptr) Variable Function
+       68(param):      7(ptr) Variable Function
+              65:    6(float) Load 64(input)
+                              Store 62(input) 65
+              69:    6(float) Load 62(input)
+                              Store 68(param) 69
+              70:    8(fvec4) FunctionCall 11(@PixelShaderFunction(f1;) 68(param)
+                              Store 67(@entryPointOutput) 70
                               Return
                               FunctionEnd
-11(@PixelShaderFunction(vf4;):    7(fvec4) Function None 9
-       10(input):      8(ptr) FunctionParameter
+11(@PixelShaderFunction(f1;):    8(fvec4) Function None 9
+       10(input):      7(ptr) FunctionParameter
               12:             Label
                               Branch 13
               13:             Label
@@ -153,15 +215,57 @@ gl_FragCoord origin is upper left
                               LoopMerge 25 26 None
                               Branch 24
               24:             Label
-              27:    7(fvec4) Load 10(input)
-                              ReturnValue 27
+              27:    6(float) Load 10(input)
+              28:    8(fvec4) CompositeConstruct 27 27 27 27
+                              ReturnValue 28
               26:             Label
-              29:    7(fvec4) Load 10(input)
-              30:    7(fvec4) Load 10(input)
-              32:   31(bvec4) FOrdEqual 29 30
-              33:    17(bool) All 32
-                              BranchConditional 33 23 25
+              30:    6(float) Load 10(input)
+              32:    17(bool) FOrdGreaterThan 30 31
+                              BranchConditional 32 23 25
               25:             Label
-              34:    7(fvec4) Undef
-                              ReturnValue 34
+                              Branch 33
+              33:             Label
+                              LoopMerge 35 36 None
+                              Branch 34
+              34:             Label
+              37:    6(float) Load 10(input)
+              39:    6(float) FAdd 37 38
+                              Store 10(input) 39
+                              Branch 36
+              36:             Label
+              40:    6(float) Load 10(input)
+              42:    17(bool) FOrdLessThan 40 41
+                              BranchConditional 42 33 35
+              35:             Label
+                              Branch 43
+              43:             Label
+                              LoopMerge 45 46 None
+                              Branch 44
+              44:             Label
+                              Branch 47
+              47:             Label
+                              LoopMerge 49 50 None
+                              Branch 51
+              51:             Label
+              52:    6(float) Load 10(input)
+              53:    6(float) FAdd 52 38
+                              Store 10(input) 53
+              54:    17(bool) FOrdLessThan 53 41
+                              BranchConditional 54 48 49
+              48:               Label
+                                Branch 50
+              50:               Label
+                                Branch 47
+              49:             Label
+                              Branch 46
+              46:             Label
+              55:    6(float) Load 10(input)
+              56:    6(float) FAdd 55 38
+                              Store 10(input) 56
+              57:    17(bool) FOrdLessThan 56 41
+                              BranchConditional 57 43 45
+              45:             Label
+              58:    6(float) Load 10(input)
+              59:    8(fvec4) CompositeConstruct 58 58 58 58
+                              ReturnValue 59
                               FunctionEnd

+ 6 - 4
3rdparty/glslang/Test/baseResults/hlsl.implicitBool.frag.out

@@ -118,8 +118,9 @@ gl_FragCoord origin is upper left
 0:24        Convert int to bool ( temp bool)
 0:24          'i' ( temp int)
 0:24        Loop Body
-0:24        Pre-Decrement ( temp int)
-0:24          'i' ( temp int)
+0:?         Sequence
+0:24          Pre-Decrement ( temp int)
+0:24            'i' ( temp int)
 0:?       Sequence
 0:26        Loop with condition tested first
 0:26          Loop Condition
@@ -286,8 +287,9 @@ gl_FragCoord origin is upper left
 0:24        Convert int to bool ( temp bool)
 0:24          'i' ( temp int)
 0:24        Loop Body
-0:24        Pre-Decrement ( temp int)
-0:24          'i' ( temp int)
+0:?         Sequence
+0:24          Pre-Decrement ( temp int)
+0:24            'i' ( temp int)
 0:?       Sequence
 0:26        Loop with condition tested first
 0:26          Loop Condition

+ 15 - 12
3rdparty/glslang/Test/baseResults/hlsl.layout.frag.out

@@ -12,23 +12,23 @@ gl_FragCoord origin is upper left
 0:17            add ( temp 4-component vector of float)
 0:17              'input' ( in 4-component vector of float)
 0:17              v1: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
-0:17                'anon@0' (layout( set=3 binding=5 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1})
+0:17                'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1})
 0:17                Constant:
 0:17                  0 (const uint)
 0:17            v5: direct index for structure (layout( row_major std430 offset=0) buffer 4-component vector of float)
-0:17              'anon@1' (layout( row_major std430 push_constant) buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5})
+0:17              'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5})
 0:17              Constant:
 0:17                0 (const uint)
 0:17          v1PostLayout: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
-0:17            'anon@2' (layout( set=4 binding=7 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout})
+0:17            'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout})
 0:17            Constant:
 0:17              0 (const uint)
 0:?   Linker Objects
-0:?     'anon@0' (layout( set=3 binding=5 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1})
-0:?     'anon@1' (layout( row_major std430 push_constant) buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5})
+0:?     'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1})
+0:?     'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5})
 0:?     'specConst' ( specialization-constant const int)
 0:?       10 (const int)
-0:?     'anon@2' (layout( set=4 binding=7 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout})
+0:?     'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout})
 
 
 Linked fragment stage:
@@ -48,23 +48,23 @@ gl_FragCoord origin is upper left
 0:17            add ( temp 4-component vector of float)
 0:17              'input' ( in 4-component vector of float)
 0:17              v1: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
-0:17                'anon@0' (layout( set=3 binding=5 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1})
+0:17                'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1})
 0:17                Constant:
 0:17                  0 (const uint)
 0:17            v5: direct index for structure (layout( row_major std430 offset=0) buffer 4-component vector of float)
-0:17              'anon@1' (layout( row_major std430 push_constant) buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5})
+0:17              'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5})
 0:17              Constant:
 0:17                0 (const uint)
 0:17          v1PostLayout: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
-0:17            'anon@2' (layout( set=4 binding=7 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout})
+0:17            'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout})
 0:17            Constant:
 0:17              0 (const uint)
 0:?   Linker Objects
-0:?     'anon@0' (layout( set=3 binding=5 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1})
-0:?     'anon@1' (layout( row_major std430 push_constant) buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5})
+0:?     'anon@0' (layout( set=3 binding=5 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1})
+0:?     'anon@1' (layout( row_major std430 push_constant) readonly buffer block{layout( row_major std430 offset=0) buffer 4-component vector of float v5})
 0:?     'specConst' ( specialization-constant const int)
 0:?       10 (const int)
-0:?     'anon@2' (layout( set=4 binding=7 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout})
+0:?     'anon@2' (layout( set=4 binding=7 row_major std430) readonly buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v1PostLayout})
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -89,12 +89,15 @@ gl_FragCoord origin is upper left
                               MemberName 30(tbufName2) 0  "v1PostLayout"
                               Name 32  ""
                               Name 38  "specConst"
+                              MemberDecorate 14(tbufName) 0 NonWritable
                               MemberDecorate 14(tbufName) 0 Offset 16
                               Decorate 14(tbufName) BufferBlock
                               Decorate 16 DescriptorSet 3
                               Decorate 16 Binding 5
+                              MemberDecorate 23(tbufName2) 0 NonWritable
                               MemberDecorate 23(tbufName2) 0 Offset 0
                               Decorate 23(tbufName2) BufferBlock
+                              MemberDecorate 30(tbufName2) 0 NonWritable
                               MemberDecorate 30(tbufName2) 0 Offset 16
                               Decorate 30(tbufName2) BufferBlock
                               Decorate 32 DescriptorSet 4

+ 96 - 0
3rdparty/glslang/Test/baseResults/hlsl.samplecmp.negative.frag.out

@@ -0,0 +1,96 @@
+hlsl.samplecmp.negative.frag
+ERROR: 0:9: '' : expected: SamplerComparisonState 
+ERROR: 1 compilation errors.  No code generated.
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+ERROR: node is still EOpNull!
+0:7  Function Definition: @main( ( temp 4-component vector of float)
+0:7    Function Parameters: 
+0:?     Sequence
+0:8      texture ( temp float)
+0:8        Construct combined texture-sampler ( temp sampler2DShadow)
+0:8          'g_shadowTex' ( uniform texture2D)
+0:8          'g_shadowSamplerComp' ( uniform sampler)
+0:8        Construct vec3 ( temp 3-component vector of float)
+0:?           Constant:
+0:?             0.000000
+0:?             0.000000
+0:8          Constant:
+0:8            0.000000
+0:9      ERROR: Bad aggregation op
+ ( temp float)
+0:9        'g_shadowTex' ( uniform texture2D)
+0:9        'g_shadowSampler' ( uniform sampler)
+0:?         Constant:
+0:?           0.000000
+0:?           0.000000
+0:9        Constant:
+0:9          0.000000
+0:11      Branch: Return with expression
+0:11        Constant:
+0:11          0.000000
+0:11          0.000000
+0:11          0.000000
+0:11          0.000000
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:7        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'g_shadowTex' ( uniform texture2D)
+0:?     'g_shadowSampler' ( uniform sampler)
+0:?     'g_shadowSamplerComp' ( uniform sampler)
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+ERROR: node is still EOpNull!
+0:7  Function Definition: @main( ( temp 4-component vector of float)
+0:7    Function Parameters: 
+0:?     Sequence
+0:8      texture ( temp float)
+0:8        Construct combined texture-sampler ( temp sampler2DShadow)
+0:8          'g_shadowTex' ( uniform texture2D)
+0:8          'g_shadowSamplerComp' ( uniform sampler)
+0:8        Construct vec3 ( temp 3-component vector of float)
+0:?           Constant:
+0:?             0.000000
+0:?             0.000000
+0:8          Constant:
+0:8            0.000000
+0:9      ERROR: Bad aggregation op
+ ( temp float)
+0:9        'g_shadowTex' ( uniform texture2D)
+0:9        'g_shadowSampler' ( uniform sampler)
+0:?         Constant:
+0:?           0.000000
+0:?           0.000000
+0:9        Constant:
+0:9          0.000000
+0:11      Branch: Return with expression
+0:11        Constant:
+0:11          0.000000
+0:11          0.000000
+0:11          0.000000
+0:11          0.000000
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:7        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'g_shadowTex' ( uniform texture2D)
+0:?     'g_shadowSampler' ( uniform sampler)
+0:?     'g_shadowSamplerComp' ( uniform sampler)
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+SPIR-V is not generated for failed compile or link

+ 80 - 0
3rdparty/glslang/Test/baseResults/hlsl.samplecmp.negative2.frag.out

@@ -0,0 +1,80 @@
+hlsl.samplecmp.negative2.frag
+ERROR: 0:7: '' : expected: SamplerComparisonState 
+ERROR: 1 compilation errors.  No code generated.
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+ERROR: node is still EOpNull!
+0:6  Function Definition: @main( ( temp 4-component vector of float)
+0:6    Function Parameters: 
+0:?     Sequence
+0:7      ERROR: Bad aggregation op
+ ( temp 4-component vector of float)
+0:7        'g_shadowTex' ( uniform texture2D)
+0:7        'g_shadowSampler' ( uniform sampler)
+0:?         Constant:
+0:?           0.000000
+0:?           0.000000
+0:7        Constant:
+0:7          0.000000
+0:?         Constant:
+0:?           0 (const int)
+0:?           0 (const int)
+0:9      Branch: Return with expression
+0:9        Constant:
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:6  Function Definition: main( ( temp void)
+0:6    Function Parameters: 
+0:?     Sequence
+0:6      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:6        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'g_shadowTex' ( uniform texture2D)
+0:?     'g_shadowSampler' ( uniform sampler)
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+ERROR: node is still EOpNull!
+0:6  Function Definition: @main( ( temp 4-component vector of float)
+0:6    Function Parameters: 
+0:?     Sequence
+0:7      ERROR: Bad aggregation op
+ ( temp 4-component vector of float)
+0:7        'g_shadowTex' ( uniform texture2D)
+0:7        'g_shadowSampler' ( uniform sampler)
+0:?         Constant:
+0:?           0.000000
+0:?           0.000000
+0:7        Constant:
+0:7          0.000000
+0:?         Constant:
+0:?           0 (const int)
+0:?           0 (const int)
+0:9      Branch: Return with expression
+0:9        Constant:
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:9          0.000000
+0:6  Function Definition: main( ( temp void)
+0:6    Function Parameters: 
+0:?     Sequence
+0:6      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:6        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'g_shadowTex' ( uniform texture2D)
+0:?     'g_shadowSampler' ( uniform sampler)
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+SPIR-V is not generated for failed compile or link

+ 173 - 44
3rdparty/glslang/Test/baseResults/hlsl.shapeConv.frag.out

@@ -95,27 +95,66 @@ gl_FragCoord origin is upper left
 0:22          Construct vec4 ( temp 4-component vector of float)
 0:22            'f' ( in float)
 0:22          'v' ( temp 4-component vector of float)
-0:26      Compare Equal ( temp bool)
-0:26        'f1' ( temp 1-component vector of float)
-0:26        Construct float ( temp 1-component vector of float)
-0:26          'v' ( temp 4-component vector of float)
-0:27      Compare Less Than ( temp bool)
-0:27        Construct float ( temp 1-component vector of float)
-0:27          'v' ( temp 4-component vector of float)
-0:27        'f1' ( temp 1-component vector of float)
+0:26      Equal ( temp 4-component vector of bool)
+0:26        Construct vec4 ( temp 4-component vector of float)
+0:26          'f1' ( temp 1-component vector of float)
+0:26        'v' ( temp 4-component vector of float)
+0:27      Compare Less Than ( temp 4-component vector of bool)
+0:27        'v' ( temp 4-component vector of float)
+0:27        Construct vec4 ( temp 4-component vector of float)
+0:27          'f1' ( temp 1-component vector of float)
 0:28      Construct float ( temp float)
 0:28        'f1' ( temp 1-component vector of float)
 0:29      Construct vec3 ( temp 3-component vector of float)
 0:29        Construct float ( temp float)
 0:29          'f1' ( temp 1-component vector of float)
-0:33      Branch: Return with expression
-0:33        component-wise multiply ( temp 4-component vector of float)
-0:33          'input' ( in 4-component vector of float)
-0:33          Constant:
-0:33            3.000000
-0:33            3.000000
-0:33            3.000000
-0:33            3.000000
+0:36      right-shift ( temp 3-component vector of uint)
+0:36        Construct uvec3 ( temp 3-component vector of uint)
+0:36          'ui' ( temp uint)
+0:36        'ui3' ( temp 3-component vector of uint)
+0:37      right-shift ( temp 3-component vector of uint)
+0:37        'ui3' ( temp 3-component vector of uint)
+0:37        'ui' ( temp uint)
+0:39      multiply second child into first child ( temp 4-component vector of float)
+0:39        'v' ( temp 4-component vector of float)
+0:39        'f1' ( temp 1-component vector of float)
+0:40      multiply second child into first child ( temp 1-component vector of float)
+0:40        'f1' ( temp 1-component vector of float)
+0:40        Construct float ( temp 1-component vector of float)
+0:40          'v' ( temp 4-component vector of float)
+0:42      Sequence
+0:42        move second child to first child ( temp 3-component vector of float)
+0:42          'mixed' ( temp 3-component vector of float)
+0:42          component-wise multiply ( temp 3-component vector of float)
+0:42            'u' ( temp 3-component vector of float)
+0:42            Construct vec3 ( temp 3-component vector of float)
+0:42              'v' ( temp 4-component vector of float)
+0:43      move second child to first child ( temp float)
+0:43        'f' ( in float)
+0:43        Construct float ( in float)
+0:43          'u' ( temp 3-component vector of float)
+0:44      move second child to first child ( temp 1-component vector of float)
+0:44        'f1' ( temp 1-component vector of float)
+0:44        Construct float ( temp 1-component vector of float)
+0:44          'u' ( temp 3-component vector of float)
+0:45      Sequence
+0:45        move second child to first child ( temp float)
+0:45          'sf' ( temp float)
+0:45          Construct float ( temp float)
+0:45            'v' ( temp 4-component vector of float)
+0:46      Sequence
+0:46        move second child to first child ( temp 1-component vector of float)
+0:46          'sf1' ( temp 1-component vector of float)
+0:46          Construct float ( temp 1-component vector of float)
+0:46            'v' ( temp 4-component vector of float)
+0:48      Branch: Return with expression
+0:48        component-wise multiply ( temp 4-component vector of float)
+0:48          'input' ( in 4-component vector of float)
+0:48          Constant:
+0:48            3.000000
+0:48            3.000000
+0:48            3.000000
+0:48            3.000000
 0:?   Linker Objects
 
 
@@ -219,32 +258,71 @@ gl_FragCoord origin is upper left
 0:22          Construct vec4 ( temp 4-component vector of float)
 0:22            'f' ( in float)
 0:22          'v' ( temp 4-component vector of float)
-0:26      Compare Equal ( temp bool)
-0:26        'f1' ( temp 1-component vector of float)
-0:26        Construct float ( temp 1-component vector of float)
-0:26          'v' ( temp 4-component vector of float)
-0:27      Compare Less Than ( temp bool)
-0:27        Construct float ( temp 1-component vector of float)
-0:27          'v' ( temp 4-component vector of float)
-0:27        'f1' ( temp 1-component vector of float)
+0:26      Equal ( temp 4-component vector of bool)
+0:26        Construct vec4 ( temp 4-component vector of float)
+0:26          'f1' ( temp 1-component vector of float)
+0:26        'v' ( temp 4-component vector of float)
+0:27      Compare Less Than ( temp 4-component vector of bool)
+0:27        'v' ( temp 4-component vector of float)
+0:27        Construct vec4 ( temp 4-component vector of float)
+0:27          'f1' ( temp 1-component vector of float)
 0:28      Construct float ( temp float)
 0:28        'f1' ( temp 1-component vector of float)
 0:29      Construct vec3 ( temp 3-component vector of float)
 0:29        Construct float ( temp float)
 0:29          'f1' ( temp 1-component vector of float)
-0:33      Branch: Return with expression
-0:33        component-wise multiply ( temp 4-component vector of float)
-0:33          'input' ( in 4-component vector of float)
-0:33          Constant:
-0:33            3.000000
-0:33            3.000000
-0:33            3.000000
-0:33            3.000000
+0:36      right-shift ( temp 3-component vector of uint)
+0:36        Construct uvec3 ( temp 3-component vector of uint)
+0:36          'ui' ( temp uint)
+0:36        'ui3' ( temp 3-component vector of uint)
+0:37      right-shift ( temp 3-component vector of uint)
+0:37        'ui3' ( temp 3-component vector of uint)
+0:37        'ui' ( temp uint)
+0:39      multiply second child into first child ( temp 4-component vector of float)
+0:39        'v' ( temp 4-component vector of float)
+0:39        'f1' ( temp 1-component vector of float)
+0:40      multiply second child into first child ( temp 1-component vector of float)
+0:40        'f1' ( temp 1-component vector of float)
+0:40        Construct float ( temp 1-component vector of float)
+0:40          'v' ( temp 4-component vector of float)
+0:42      Sequence
+0:42        move second child to first child ( temp 3-component vector of float)
+0:42          'mixed' ( temp 3-component vector of float)
+0:42          component-wise multiply ( temp 3-component vector of float)
+0:42            'u' ( temp 3-component vector of float)
+0:42            Construct vec3 ( temp 3-component vector of float)
+0:42              'v' ( temp 4-component vector of float)
+0:43      move second child to first child ( temp float)
+0:43        'f' ( in float)
+0:43        Construct float ( in float)
+0:43          'u' ( temp 3-component vector of float)
+0:44      move second child to first child ( temp 1-component vector of float)
+0:44        'f1' ( temp 1-component vector of float)
+0:44        Construct float ( temp 1-component vector of float)
+0:44          'u' ( temp 3-component vector of float)
+0:45      Sequence
+0:45        move second child to first child ( temp float)
+0:45          'sf' ( temp float)
+0:45          Construct float ( temp float)
+0:45            'v' ( temp 4-component vector of float)
+0:46      Sequence
+0:46        move second child to first child ( temp 1-component vector of float)
+0:46          'sf1' ( temp 1-component vector of float)
+0:46          Construct float ( temp 1-component vector of float)
+0:46            'v' ( temp 4-component vector of float)
+0:48      Branch: Return with expression
+0:48        component-wise multiply ( temp 4-component vector of float)
+0:48          'input' ( in 4-component vector of float)
+0:48          Constant:
+0:48            3.000000
+0:48            3.000000
+0:48            3.000000
+0:48            3.000000
 0:?   Linker Objects
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 88
+// Id's are bound by 127
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
@@ -263,6 +341,11 @@ gl_FragCoord origin is upper left
                               Name 34  "MyVal"
                               Name 37  "foo"
                               Name 70  "f1"
+                              Name 83  "ui"
+                              Name 88  "ui3"
+                              Name 103  "mixed"
+                              Name 115  "sf"
+                              Name 118  "sf1"
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -294,8 +377,11 @@ gl_FragCoord origin is upper left
               56:             TypeInt 32 0
               57:     56(int) Constant 0
               62:             TypeVector 41(bool) 4
-              83:    6(float) Constant 1077936128
-              84:    7(fvec4) ConstantComposite 83 83 83 83
+              82:             TypePointer Function 56(int)
+              85:             TypeVector 56(int) 3
+              87:             TypePointer Function 85(ivec3)
+             122:    6(float) Constant 1077936128
+             123:    7(fvec4) ConstantComposite 122 122 122 122
          4(main):           2 Function None 3
                5:             Label
                               Return
@@ -311,6 +397,11 @@ gl_FragCoord origin is upper left
        34(MyVal):     23(ptr) Variable Function
          37(foo):     23(ptr) Variable Function
           70(f1):      9(ptr) Variable Function
+          83(ui):     82(ptr) Variable Function
+         88(ui3):     87(ptr) Variable Function
+      103(mixed):     23(ptr) Variable Function
+         115(sf):      9(ptr) Variable Function
+        118(sf1):      9(ptr) Variable Function
                               Store 15(v) 17
                               Store 15(v) 19
               20:    6(float) Load 12(f)
@@ -346,17 +437,55 @@ gl_FragCoord origin is upper left
               68:   62(bvec4) FOrdNotEqual 66 67
               69:    41(bool) Any 68
               71:    6(float) Load 70(f1)
-              72:    7(fvec4) Load 15(v)
-              73:    6(float) CompositeExtract 72 0
-              74:    41(bool) FOrdEqual 71 73
+              72:    7(fvec4) CompositeConstruct 71 71 71 71
+              73:    7(fvec4) Load 15(v)
+              74:   62(bvec4) FOrdEqual 72 73
               75:    7(fvec4) Load 15(v)
-              76:    6(float) CompositeExtract 75 0
-              77:    6(float) Load 70(f1)
-              78:    41(bool) FOrdLessThan 76 77
+              76:    6(float) Load 70(f1)
+              77:    7(fvec4) CompositeConstruct 76 76 76 76
+              78:   62(bvec4) FOrdLessThan 75 77
               79:    6(float) Load 70(f1)
               80:    6(float) Load 70(f1)
               81:   22(fvec3) CompositeConstruct 80 80 80
-              82:    7(fvec4) Load 11(input)
-              85:    7(fvec4) FMul 82 84
-                              ReturnValue 85
+              84:     56(int) Load 83(ui)
+              86:   85(ivec3) CompositeConstruct 84 84 84
+              89:   85(ivec3) Load 88(ui3)
+              90:   85(ivec3) ShiftRightLogical 86 89
+              91:   85(ivec3) Load 88(ui3)
+              92:     56(int) Load 83(ui)
+              93:   85(ivec3) CompositeConstruct 92 92 92
+              94:   85(ivec3) ShiftRightLogical 91 93
+              95:    6(float) Load 70(f1)
+              96:    7(fvec4) Load 15(v)
+              97:    7(fvec4) CompositeConstruct 95 95 95 95
+              98:    7(fvec4) FMul 96 97
+                              Store 15(v) 98
+              99:    7(fvec4) Load 15(v)
+             100:    6(float) CompositeExtract 99 0
+             101:    6(float) Load 70(f1)
+             102:    6(float) FMul 101 100
+                              Store 70(f1) 102
+             104:   22(fvec3) Load 24(u)
+             105:    7(fvec4) Load 15(v)
+             106:    6(float) CompositeExtract 105 0
+             107:    6(float) CompositeExtract 105 1
+             108:    6(float) CompositeExtract 105 2
+             109:   22(fvec3) CompositeConstruct 106 107 108
+             110:   22(fvec3) FMul 104 109
+                              Store 103(mixed) 110
+             111:   22(fvec3) Load 24(u)
+             112:    6(float) CompositeExtract 111 0
+                              Store 12(f) 112
+             113:   22(fvec3) Load 24(u)
+             114:    6(float) CompositeExtract 113 0
+                              Store 70(f1) 114
+             116:    7(fvec4) Load 15(v)
+             117:    6(float) CompositeExtract 116 0
+                              Store 115(sf) 117
+             119:    7(fvec4) Load 15(v)
+             120:    6(float) CompositeExtract 119 0
+                              Store 118(sf1) 120
+             121:    7(fvec4) Load 11(input)
+             124:    7(fvec4) FMul 121 123
+                              ReturnValue 124
                               FunctionEnd

+ 223 - 0
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.append.frag.out

@@ -0,0 +1,223 @@
+hlsl.structbuffer.append.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main(u1; ( temp 4-component vector of float)
+0:7    Function Parameters: 
+0:7      'pos' ( in uint)
+0:?     Sequence
+0:8      move second child to first child ( temp 4-component vector of float)
+0:8        indirect index (layout( row_major std430) buffer 4-component vector of float)
+0:8          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
+0:8            'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:8            Constant:
+0:8              0 (const uint)
+0:8          AtomicAdd ( temp uint)
+0:8            @count: direct index for structure ( temp int)
+0:8              'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:8              Constant:
+0:8                0 (const int)
+0:8            Constant:
+0:8              1 (const int)
+0:?         Constant:
+0:?           1.000000
+0:?           2.000000
+0:?           3.000000
+0:?           4.000000
+0:10      Branch: Return with expression
+0:10        indirect index (layout( row_major std430) buffer 4-component vector of float)
+0:10          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
+0:10            'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:10            Constant:
+0:10              0 (const uint)
+0:10          add ( temp uint)
+0:10            AtomicAdd ( temp uint)
+0:10              @count: direct index for structure ( temp int)
+0:10                'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:10                Constant:
+0:10                  0 (const int)
+0:10              Constant:
+0:10                -1 (const int)
+0:10            Constant:
+0:10              -1 (const int)
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp uint)
+0:?         'pos' ( temp uint)
+0:?         'pos' (layout( location=0) in uint)
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:7        Function Call: @main(u1; ( temp 4-component vector of float)
+0:?           'pos' ( temp uint)
+0:?   Linker Objects
+0:?     'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:?     'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:?     'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:?     'pos' (layout( location=0) in uint)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main(u1; ( temp 4-component vector of float)
+0:7    Function Parameters: 
+0:7      'pos' ( in uint)
+0:?     Sequence
+0:8      move second child to first child ( temp 4-component vector of float)
+0:8        indirect index (layout( row_major std430) buffer 4-component vector of float)
+0:8          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
+0:8            'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:8            Constant:
+0:8              0 (const uint)
+0:8          AtomicAdd ( temp uint)
+0:8            @count: direct index for structure ( temp int)
+0:8              'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:8              Constant:
+0:8                0 (const int)
+0:8            Constant:
+0:8              1 (const int)
+0:?         Constant:
+0:?           1.000000
+0:?           2.000000
+0:?           3.000000
+0:?           4.000000
+0:10      Branch: Return with expression
+0:10        indirect index (layout( row_major std430) buffer 4-component vector of float)
+0:10          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
+0:10            'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:10            Constant:
+0:10              0 (const uint)
+0:10          add ( temp uint)
+0:10            AtomicAdd ( temp uint)
+0:10              @count: direct index for structure ( temp int)
+0:10                'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:10                Constant:
+0:10                  0 (const int)
+0:10              Constant:
+0:10                -1 (const int)
+0:10            Constant:
+0:10              -1 (const int)
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp uint)
+0:?         'pos' ( temp uint)
+0:?         'pos' (layout( location=0) in uint)
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:7        Function Call: @main(u1; ( temp 4-component vector of float)
+0:?           'pos' ( temp uint)
+0:?   Linker Objects
+0:?     'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:?     'sbuf_a@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'sbuf_c' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:?     'sbuf_c@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'sbuf_unused' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:?     'pos' (layout( location=0) in uint)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 56
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 48 51
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 12  "@main(u1;"
+                              Name 11  "pos"
+                              Name 15  "sbuf_a"
+                              MemberName 15(sbuf_a) 0  "@data"
+                              Name 17  "sbuf_a"
+                              Name 20  "sbuf_a@count"
+                              MemberName 20(sbuf_a@count) 0  "@count"
+                              Name 22  "sbuf_a@count"
+                              Name 36  "sbuf_c"
+                              Name 37  "sbuf_c@count"
+                              Name 46  "pos"
+                              Name 48  "pos"
+                              Name 51  "@entryPointOutput"
+                              Name 52  "param"
+                              Name 55  "sbuf_unused"
+                              Decorate 14 ArrayStride 16
+                              MemberDecorate 15(sbuf_a) 0 Offset 0
+                              Decorate 15(sbuf_a) BufferBlock
+                              Decorate 17(sbuf_a) DescriptorSet 0
+                              MemberDecorate 20(sbuf_a@count) 0 Offset 0
+                              Decorate 20(sbuf_a@count) BufferBlock
+                              Decorate 22(sbuf_a@count) DescriptorSet 0
+                              Decorate 36(sbuf_c) DescriptorSet 0
+                              Decorate 37(sbuf_c@count) DescriptorSet 0
+                              Decorate 48(pos) Location 0
+                              Decorate 51(@entryPointOutput) Location 0
+                              Decorate 55(sbuf_unused) DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypePointer Function 6(int)
+               8:             TypeFloat 32
+               9:             TypeVector 8(float) 4
+              10:             TypeFunction 9(fvec4) 7(ptr)
+              14:             TypeRuntimeArray 9(fvec4)
+      15(sbuf_a):             TypeStruct 14
+              16:             TypePointer Uniform 15(sbuf_a)
+      17(sbuf_a):     16(ptr) Variable Uniform
+              18:             TypeInt 32 1
+              19:     18(int) Constant 0
+20(sbuf_a@count):             TypeStruct 18(int)
+              21:             TypePointer Uniform 20(sbuf_a@count)
+22(sbuf_a@count):     21(ptr) Variable Uniform
+              23:             TypePointer Uniform 18(int)
+              25:     18(int) Constant 1
+              26:      6(int) Constant 1
+              27:      6(int) Constant 0
+              29:    8(float) Constant 1065353216
+              30:    8(float) Constant 1073741824
+              31:    8(float) Constant 1077936128
+              32:    8(float) Constant 1082130432
+              33:    9(fvec4) ConstantComposite 29 30 31 32
+              34:             TypePointer Uniform 9(fvec4)
+      36(sbuf_c):     16(ptr) Variable Uniform
+37(sbuf_c@count):     21(ptr) Variable Uniform
+              39:     18(int) Constant 4294967295
+              47:             TypePointer Input 6(int)
+         48(pos):     47(ptr) Variable Input
+              50:             TypePointer Output 9(fvec4)
+51(@entryPointOutput):     50(ptr) Variable Output
+ 55(sbuf_unused):     16(ptr) Variable Uniform
+         4(main):           2 Function None 3
+               5:             Label
+         46(pos):      7(ptr) Variable Function
+       52(param):      7(ptr) Variable Function
+              49:      6(int) Load 48(pos)
+                              Store 46(pos) 49
+              53:      6(int) Load 46(pos)
+                              Store 52(param) 53
+              54:    9(fvec4) FunctionCall 12(@main(u1;) 52(param)
+                              Store 51(@entryPointOutput) 54
+                              Return
+                              FunctionEnd
+   12(@main(u1;):    9(fvec4) Function None 10
+         11(pos):      7(ptr) FunctionParameter
+              13:             Label
+              24:     23(ptr) AccessChain 22(sbuf_a@count) 19
+              28:      6(int) AtomicIAdd 24 26 27 25
+              35:     34(ptr) AccessChain 17(sbuf_a) 19 28
+                              Store 35 33
+              38:     23(ptr) AccessChain 37(sbuf_c@count) 19
+              40:      6(int) AtomicIAdd 38 26 27 39
+              41:      6(int) IAdd 40 39
+              42:     34(ptr) AccessChain 36(sbuf_c) 19 41
+              43:    9(fvec4) Load 42
+                              ReturnValue 43
+                              FunctionEnd

+ 326 - 0
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.floatidx.comp.out

@@ -0,0 +1,326 @@
+hlsl.structbuffer.floatidx.comp
+Shader version: 500
+local_size = (1, 1, 1)
+0:? Sequence
+0:13  Function Definition: @main(vu3; ( temp void)
+0:13    Function Parameters: 
+0:13      'nThreadId' ( in 3-component vector of uint)
+0:?     Sequence
+0:14      Sequence
+0:14        move second child to first child ( temp structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:14          'data' ( temp structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:14          indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:14            @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:14              'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId} @data})
+0:14              Constant:
+0:14                0 (const uint)
+0:14            add ( temp uint)
+0:14              AtomicAdd ( temp uint)
+0:14                @count: direct index for structure ( temp int)
+0:14                  'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:14                  Constant:
+0:14                    0 (const int)
+0:14                Constant:
+0:14                  -1 (const int)
+0:14              Constant:
+0:14                -1 (const int)
+0:15      Sequence
+0:15        move second child to first child ( temp 2-component vector of float)
+0:15          'coord' ( temp 2-component vector of float)
+0:15          Convert uint to float ( temp 2-component vector of float)
+0:15            vector swizzle ( temp 2-component vector of uint)
+0:15              threadId: direct index for structure ( temp 2-component vector of uint)
+0:15                'data' ( temp structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:15                Constant:
+0:15                  1 (const int)
+0:15              Sequence
+0:15                Constant:
+0:15                  0 (const int)
+0:15                Constant:
+0:15                  1 (const int)
+0:16      Sequence
+0:16        move second child to first child ( temp 4-component vector of float)
+0:16          'storeTemp' ( temp 4-component vector of float)
+0:16          color: direct index for structure ( temp 4-component vector of float)
+0:16            'data' ( temp structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:16            Constant:
+0:16              0 (const int)
+0:16        imageStore ( temp void)
+0:16          'outtx' (layout( rgba32f) uniform image2D)
+0:16          Convert float to uint ( temp 2-component vector of uint)
+0:16            'coord' ( temp 2-component vector of float)
+0:16          'storeTemp' ( temp 4-component vector of float)
+0:16        'storeTemp' ( temp 4-component vector of float)
+0:18      move second child to first child ( temp 4-component vector of float)
+0:18        indirect index (layout( row_major std430) buffer 4-component vector of float)
+0:18          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
+0:18            'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:18            Constant:
+0:18              0 (const uint)
+0:18          Convert float to uint ( temp uint)
+0:18            direct index ( temp float)
+0:18              'coord' ( temp 2-component vector of float)
+0:18              Constant:
+0:18                0 (const int)
+0:18        indirect index (layout( row_major std430) buffer 4-component vector of float)
+0:18          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
+0:18            'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:18            Constant:
+0:18              0 (const uint)
+0:18          Convert float to uint ( temp uint)
+0:18            direct index ( temp float)
+0:18              'coord' ( temp 2-component vector of float)
+0:18              Constant:
+0:18                1 (const int)
+0:13  Function Definition: main( ( temp void)
+0:13    Function Parameters: 
+0:?     Sequence
+0:13      move second child to first child ( temp 3-component vector of uint)
+0:?         'nThreadId' ( temp 3-component vector of uint)
+0:?         'nThreadId' ( in 3-component vector of uint GlobalInvocationID)
+0:13      Function Call: @main(vu3; ( temp void)
+0:?         'nThreadId' ( temp 3-component vector of uint)
+0:?   Linker Objects
+0:?     'outtx' (layout( rgba32f) uniform image2D)
+0:?     'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId} @data})
+0:?     'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:?     'nThreadId' ( in 3-component vector of uint GlobalInvocationID)
+
+
+Linked compute stage:
+
+
+Shader version: 500
+local_size = (1, 1, 1)
+0:? Sequence
+0:13  Function Definition: @main(vu3; ( temp void)
+0:13    Function Parameters: 
+0:13      'nThreadId' ( in 3-component vector of uint)
+0:?     Sequence
+0:14      Sequence
+0:14        move second child to first child ( temp structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:14          'data' ( temp structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:14          indirect index (layout( row_major std430) buffer structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:14            @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:14              'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId} @data})
+0:14              Constant:
+0:14                0 (const uint)
+0:14            add ( temp uint)
+0:14              AtomicAdd ( temp uint)
+0:14                @count: direct index for structure ( temp int)
+0:14                  'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:14                  Constant:
+0:14                    0 (const int)
+0:14                Constant:
+0:14                  -1 (const int)
+0:14              Constant:
+0:14                -1 (const int)
+0:15      Sequence
+0:15        move second child to first child ( temp 2-component vector of float)
+0:15          'coord' ( temp 2-component vector of float)
+0:15          Convert uint to float ( temp 2-component vector of float)
+0:15            vector swizzle ( temp 2-component vector of uint)
+0:15              threadId: direct index for structure ( temp 2-component vector of uint)
+0:15                'data' ( temp structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:15                Constant:
+0:15                  1 (const int)
+0:15              Sequence
+0:15                Constant:
+0:15                  0 (const int)
+0:15                Constant:
+0:15                  1 (const int)
+0:16      Sequence
+0:16        move second child to first child ( temp 4-component vector of float)
+0:16          'storeTemp' ( temp 4-component vector of float)
+0:16          color: direct index for structure ( temp 4-component vector of float)
+0:16            'data' ( temp structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId})
+0:16            Constant:
+0:16              0 (const int)
+0:16        imageStore ( temp void)
+0:16          'outtx' (layout( rgba32f) uniform image2D)
+0:16          Convert float to uint ( temp 2-component vector of uint)
+0:16            'coord' ( temp 2-component vector of float)
+0:16          'storeTemp' ( temp 4-component vector of float)
+0:16        'storeTemp' ( temp 4-component vector of float)
+0:18      move second child to first child ( temp 4-component vector of float)
+0:18        indirect index (layout( row_major std430) buffer 4-component vector of float)
+0:18          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
+0:18            'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:18            Constant:
+0:18              0 (const uint)
+0:18          Convert float to uint ( temp uint)
+0:18            direct index ( temp float)
+0:18              'coord' ( temp 2-component vector of float)
+0:18              Constant:
+0:18                0 (const int)
+0:18        indirect index (layout( row_major std430) buffer 4-component vector of float)
+0:18          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
+0:18            'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:18            Constant:
+0:18              0 (const uint)
+0:18          Convert float to uint ( temp uint)
+0:18            direct index ( temp float)
+0:18              'coord' ( temp 2-component vector of float)
+0:18              Constant:
+0:18                1 (const int)
+0:13  Function Definition: main( ( temp void)
+0:13    Function Parameters: 
+0:?     Sequence
+0:13      move second child to first child ( temp 3-component vector of uint)
+0:?         'nThreadId' ( temp 3-component vector of uint)
+0:?         'nThreadId' ( in 3-component vector of uint GlobalInvocationID)
+0:13      Function Call: @main(vu3; ( temp void)
+0:?         'nThreadId' ( temp 3-component vector of uint)
+0:?   Linker Objects
+0:?     'outtx' (layout( rgba32f) uniform image2D)
+0:?     'csb' (layout( binding=1 row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of structure{ temp 4-component vector of float color,  temp 2-component vector of uint threadId} @data})
+0:?     'csb@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'rwsb' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
+0:?     'nThreadId' ( in 3-component vector of uint GlobalInvocationID)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 84
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main" 79
+                              ExecutionMode 4 LocalSize 1 1 1
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 11  "@main(vu3;"
+                              Name 10  "nThreadId"
+                              Name 16  "sb_t"
+                              MemberName 16(sb_t) 0  "color"
+                              MemberName 16(sb_t) 1  "threadId"
+                              Name 18  "data"
+                              Name 19  "sb_t"
+                              MemberName 19(sb_t) 0  "color"
+                              MemberName 19(sb_t) 1  "threadId"
+                              Name 21  "csb"
+                              MemberName 21(csb) 0  "@data"
+                              Name 23  "csb"
+                              Name 26  "csb@count"
+                              MemberName 26(csb@count) 0  "@count"
+                              Name 28  "csb@count"
+                              Name 48  "coord"
+                              Name 52  "storeTemp"
+                              Name 57  "outtx"
+                              Name 63  "rwsb"
+                              MemberName 63(rwsb) 0  "@data"
+                              Name 65  "rwsb"
+                              Name 77  "nThreadId"
+                              Name 79  "nThreadId"
+                              Name 81  "param"
+                              MemberDecorate 19(sb_t) 0 Offset 0
+                              MemberDecorate 19(sb_t) 1 Offset 16
+                              Decorate 20 ArrayStride 32
+                              MemberDecorate 21(csb) 0 Offset 0
+                              Decorate 21(csb) BufferBlock
+                              Decorate 23(csb) DescriptorSet 0
+                              Decorate 23(csb) Binding 1
+                              MemberDecorate 26(csb@count) 0 Offset 0
+                              Decorate 26(csb@count) BufferBlock
+                              Decorate 28(csb@count) DescriptorSet 0
+                              Decorate 57(outtx) DescriptorSet 0
+                              Decorate 62 ArrayStride 16
+                              MemberDecorate 63(rwsb) 0 Offset 0
+                              Decorate 63(rwsb) BufferBlock
+                              Decorate 65(rwsb) DescriptorSet 0
+                              Decorate 79(nThreadId) BuiltIn GlobalInvocationId
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypeVector 6(int) 3
+               8:             TypePointer Function 7(ivec3)
+               9:             TypeFunction 2 8(ptr)
+              13:             TypeFloat 32
+              14:             TypeVector 13(float) 4
+              15:             TypeVector 6(int) 2
+        16(sb_t):             TypeStruct 14(fvec4) 15(ivec2)
+              17:             TypePointer Function 16(sb_t)
+        19(sb_t):             TypeStruct 14(fvec4) 15(ivec2)
+              20:             TypeRuntimeArray 19(sb_t)
+         21(csb):             TypeStruct 20
+              22:             TypePointer Uniform 21(csb)
+         23(csb):     22(ptr) Variable Uniform
+              24:             TypeInt 32 1
+              25:     24(int) Constant 0
+   26(csb@count):             TypeStruct 24(int)
+              27:             TypePointer Uniform 26(csb@count)
+   28(csb@count):     27(ptr) Variable Uniform
+              29:             TypePointer Uniform 24(int)
+              31:     24(int) Constant 4294967295
+              32:      6(int) Constant 1
+              33:      6(int) Constant 0
+              36:             TypePointer Uniform 19(sb_t)
+              40:             TypePointer Function 14(fvec4)
+              43:     24(int) Constant 1
+              44:             TypePointer Function 15(ivec2)
+              46:             TypeVector 13(float) 2
+              47:             TypePointer Function 46(fvec2)
+              55:             TypeImage 13(float) 2D nonsampled format:Rgba32f
+              56:             TypePointer UniformConstant 55
+       57(outtx):     56(ptr) Variable UniformConstant
+              62:             TypeRuntimeArray 14(fvec4)
+        63(rwsb):             TypeStruct 62
+              64:             TypePointer Uniform 63(rwsb)
+        65(rwsb):     64(ptr) Variable Uniform
+              66:             TypePointer Function 13(float)
+              73:             TypePointer Uniform 14(fvec4)
+              78:             TypePointer Input 7(ivec3)
+   79(nThreadId):     78(ptr) Variable Input
+         4(main):           2 Function None 3
+               5:             Label
+   77(nThreadId):      8(ptr) Variable Function
+       81(param):      8(ptr) Variable Function
+              80:    7(ivec3) Load 79(nThreadId)
+                              Store 77(nThreadId) 80
+              82:    7(ivec3) Load 77(nThreadId)
+                              Store 81(param) 82
+              83:           2 FunctionCall 11(@main(vu3;) 81(param)
+                              Return
+                              FunctionEnd
+  11(@main(vu3;):           2 Function None 9
+   10(nThreadId):      8(ptr) FunctionParameter
+              12:             Label
+        18(data):     17(ptr) Variable Function
+       48(coord):     47(ptr) Variable Function
+   52(storeTemp):     40(ptr) Variable Function
+              30:     29(ptr) AccessChain 28(csb@count) 25
+              34:      6(int) AtomicIAdd 30 32 33 31
+              35:      6(int) IAdd 34 31
+              37:     36(ptr) AccessChain 23(csb) 25 35
+              38:    19(sb_t) Load 37
+              39:   14(fvec4) CompositeExtract 38 0
+              41:     40(ptr) AccessChain 18(data) 25
+                              Store 41 39
+              42:   15(ivec2) CompositeExtract 38 1
+              45:     44(ptr) AccessChain 18(data) 43
+                              Store 45 42
+              49:     44(ptr) AccessChain 18(data) 43
+              50:   15(ivec2) Load 49
+              51:   46(fvec2) ConvertUToF 50
+                              Store 48(coord) 51
+              53:     40(ptr) AccessChain 18(data) 25
+              54:   14(fvec4) Load 53
+                              Store 52(storeTemp) 54
+              58:          55 Load 57(outtx)
+              59:   46(fvec2) Load 48(coord)
+              60:   15(ivec2) ConvertFToU 59
+              61:   14(fvec4) Load 52(storeTemp)
+                              ImageWrite 58 60 61
+              67:     66(ptr) AccessChain 48(coord) 33
+              68:   13(float) Load 67
+              69:      6(int) ConvertFToU 68
+              70:     66(ptr) AccessChain 48(coord) 32
+              71:   13(float) Load 70
+              72:      6(int) ConvertFToU 71
+              74:     73(ptr) AccessChain 65(rwsb) 25 72
+              75:   14(fvec4) Load 74
+              76:     73(ptr) AccessChain 65(rwsb) 25 69
+                              Store 76 75
+                              Return
+                              FunctionEnd

+ 243 - 0
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.fn2.comp.out

@@ -0,0 +1,243 @@
+hlsl.structbuffer.fn2.comp
+Shader version: 500
+local_size = (256, 1, 1)
+0:? Sequence
+0:5  Function Definition: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint)
+0:5    Function Parameters: 
+0:5      'loc' ( in uint)
+0:5      'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:?     Sequence
+0:6      Sequence
+0:6        move second child to first child ( temp 2-component vector of uint)
+0:6          'result' ( temp 2-component vector of uint)
+0:?           Sequence
+0:6            move second child to first child ( temp int)
+0:6              'byteAddrTemp' ( temp int)
+0:6              right-shift ( temp int)
+0:6                'loc' ( in uint)
+0:6                Constant:
+0:6                  2 (const int)
+0:?             Construct vec2 ( temp 2-component vector of uint)
+0:6              indirect index ( temp float)
+0:6                @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
+0:6                  'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:6                  Constant:
+0:6                    0 (const uint)
+0:6                'byteAddrTemp' ( temp int)
+0:6              indirect index ( temp float)
+0:6                @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
+0:6                  'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:6                  Constant:
+0:6                    0 (const uint)
+0:6                add ( temp int)
+0:6                  'byteAddrTemp' ( temp int)
+0:6                  Constant:
+0:6                    1 (const int)
+0:7      Branch: Return with expression
+0:7        'result' ( temp 2-component vector of uint)
+0:12  Function Definition: @main(u1; ( temp void)
+0:12    Function Parameters: 
+0:12      'dispatchId' ( in uint)
+0:?     Sequence
+0:13      Sequence
+0:13        move second child to first child ( temp 2-component vector of uint)
+0:13          'result' ( temp 2-component vector of uint)
+0:13          Function Call: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint)
+0:13            'dispatchId' ( in uint)
+0:13            'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:14      Sequence
+0:14        imageStore ( temp void)
+0:14          'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer)
+0:14          'dispatchId' ( in uint)
+0:14          'result' ( temp 2-component vector of uint)
+0:14        'result' ( temp 2-component vector of uint)
+0:12  Function Definition: main( ( temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child ( temp uint)
+0:?         'dispatchId' ( temp uint)
+0:?         'dispatchId' ( in uint GlobalInvocationID)
+0:12      Function Call: @main(u1; ( temp void)
+0:?         'dispatchId' ( temp uint)
+0:?   Linker Objects
+0:?     'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:?     'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer)
+0:?     'dispatchId' ( in uint GlobalInvocationID)
+
+
+Linked compute stage:
+
+
+Shader version: 500
+local_size = (256, 1, 1)
+0:? Sequence
+0:5  Function Definition: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint)
+0:5    Function Parameters: 
+0:5      'loc' ( in uint)
+0:5      'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:?     Sequence
+0:6      Sequence
+0:6        move second child to first child ( temp 2-component vector of uint)
+0:6          'result' ( temp 2-component vector of uint)
+0:?           Sequence
+0:6            move second child to first child ( temp int)
+0:6              'byteAddrTemp' ( temp int)
+0:6              right-shift ( temp int)
+0:6                'loc' ( in uint)
+0:6                Constant:
+0:6                  2 (const int)
+0:?             Construct vec2 ( temp 2-component vector of uint)
+0:6              indirect index ( temp float)
+0:6                @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
+0:6                  'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:6                  Constant:
+0:6                    0 (const uint)
+0:6                'byteAddrTemp' ( temp int)
+0:6              indirect index ( temp float)
+0:6                @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
+0:6                  'buffer' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:6                  Constant:
+0:6                    0 (const uint)
+0:6                add ( temp int)
+0:6                  'byteAddrTemp' ( temp int)
+0:6                  Constant:
+0:6                    1 (const int)
+0:7      Branch: Return with expression
+0:7        'result' ( temp 2-component vector of uint)
+0:12  Function Definition: @main(u1; ( temp void)
+0:12    Function Parameters: 
+0:12      'dispatchId' ( in uint)
+0:?     Sequence
+0:13      Sequence
+0:13        move second child to first child ( temp 2-component vector of uint)
+0:13          'result' ( temp 2-component vector of uint)
+0:13          Function Call: testLoad(u1;block--u1[0]1; ( temp 2-component vector of uint)
+0:13            'dispatchId' ( in uint)
+0:13            'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:14      Sequence
+0:14        imageStore ( temp void)
+0:14          'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer)
+0:14          'dispatchId' ( in uint)
+0:14          'result' ( temp 2-component vector of uint)
+0:14        'result' ( temp 2-component vector of uint)
+0:12  Function Definition: main( ( temp void)
+0:12    Function Parameters: 
+0:?     Sequence
+0:12      move second child to first child ( temp uint)
+0:?         'dispatchId' ( temp uint)
+0:?         'dispatchId' ( in uint GlobalInvocationID)
+0:12      Function Call: @main(u1; ( temp void)
+0:?         'dispatchId' ( temp uint)
+0:?   Linker Objects
+0:?     'g_input' (layout( binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
+0:?     'g_output' (layout( binding=1 rg32ui) uniform uimageBuffer)
+0:?     'dispatchId' ( in uint GlobalInvocationID)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 61
+
+                              Capability Shader
+                              Capability SampledBuffer
+                              Capability StorageImageExtendedFormats
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint GLCompute 4  "main" 56
+                              ExecutionMode 4 LocalSize 256 1 1
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 9  ""
+                              MemberName 9 0  "@data"
+                              Name 15  "testLoad(u1;block--u1[0]1;"
+                              Name 13  "loc"
+                              Name 14  "buffer"
+                              Name 19  "@main(u1;"
+                              Name 18  "dispatchId"
+                              Name 22  "result"
+                              Name 25  "byteAddrTemp"
+                              Name 43  "result"
+                              Name 44  "g_input"
+                              Name 45  "param"
+                              Name 50  "g_output"
+                              Name 54  "dispatchId"
+                              Name 56  "dispatchId"
+                              Name 58  "param"
+                              Decorate 8 ArrayStride 4
+                              MemberDecorate 9 0 NonWritable
+                              MemberDecorate 9 0 Offset 0
+                              Decorate 9 BufferBlock
+                              Decorate 44(g_input) DescriptorSet 0
+                              Decorate 44(g_input) Binding 0
+                              Decorate 50(g_output) DescriptorSet 0
+                              Decorate 50(g_output) Binding 1
+                              Decorate 56(dispatchId) BuiltIn GlobalInvocationId
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypePointer Function 6(int)
+               8:             TypeRuntimeArray 6(int)
+               9:             TypeStruct 8
+              10:             TypePointer Uniform 9(struct)
+              11:             TypeVector 6(int) 2
+              12:             TypeFunction 11(ivec2) 7(ptr) 10(ptr)
+              17:             TypeFunction 2 7(ptr)
+              21:             TypePointer Function 11(ivec2)
+              23:             TypeInt 32 1
+              24:             TypePointer Function 23(int)
+              27:     23(int) Constant 2
+              29:     23(int) Constant 0
+              31:             TypePointer Uniform 6(int)
+              35:     23(int) Constant 1
+     44(g_input):     10(ptr) Variable Uniform
+              48:             TypeImage 6(int) Buffer nonsampled format:Rg32ui
+              49:             TypePointer UniformConstant 48
+    50(g_output):     49(ptr) Variable UniformConstant
+              55:             TypePointer Input 6(int)
+  56(dispatchId):     55(ptr) Variable Input
+         4(main):           2 Function None 3
+               5:             Label
+  54(dispatchId):      7(ptr) Variable Function
+       58(param):      7(ptr) Variable Function
+              57:      6(int) Load 56(dispatchId)
+                              Store 54(dispatchId) 57
+              59:      6(int) Load 54(dispatchId)
+                              Store 58(param) 59
+              60:           2 FunctionCall 19(@main(u1;) 58(param)
+                              Return
+                              FunctionEnd
+15(testLoad(u1;block--u1[0]1;):   11(ivec2) Function None 12
+         13(loc):      7(ptr) FunctionParameter
+      14(buffer):     10(ptr) FunctionParameter
+              16:             Label
+      22(result):     21(ptr) Variable Function
+25(byteAddrTemp):     24(ptr) Variable Function
+              26:      6(int) Load 13(loc)
+              28:     23(int) ShiftRightLogical 26 27
+                              Store 25(byteAddrTemp) 28
+              30:     23(int) Load 25(byteAddrTemp)
+              32:     31(ptr) AccessChain 14(buffer) 29 30
+              33:      6(int) Load 32
+              34:     23(int) Load 25(byteAddrTemp)
+              36:     23(int) IAdd 34 35
+              37:     31(ptr) AccessChain 14(buffer) 29 36
+              38:      6(int) Load 37
+              39:   11(ivec2) CompositeConstruct 33 38
+                              Store 22(result) 39
+              40:   11(ivec2) Load 22(result)
+                              ReturnValue 40
+                              FunctionEnd
+   19(@main(u1;):           2 Function None 17
+  18(dispatchId):      7(ptr) FunctionParameter
+              20:             Label
+      43(result):     21(ptr) Variable Function
+       45(param):      7(ptr) Variable Function
+              46:      6(int) Load 18(dispatchId)
+                              Store 45(param) 46
+              47:   11(ivec2) FunctionCall 15(testLoad(u1;block--u1[0]1;) 45(param) 44(g_input)
+                              Store 43(result) 47
+              51:          48 Load 50(g_output)
+              52:      6(int) Load 18(dispatchId)
+              53:   11(ivec2) Load 43(result)
+                              ImageWrite 51 52 53
+                              Return
+                              FunctionEnd

+ 323 - 0
3rdparty/glslang/Test/baseResults/hlsl.structbuffer.incdec.frag.out

@@ -0,0 +1,323 @@
+hlsl.structbuffer.incdec.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main(u1; ( temp 4-component vector of float)
+0:7    Function Parameters: 
+0:7      'pos' ( in uint)
+0:?     Sequence
+0:8      Sequence
+0:8        move second child to first child ( temp 4-component vector of uint)
+0:8          'result' ( temp 4-component vector of uint)
+0:8          Constant:
+0:8            0 (const uint)
+0:8            0 (const uint)
+0:8            0 (const uint)
+0:8            0 (const uint)
+0:10      direct 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          'sbuf_rw_i' (layout( row_major std430) 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        Constant:
+0:10          7 (const int)
+0:11      direct index (layout( row_major std430) buffer 4-component vector of uint)
+0:11        @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint)
+0:11          'sbuf_rw_d' (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        Constant:
+0:11          7 (const int)
+0:13      move second child to first child ( temp 4-component vector of uint)
+0:13        direct index (layout( row_major std430) buffer 4-component vector of uint)
+0:13          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint)
+0:13            'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
+0:13            Constant:
+0:13              0 (const uint)
+0:13          Constant:
+0:13            5 (const int)
+0:13        Constant:
+0:13          2 (const uint)
+0:13          2 (const uint)
+0:13          2 (const uint)
+0:13          2 (const uint)
+0:15      Sequence
+0:15        move second child to first child ( temp uint)
+0:15          'c1' ( temp uint)
+0:15          AtomicAdd ( temp uint)
+0:15            @count: direct index for structure ( temp int)
+0:15              'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:15              Constant:
+0:15                0 (const int)
+0:15            Constant:
+0:15              1 (const int)
+0:16      Sequence
+0:16        move second child to first child ( temp uint)
+0:16          'c2' ( temp uint)
+0:16          add ( temp uint)
+0:16            AtomicAdd ( temp uint)
+0:16              @count: direct index for structure ( temp int)
+0:16                'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:16                Constant:
+0:16                  0 (const int)
+0:16              Constant:
+0:16                -1 (const int)
+0:16            Constant:
+0:16              -1 (const int)
+0:18      Branch: Return with expression
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:18          Convert uint to float ( temp float)
+0:18            direct index ( temp uint)
+0:18              'result' ( temp 4-component vector of uint)
+0:18              Constant:
+0:18                0 (const int)
+0:18          Convert uint to float ( temp float)
+0:18            direct index ( temp uint)
+0:18              'result' ( temp 4-component vector of uint)
+0:18              Constant:
+0:18                1 (const int)
+0:18          Convert uint to float ( temp float)
+0:18            'c1' ( temp uint)
+0:18          Convert uint to float ( temp float)
+0:18            'c2' ( temp uint)
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp uint)
+0:?         'pos' ( temp uint)
+0:?         'pos' (layout( location=0) in uint)
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:7        Function Call: @main(u1; ( temp 4-component vector of float)
+0:?           'pos' ( temp uint)
+0:?   Linker Objects
+0:?     'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
+0:?     'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
+0:?     'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:?     'pos' (layout( location=0) in uint)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:7  Function Definition: @main(u1; ( temp 4-component vector of float)
+0:7    Function Parameters: 
+0:7      'pos' ( in uint)
+0:?     Sequence
+0:8      Sequence
+0:8        move second child to first child ( temp 4-component vector of uint)
+0:8          'result' ( temp 4-component vector of uint)
+0:8          Constant:
+0:8            0 (const uint)
+0:8            0 (const uint)
+0:8            0 (const uint)
+0:8            0 (const uint)
+0:10      direct 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          'sbuf_rw_i' (layout( row_major std430) 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        Constant:
+0:10          7 (const int)
+0:11      direct index (layout( row_major std430) buffer 4-component vector of uint)
+0:11        @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint)
+0:11          'sbuf_rw_d' (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        Constant:
+0:11          7 (const int)
+0:13      move second child to first child ( temp 4-component vector of uint)
+0:13        direct index (layout( row_major std430) buffer 4-component vector of uint)
+0:13          @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint)
+0:13            'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
+0:13            Constant:
+0:13              0 (const uint)
+0:13          Constant:
+0:13            5 (const int)
+0:13        Constant:
+0:13          2 (const uint)
+0:13          2 (const uint)
+0:13          2 (const uint)
+0:13          2 (const uint)
+0:15      Sequence
+0:15        move second child to first child ( temp uint)
+0:15          'c1' ( temp uint)
+0:15          AtomicAdd ( temp uint)
+0:15            @count: direct index for structure ( temp int)
+0:15              'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:15              Constant:
+0:15                0 (const int)
+0:15            Constant:
+0:15              1 (const int)
+0:16      Sequence
+0:16        move second child to first child ( temp uint)
+0:16          'c2' ( temp uint)
+0:16          add ( temp uint)
+0:16            AtomicAdd ( temp uint)
+0:16              @count: direct index for structure ( temp int)
+0:16                'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:16                Constant:
+0:16                  0 (const int)
+0:16              Constant:
+0:16                -1 (const int)
+0:16            Constant:
+0:16              -1 (const int)
+0:18      Branch: Return with expression
+0:?         Construct vec4 ( temp 4-component vector of float)
+0:18          Convert uint to float ( temp float)
+0:18            direct index ( temp uint)
+0:18              'result' ( temp 4-component vector of uint)
+0:18              Constant:
+0:18                0 (const int)
+0:18          Convert uint to float ( temp float)
+0:18            direct index ( temp uint)
+0:18              'result' ( temp 4-component vector of uint)
+0:18              Constant:
+0:18                1 (const int)
+0:18          Convert uint to float ( temp float)
+0:18            'c1' ( temp uint)
+0:18          Convert uint to float ( temp float)
+0:18            'c2' ( temp uint)
+0:7  Function Definition: main( ( temp void)
+0:7    Function Parameters: 
+0:?     Sequence
+0:7      move second child to first child ( temp uint)
+0:?         'pos' ( temp uint)
+0:?         'pos' (layout( location=0) in uint)
+0:7      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:7        Function Call: @main(u1; ( temp 4-component vector of float)
+0:?           'pos' ( temp uint)
+0:?   Linker Objects
+0:?     'sbuf_rw_i' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
+0:?     'sbuf_rw_i@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'sbuf_rw_d' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
+0:?     'sbuf_rw_d@count' (layout( row_major std430) buffer block{layout( row_major std430) buffer int @count})
+0:?     'sbuf_rw_nocounter' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of uint @data})
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:?     'pos' (layout( location=0) in uint)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 70
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 63 66
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 12  "@main(u1;"
+                              Name 11  "pos"
+                              Name 16  "result"
+                              Name 20  "sbuf_rw_i"
+                              MemberName 20(sbuf_rw_i) 0  "@data"
+                              Name 22  "sbuf_rw_i"
+                              Name 26  "sbuf_rw_d"
+                              Name 27  "sbuf_rw_nocounter"
+                              Name 33  "c1"
+                              Name 34  "sbuf_rw_i@count"
+                              MemberName 34(sbuf_rw_i@count) 0  "@count"
+                              Name 36  "sbuf_rw_i@count"
+                              Name 42  "c2"
+                              Name 43  "sbuf_rw_d@count"
+                              Name 61  "pos"
+                              Name 63  "pos"
+                              Name 66  "@entryPointOutput"
+                              Name 67  "param"
+                              Decorate 19 ArrayStride 16
+                              MemberDecorate 20(sbuf_rw_i) 0 Offset 0
+                              Decorate 20(sbuf_rw_i) BufferBlock
+                              Decorate 22(sbuf_rw_i) DescriptorSet 0
+                              Decorate 26(sbuf_rw_d) DescriptorSet 0
+                              Decorate 27(sbuf_rw_nocounter) DescriptorSet 0
+                              MemberDecorate 34(sbuf_rw_i@count) 0 Offset 0
+                              Decorate 34(sbuf_rw_i@count) BufferBlock
+                              Decorate 36(sbuf_rw_i@count) DescriptorSet 0
+                              Decorate 43(sbuf_rw_d@count) DescriptorSet 0
+                              Decorate 63(pos) Location 0
+                              Decorate 66(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 0
+               7:             TypePointer Function 6(int)
+               8:             TypeFloat 32
+               9:             TypeVector 8(float) 4
+              10:             TypeFunction 9(fvec4) 7(ptr)
+              14:             TypeVector 6(int) 4
+              15:             TypePointer Function 14(ivec4)
+              17:      6(int) Constant 0
+              18:   14(ivec4) ConstantComposite 17 17 17 17
+              19:             TypeRuntimeArray 14(ivec4)
+   20(sbuf_rw_i):             TypeStruct 19
+              21:             TypePointer Uniform 20(sbuf_rw_i)
+   22(sbuf_rw_i):     21(ptr) Variable Uniform
+              23:             TypeInt 32 1
+              24:     23(int) Constant 0
+              25:     23(int) Constant 7
+   26(sbuf_rw_d):     21(ptr) Variable Uniform
+27(sbuf_rw_nocounter):     21(ptr) Variable Uniform
+              28:     23(int) Constant 5
+              29:      6(int) Constant 2
+              30:   14(ivec4) ConstantComposite 29 29 29 29
+              31:             TypePointer Uniform 14(ivec4)
+34(sbuf_rw_i@count):             TypeStruct 23(int)
+              35:             TypePointer Uniform 34(sbuf_rw_i@count)
+36(sbuf_rw_i@count):     35(ptr) Variable Uniform
+              37:             TypePointer Uniform 23(int)
+              39:     23(int) Constant 1
+              40:      6(int) Constant 1
+43(sbuf_rw_d@count):     35(ptr) Variable Uniform
+              45:     23(int) Constant 4294967295
+              62:             TypePointer Input 6(int)
+         63(pos):     62(ptr) Variable Input
+              65:             TypePointer Output 9(fvec4)
+66(@entryPointOutput):     65(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+         61(pos):      7(ptr) Variable Function
+       67(param):      7(ptr) Variable Function
+              64:      6(int) Load 63(pos)
+                              Store 61(pos) 64
+              68:      6(int) Load 61(pos)
+                              Store 67(param) 68
+              69:    9(fvec4) FunctionCall 12(@main(u1;) 67(param)
+                              Store 66(@entryPointOutput) 69
+                              Return
+                              FunctionEnd
+   12(@main(u1;):    9(fvec4) Function None 10
+         11(pos):      7(ptr) FunctionParameter
+              13:             Label
+      16(result):     15(ptr) Variable Function
+          33(c1):      7(ptr) Variable Function
+          42(c2):      7(ptr) Variable Function
+                              Store 16(result) 18
+              32:     31(ptr) AccessChain 27(sbuf_rw_nocounter) 24 28
+                              Store 32 30
+              38:     37(ptr) AccessChain 36(sbuf_rw_i@count) 24
+              41:      6(int) AtomicIAdd 38 40 17 39
+                              Store 33(c1) 41
+              44:     37(ptr) AccessChain 43(sbuf_rw_d@count) 24
+              46:      6(int) AtomicIAdd 44 40 17 45
+              47:      6(int) IAdd 46 45
+                              Store 42(c2) 47
+              48:      7(ptr) AccessChain 16(result) 17
+              49:      6(int) Load 48
+              50:    8(float) ConvertUToF 49
+              51:      7(ptr) AccessChain 16(result) 40
+              52:      6(int) Load 51
+              53:    8(float) ConvertUToF 52
+              54:      6(int) Load 33(c1)
+              55:    8(float) ConvertUToF 54
+              56:      6(int) Load 42(c2)
+              57:    8(float) ConvertUToF 56
+              58:    9(fvec4) CompositeConstruct 50 53 55 57
+                              ReturnValue 58
+                              FunctionEnd

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

@@ -19,7 +19,7 @@ ERROR: 0:112: '#if' : unexpected tokens following directive
 ERROR: 0:117: 'macro expansion' : End of line in macro substitution: FOOM
 ERROR: 0:118: 'preprocessor evaluation' : can't evaluate expression 
 ERROR: 0:118: '#if' : unexpected tokens following directive 
-ERROR: 0:150: '' :  syntax error
+ERROR: 0:150: '' :  syntax error, unexpected EQUAL
 ERROR: 19 compilation errors.  No code generated.
 
 

+ 80 - 76
3rdparty/glslang/Test/baseResults/spv.ssbo.autoassign.frag.out

@@ -1,12 +1,12 @@
 spv.ssbo.autoassign.frag
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 95
+// Id's are bound by 99
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 88 91
+                              EntryPoint Fragment 4  "main" 92 95
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "main"
@@ -23,13 +23,13 @@ spv.ssbo.autoassign.frag
                               MemberName 26(TestCB) 0  "W"
                               MemberName 26(TestCB) 1  "H"
                               Name 28  ""
-                              Name 55  "SB1"
-                              MemberName 55(SB1) 0  "@data"
                               Name 57  "SB1"
-                              Name 86  "pos"
-                              Name 88  "pos"
-                              Name 91  "@entryPointOutput"
-                              Name 92  "param"
+                              MemberName 57(SB1) 0  "@data"
+                              Name 59  "SB1"
+                              Name 90  "pos"
+                              Name 92  "pos"
+                              Name 95  "@entryPointOutput"
+                              Name 96  "param"
                               MemberDecorate 14(BufType) 0 NonWritable
                               MemberDecorate 14(BufType) 0 Offset 0
                               MemberDecorate 14(BufType) 1 NonWritable
@@ -45,13 +45,13 @@ spv.ssbo.autoassign.frag
                               Decorate 26(TestCB) Block
                               Decorate 28 DescriptorSet 0
                               Decorate 28 Binding 15
-                              Decorate 54 ArrayStride 32
-                              MemberDecorate 55(SB1) 0 Offset 0
-                              Decorate 55(SB1) BufferBlock
-                              Decorate 57(SB1) DescriptorSet 0
-                              Decorate 57(SB1) Binding 31
-                              Decorate 88(pos) Location 0
-                              Decorate 91(@entryPointOutput) Location 0
+                              Decorate 56 ArrayStride 32
+                              MemberDecorate 57(SB1) 0 Offset 0
+                              Decorate 57(SB1) BufferBlock
+                              Decorate 59(SB1) DescriptorSet 0
+                              Decorate 59(SB1) Binding 31
+                              Decorate 92(pos) Location 0
+                              Decorate 95(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -73,26 +73,26 @@ spv.ssbo.autoassign.frag
               28:     27(ptr) Variable Uniform
               29:             TypePointer Uniform 21(int)
               34:     21(int) Constant 0
-              38:             TypePointer Uniform 7(fvec4)
-              50:     19(int) Constant 1
-              54:             TypeRuntimeArray 14(BufType)
-         55(SB1):             TypeStruct 54
-              56:             TypePointer Uniform 55(SB1)
-         57(SB1):     56(ptr) Variable Uniform
-              87:             TypePointer Input 7(fvec4)
-         88(pos):     87(ptr) Variable Input
-              90:             TypePointer Output 7(fvec4)
-91(@entryPointOutput):     90(ptr) Variable Output
+              39:             TypePointer Uniform 7(fvec4)
+              52:     19(int) Constant 1
+              56:             TypeRuntimeArray 14(BufType)
+         57(SB1):             TypeStruct 56
+              58:             TypePointer Uniform 57(SB1)
+         59(SB1):     58(ptr) Variable Uniform
+              91:             TypePointer Input 7(fvec4)
+         92(pos):     91(ptr) Variable Input
+              94:             TypePointer Output 7(fvec4)
+95(@entryPointOutput):     94(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
-         86(pos):      8(ptr) Variable Function
-       92(param):      8(ptr) Variable Function
-              89:    7(fvec4) Load 88(pos)
-                              Store 86(pos) 89
-              93:    7(fvec4) Load 86(pos)
-                              Store 92(param) 93
-              94:    7(fvec4) FunctionCall 11(@main(vf4;) 92(param)
-                              Store 91(@entryPointOutput) 94
+         90(pos):      8(ptr) Variable Function
+       96(param):      8(ptr) Variable Function
+              93:    7(fvec4) Load 92(pos)
+                              Store 90(pos) 93
+              97:    7(fvec4) Load 90(pos)
+                              Store 96(param) 97
+              98:    7(fvec4) FunctionCall 11(@main(vf4;) 96(param)
+                              Store 95(@entryPointOutput) 98
                               Return
                               FunctionEnd
   11(@main(vf4;):    7(fvec4) Function None 9
@@ -108,47 +108,51 @@ spv.ssbo.autoassign.frag
               35:     23(ptr) AccessChain 10(pos) 34
               36:    6(float) Load 35
               37:    6(float) FAdd 33 36
-              39:     38(ptr) AccessChain 18(SB0) 20 37 20
-              40:    7(fvec4) Load 39
-              41:     23(ptr) AccessChain 10(pos) 22
-              42:    6(float) Load 41
-              43:     29(ptr) AccessChain 28 20
-              44:     21(int) Load 43
-              45:    6(float) ConvertUToF 44
-              46:    6(float) FMul 42 45
-              47:     23(ptr) AccessChain 10(pos) 34
-              48:    6(float) Load 47
-              49:    6(float) FAdd 46 48
-              51:     38(ptr) AccessChain 18(SB0) 20 49 50
-              52:    7(fvec4) Load 51
-              53:    7(fvec4) FAdd 40 52
-                              Store 13(vTmp) 53
-              58:     23(ptr) AccessChain 10(pos) 22
-              59:    6(float) Load 58
-              60:     29(ptr) AccessChain 28 20
-              61:     21(int) Load 60
-              62:    6(float) ConvertUToF 61
-              63:    6(float) FMul 59 62
-              64:     23(ptr) AccessChain 10(pos) 34
-              65:    6(float) Load 64
-              66:    6(float) FAdd 63 65
-              67:     38(ptr) AccessChain 57(SB1) 20 66 20
-              68:    7(fvec4) Load 67
-              69:     23(ptr) AccessChain 10(pos) 22
-              70:    6(float) Load 69
-              71:     29(ptr) AccessChain 28 20
-              72:     21(int) Load 71
-              73:    6(float) ConvertUToF 72
-              74:    6(float) FMul 70 73
-              75:     23(ptr) AccessChain 10(pos) 34
-              76:    6(float) Load 75
-              77:    6(float) FAdd 74 76
-              78:     38(ptr) AccessChain 57(SB1) 20 77 50
-              79:    7(fvec4) Load 78
-              80:    7(fvec4) FAdd 68 79
-              81:    7(fvec4) Load 13(vTmp)
-              82:    7(fvec4) FAdd 81 80
-                              Store 13(vTmp) 82
-              83:    7(fvec4) Load 13(vTmp)
-                              ReturnValue 83
+              38:     21(int) ConvertFToU 37
+              40:     39(ptr) AccessChain 18(SB0) 20 38 20
+              41:    7(fvec4) Load 40
+              42:     23(ptr) AccessChain 10(pos) 22
+              43:    6(float) Load 42
+              44:     29(ptr) AccessChain 28 20
+              45:     21(int) Load 44
+              46:    6(float) ConvertUToF 45
+              47:    6(float) FMul 43 46
+              48:     23(ptr) AccessChain 10(pos) 34
+              49:    6(float) Load 48
+              50:    6(float) FAdd 47 49
+              51:     21(int) ConvertFToU 50
+              53:     39(ptr) AccessChain 18(SB0) 20 51 52
+              54:    7(fvec4) Load 53
+              55:    7(fvec4) FAdd 41 54
+                              Store 13(vTmp) 55
+              60:     23(ptr) AccessChain 10(pos) 22
+              61:    6(float) Load 60
+              62:     29(ptr) AccessChain 28 20
+              63:     21(int) Load 62
+              64:    6(float) ConvertUToF 63
+              65:    6(float) FMul 61 64
+              66:     23(ptr) AccessChain 10(pos) 34
+              67:    6(float) Load 66
+              68:    6(float) FAdd 65 67
+              69:     21(int) ConvertFToU 68
+              70:     39(ptr) AccessChain 59(SB1) 20 69 20
+              71:    7(fvec4) Load 70
+              72:     23(ptr) AccessChain 10(pos) 22
+              73:    6(float) Load 72
+              74:     29(ptr) AccessChain 28 20
+              75:     21(int) Load 74
+              76:    6(float) ConvertUToF 75
+              77:    6(float) FMul 73 76
+              78:     23(ptr) AccessChain 10(pos) 34
+              79:    6(float) Load 78
+              80:    6(float) FAdd 77 79
+              81:     21(int) ConvertFToU 80
+              82:     39(ptr) AccessChain 59(SB1) 20 81 52
+              83:    7(fvec4) Load 82
+              84:    7(fvec4) FAdd 71 83
+              85:    7(fvec4) Load 13(vTmp)
+              86:    7(fvec4) FAdd 85 84
+                              Store 13(vTmp) 86
+              87:    7(fvec4) Load 13(vTmp)
+                              ReturnValue 87
                               FunctionEnd

+ 68 - 0
3rdparty/glslang/Test/baseResults/spv.storageBuffer.vert.out

@@ -0,0 +1,68 @@
+spv.storageBuffer.vert
+Warning, version 450 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 31
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 13
+                              Source GLSL 450
+                              Name 4  "main"
+                              Name 11  "gl_PerVertex"
+                              MemberName 11(gl_PerVertex) 0  "gl_Position"
+                              MemberName 11(gl_PerVertex) 1  "gl_PointSize"
+                              MemberName 11(gl_PerVertex) 2  "gl_ClipDistance"
+                              MemberName 11(gl_PerVertex) 3  "gl_CullDistance"
+                              Name 13  ""
+                              Name 16  "ub"
+                              MemberName 16(ub) 0  "a"
+                              Name 18  "ubi"
+                              Name 22  "bb"
+                              MemberName 22(bb) 0  "b"
+                              Name 24  "bbi"
+                              MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position
+                              MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize
+                              MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance
+                              MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance
+                              Decorate 11(gl_PerVertex) Block
+                              MemberDecorate 16(ub) 0 Offset 0
+                              Decorate 16(ub) Block
+                              Decorate 18(ubi) DescriptorSet 0
+                              MemberDecorate 22(bb) 0 Offset 0
+                              Decorate 22(bb) Block
+                              Decorate 24(bbi) DescriptorSet 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeInt 32 0
+               9:      8(int) Constant 1
+              10:             TypeArray 6(float) 9
+11(gl_PerVertex):             TypeStruct 7(fvec4) 6(float) 10 10
+              12:             TypePointer Output 11(gl_PerVertex)
+              13:     12(ptr) Variable Output
+              14:             TypeInt 32 1
+              15:     14(int) Constant 0
+          16(ub):             TypeStruct 7(fvec4)
+              17:             TypePointer Uniform 16(ub)
+         18(ubi):     17(ptr) Variable Uniform
+              19:             TypePointer Uniform 7(fvec4)
+          22(bb):             TypeStruct 7(fvec4)
+              23:             TypePointer StorageBuffer 22(bb)
+         24(bbi):     23(ptr) Variable StorageBuffer
+              25:             TypePointer StorageBuffer 7(fvec4)
+              29:             TypePointer Output 7(fvec4)
+         4(main):           2 Function None 3
+               5:             Label
+              20:     19(ptr) AccessChain 18(ubi) 15
+              21:    7(fvec4) Load 20
+              26:     25(ptr) AccessChain 24(bbi) 15
+              27:    7(fvec4) Load 26
+              28:    7(fvec4) FAdd 21 27
+              30:     29(ptr) AccessChain 13 15
+                              Store 30 28
+                              Return
+                              FunctionEnd

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

@@ -1,6 +1,6 @@
 syntaxError.frag
 ERROR: 0:9: 'vec5' : undeclared identifier 
-ERROR: 0:9: '' :  syntax error
+ERROR: 0:9: '' :  syntax error, unexpected IDENTIFIER, expecting COMMA or SEMICOLON
 ERROR: 2 compilation errors.  No code generated.
 
 

+ 57 - 0
3rdparty/glslang/Test/hlsl.automap.frag

@@ -0,0 +1,57 @@
+// Test register class offsets for different resource types
+
+SamplerState       s1 : register(s1);
+SamplerComparisonState s2 : register(s2);
+
+Texture1D <float4> t1 : register(t1);
+Texture2D <float4> t2 : register(t2);
+Texture3D <float4> t3 : register(t3);
+StructuredBuffer<float4> t4 : register(t4);
+ByteAddressBuffer t5 : register(t5);
+Buffer<float4> t6 : register(t6);
+
+RWTexture1D <float4> u1 : register(u1);
+RWTexture2D <float4> u2 : register(u2);
+RWTexture3D <float4> u3 : register(u3);
+
+RWBuffer <float> u4 : register(u4);
+RWByteAddressBuffer u5 : register(u5);
+RWStructuredBuffer<float> u6 : register(u6);
+AppendStructuredBuffer<float> u7 : register(u7);
+ConsumeStructuredBuffer<float> u8 : register(u8);
+
+cbuffer cb : register(b1) {
+    int cb1;
+};
+
+tbuffer tb : register(t7) {
+    int tb1;
+};
+
+float4 main() : SV_Target0
+{
+    t1;
+    t2;
+    t3;
+    t4[0];
+    t5.Load(0);
+    t6;
+
+    s1;
+    s2;
+
+    u1;
+    u2;
+    u3;
+
+    u4[0];
+    u5.Load(0);
+    u6[0];
+    u7;
+    u8;
+
+    cb1;
+    tb1;
+
+    return 0;
+}

+ 9 - 2
3rdparty/glslang/Test/hlsl.conditional.frag

@@ -8,7 +8,14 @@ float4 vectorCond()
 {
     return (c4 ? t4 : f4) +
            (c4 ? t  : f ) +
-           (t4 < f4 ? t4 : f4);
+           (t4 < f4 ? t4 : f4) +
+           (c4 ? t : f4);
+}
+
+float4 scalarCond()
+{
+    float4 ret = t != f ? t * f4 : 1;
+    return ret;
 }
 
 float2 fbSelect(bool2 cnd, float2 src0, float2 src1)
@@ -30,6 +37,6 @@ float4 PixelShaderFunction(float4 input) : COLOR0
     e = a = b ? c = d : 10, b = a ? d = c : 11;
     float4 f;
     f = ret.x < input.y ? c * input : d * input;
-    return e * ret + f + vectorCond() + 
+    return e * ret + f + vectorCond() + scalarCond() +
            float4(fbSelect(bool2(true, false), float2(1.0, 2.0), float2(3.0, 4.0)), 10.0, 10.0);
 }

+ 5 - 2
3rdparty/glslang/Test/hlsl.doLoop.frag

@@ -1,6 +1,9 @@
-float4 PixelShaderFunction(float4 input) : COLOR0
+float4 PixelShaderFunction(float input) : COLOR0
 {
     [unroll] do {} while (false);
     [unroll] do {;} while (false);
-    do { return input; } while (all(input == input));
+    do { return (float4)input; } while (input > 2.0);
+    do ++input; while (input < 10.0);
+    do while (++input < 10.0); while (++input < 10.0); // nest while inside do-while
+    return (float4)input;
 }

+ 12 - 0
3rdparty/glslang/Test/hlsl.samplecmp.negative.frag

@@ -0,0 +1,12 @@
+
+Texture2D g_shadowTex;
+SamplerState g_shadowSampler;
+SamplerComparisonState g_shadowSamplerComp;
+
+float4 main() : SV_Target0
+{
+    g_shadowTex.SampleCmp(g_shadowSamplerComp, float2(0,0), 0); // OK
+    g_shadowTex.SampleCmp(g_shadowSampler, float2(0,0), 0);     // ERROR (should be comparison sampler)
+
+    return 0;
+}

+ 10 - 0
3rdparty/glslang/Test/hlsl.samplecmp.negative2.frag

@@ -0,0 +1,10 @@
+
+Texture2D g_shadowTex;
+SamplerState g_shadowSampler;
+
+float4 main() : SV_Target0
+{
+    g_shadowTex.GatherCmpRed(g_shadowSampler, float2(0,0), 0, int2(0,0));  // ERROR (should be comparison sampler)
+
+    return 0;
+}

+ 15 - 0
3rdparty/glslang/Test/hlsl.shapeConv.frag

@@ -30,5 +30,20 @@ float4 PixelShaderFunction(float4 input, float f) : COLOR0
 
     const float4 f4 = 3.0;
 
+    uint ui;
+    uint3 ui3;
+
+    ui >> ui3;
+    ui3 >> ui;
+
+    v *= f1;
+    f1 *= v;
+
+    float3 mixed = u * v;
+    f = u;
+    f1 = u;
+    float sf = v;
+    float1 sf1 = v;
+
     return input * f4;
 }

+ 11 - 0
3rdparty/glslang/Test/hlsl.structbuffer.append.frag

@@ -0,0 +1,11 @@
+AppendStructuredBuffer<float4>  sbuf_a;
+ConsumeStructuredBuffer<float4> sbuf_c;
+
+AppendStructuredBuffer<float4>  sbuf_unused;
+
+float4 main(uint pos : FOO) : SV_Target0
+{
+    sbuf_a.Append(float4(1,2,3,4));
+
+    return sbuf_c.Consume();
+}

+ 19 - 0
3rdparty/glslang/Test/hlsl.structbuffer.floatidx.comp

@@ -0,0 +1,19 @@
+struct sb_t
+{
+    float4 color;
+    uint2  threadId;
+};
+
+RWTexture2D<float4> outtx;
+ConsumeStructuredBuffer<sb_t> csb : register(u1);
+RWStructuredBuffer<float4> rwsb;
+
+[numthreads(1, 1, 1)]
+void main(uint3 nThreadId : SV_DispatchThreadID)
+{
+    sb_t data = csb.Consume();
+    float2 coord = float2(data.threadId.xy);
+    outtx[coord] = data.color;
+
+    rwsb[coord.x] = rwsb.Load(coord.y);
+}

+ 15 - 0
3rdparty/glslang/Test/hlsl.structbuffer.fn2.comp

@@ -0,0 +1,15 @@
+ByteAddressBuffer g_input: register(t0);
+RWBuffer<uint2> g_output : register(u1);
+
+uint2 testLoad(uint loc, ByteAddressBuffer buffer)
+{
+    uint2 result = buffer.Load2(loc);
+    return result;
+}
+
+[numthreads(256, 1, 1)]
+void main(uint dispatchId : SV_DispatchThreadID)
+{
+    uint2 result = testLoad(dispatchId, g_input);
+    g_output[dispatchId] = result;
+}

+ 19 - 0
3rdparty/glslang/Test/hlsl.structbuffer.incdec.frag

@@ -0,0 +1,19 @@
+RWStructuredBuffer<uint4>      sbuf_rw_i;
+RWStructuredBuffer<uint4>      sbuf_rw_d;
+
+RWStructuredBuffer<uint4>      sbuf_rw_nocounter; // doesn't use inc or dec
+
+float4 main(uint pos : FOO) : SV_Target0
+{
+    uint4 result = 0;
+
+    sbuf_rw_i[7];
+    sbuf_rw_d[7];
+
+    sbuf_rw_nocounter[5] = 2;
+
+    uint c1 = sbuf_rw_i.IncrementCounter();
+    uint c2 = sbuf_rw_d.DecrementCounter();
+
+    return float4(result.x, result.y, c1, c2);
+}

+ 2 - 1
3rdparty/glslang/Test/runtests

@@ -35,7 +35,8 @@ $EXE -D -e flizv -l -q -C -V hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.v
 diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1
 $EXE -D -e main -l -q -C -V hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out
 diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1
-
+$EXE -D -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main hlsl.automap.frag > $TARGETDIR/hlsl.automap.frag.out
+diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASERROR=1
 
 #
 # multi-threaded test

+ 16 - 0
3rdparty/glslang/Test/spv.storageBuffer.vert

@@ -0,0 +1,16 @@
+#version 450
+
+#pragma use_storage_buffer
+
+uniform ub {
+    vec4 a;
+} ubi;
+
+buffer bb {
+    vec4 b;
+} bbi;
+
+void main()
+{
+    gl_Position = ubi.a + bbi.b;
+}

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

@@ -223,6 +223,13 @@ enum TBuiltInVariable {
     EbvOutputPatch,
     EbvInputPatch,
 
+    // structbuffer types
+    EbvAppendConsume, // no need to differentiate append and consume
+    EbvRWStructuredBuffer,
+    EbvStructuredBuffer,
+    EbvByteAddressBuffer,
+    EbvRWByteAddressBuffer,
+
     EbvLast
 };
 

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

@@ -633,6 +633,10 @@ enum TOperator {
     EOpMethodStore2,                     // ...
     EOpMethodStore3,                     // ...
     EOpMethodStore4,                     // ...
+    EOpMethodIncrementCounter,           // ...
+    EOpMethodDecrementCounter,           // ...
+    // EOpMethodAppend is defined for geo shaders below
+    EOpMethodConsume,
 
     // SM5 texture methods
     EOpMethodGatherRed,                  // These are covered under the above EOpMethodSample comment about

+ 153 - 26
3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp

@@ -130,8 +130,9 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn
     }
 
     // Convert the children's type shape to be compatible.
-    right = addShapeConversion(op,  left->getType(), right);
-    left  = addShapeConversion(op, right->getType(),  left);
+    addBiShapeConversion(op, left, right);
+    if (left == nullptr || right == nullptr)
+        return nullptr;
 
     //
     // Need a new node holding things together.  Make
@@ -238,7 +239,7 @@ TIntermTyped* TIntermediate::addAssign(TOperator op, TIntermTyped* left, TInterm
         return nullptr;
 
     // convert shape
-    right = addShapeConversion(op, left->getType(), right);
+    right = addUniShapeConversion(op, left->getType(), right);
 
     // build the node
     TIntermBinary* node = addBinaryNode(op, left, right, loc);
@@ -788,7 +789,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
 }
 
 // Convert the node's shape of type for the given type, as allowed by the
-// operation involved: 'op'.
+// operation involved: 'op'.  This is for situations where there is only one
+// direction to consider doing the shape conversion.
+//
+// This implements policy, it call addShapeConversion() for the mechanism.
 //
 // Generally, the AST represents allowed GLSL shapes, so this isn't needed
 // for GLSL.  Bad shapes are caught in conversion or promotion.
@@ -796,7 +800,7 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
 // Return 'node' if no conversion was done. Promotion handles final shape
 // checking.
 //
-TIntermTyped* TIntermediate::addShapeConversion(TOperator op, const TType& type, TIntermTyped* node)
+TIntermTyped* TIntermediate::addUniShapeConversion(TOperator op, const TType& type, TIntermTyped* node)
 {
     // some source languages don't do this
     switch (source) {
@@ -809,23 +813,142 @@ TIntermTyped* TIntermediate::addShapeConversion(TOperator op, const TType& type,
 
     // some operations don't do this
     switch (op) {
+    case EOpFunctionCall:
+    case EOpReturn:
+        break;
+
+    case EOpMulAssign:
+        // want to support vector *= scalar native ops in AST and lower, not smear, similarly for
+        // matrix *= scalar, etc.
+
+    case EOpAddAssign:
+    case EOpSubAssign:
+    case EOpDivAssign:
+    case EOpAndAssign:
+    case EOpInclusiveOrAssign:
+    case EOpExclusiveOrAssign:
+    case EOpRightShiftAssign:
+    case EOpLeftShiftAssign:
+        if (node->getVectorSize() == 1)
+            return node;
+        break;
+
     case EOpAssign:
+        break;
+
+    case EOpMix:
+        break;
+
+    default:
+        return node;
+    }
+
+    return addShapeConversion(type, node);
+}
+
+// Convert the nodes' shapes to be compatible for the operation 'op'.
+//
+// This implements policy, it call addShapeConversion() for the mechanism.
+//
+// Generally, the AST represents allowed GLSL shapes, so this isn't needed
+// for GLSL.  Bad shapes are caught in conversion or promotion.
+//
+void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode)
+{
+    // some source languages don't do this
+    switch (source) {
+    case EShSourceHlsl:
+        break;
+    case EShSourceGlsl:
+    default:
+        return;
+    }
+
+    // some operations don't do this
+    // 'break' will mean attempt bidirectional conversion
+    switch (op) {
+    case EOpMulAssign:
+    case EOpAssign:
+    case EOpAddAssign:
+    case EOpSubAssign:
+    case EOpDivAssign:
+    case EOpAndAssign:
+    case EOpInclusiveOrAssign:
+    case EOpExclusiveOrAssign:
+    case EOpRightShiftAssign:
+    case EOpLeftShiftAssign:
+        // switch to unidirectional conversion (the lhs can't change)
+        rhsNode = addUniShapeConversion(op, lhsNode->getType(), rhsNode);
+        return;
+
+    case EOpAdd:
+    case EOpSub:
+    case EOpMul:
+    case EOpDiv:
+        // want to support vector * scalar native ops in AST and lower, not smear, similarly for
+        // matrix * vector, etc.
+        if (lhsNode->getVectorSize() == 1 || rhsNode->getVectorSize() == 1)
+            return;
+        break;
+
+    case EOpRightShift:
+    case EOpLeftShift:
+        // can natively support the right operand being a scalar and the left a vector,
+        // but not the reverse
+        if (rhsNode->getVectorSize() == 1)
+            return;
+        break;
+
     case EOpLessThan:
     case EOpGreaterThan:
     case EOpLessThanEqual:
     case EOpGreaterThanEqual:
+
     case EOpEqual:
     case EOpNotEqual:
-    case EOpFunctionCall:
-    case EOpReturn:
+
     case EOpLogicalAnd:
     case EOpLogicalOr:
     case EOpLogicalXor:
+
+    case EOpAnd:
+    case EOpInclusiveOr:
+    case EOpExclusiveOr:
+
+    case EOpMix:
         break;
+
     default:
-        return node;
+        return;
     }
 
+    // Do bidirectional conversions
+    if (lhsNode->getType().isScalarOrVec1() || rhsNode->getType().isScalarOrVec1()) {
+        if (lhsNode->getType().isScalarOrVec1())
+            lhsNode = addShapeConversion(rhsNode->getType(), lhsNode);
+        else
+            rhsNode = addShapeConversion(lhsNode->getType(), rhsNode);
+    }
+    lhsNode = addShapeConversion(rhsNode->getType(), lhsNode);
+    rhsNode = addShapeConversion(lhsNode->getType(), rhsNode);
+}
+
+// Convert the node's shape of type for the given type. It's not necessarily
+// an error if they are different and not converted, as some operations accept
+// mixed types.  Promotion will do final shape checking.
+//
+// If there is a chance of two nodes, with conversions possible in each direction,
+// the policy for what to ask for must be in the caller; this will do what is asked.
+//
+// Return 'node' if no conversion was done. Promotion handles final shape
+// checking.
+//
+TIntermTyped* TIntermediate::addShapeConversion(const TType& type, TIntermTyped* node)
+{
+    // no conversion needed
+    if (node->getType() == type)
+        return node;
+
     // structures and arrays don't change shape, either to or from
     if (node->getType().isStruct() || node->getType().isArray() ||
         type.isStruct() || type.isArray())
@@ -834,12 +957,12 @@ TIntermTyped* TIntermediate::addShapeConversion(TOperator op, const TType& type,
     // The new node that handles the conversion
     TOperator constructorOp = mapTypeToConstructorOp(type);
 
-    // scalar -> smeared -> vector, or
-    // vec1 -> scalar, or
-    // bigger vector -> smaller vector or scalar
-    if ((type.isVector() && node->getType().isScalar()) ||
-        (node->getType().isVector() && node->getVectorSize() == 1 && type.isScalar()) ||
-        (node->getVectorSize() > type.getVectorSize() && type.isVector()))
+    // scalar -> vector or vec1 -> vector or
+    // vector -> scalar or
+    // bigger vector -> smaller vector
+    if ((node->getType().isScalarOrVec1() && type.isVector()) ||
+        (node->getType().isVector() && type.isScalar()) ||
+        (node->isVector() && type.isVector() && node->getVectorSize() > type.getVectorSize()))
         return setAggregateOperator(makeAggregate(node), constructorOp, type, node->getLoc());
 
     return node;
@@ -1304,19 +1427,17 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
             return nullptr;
     }
 
-    // After conversion, types have to match.
-    if (falseBlock->getType() != trueBlock->getType())
-        return nullptr;
-
     // Handle a vector condition as a mix
     if (!cond->getType().isScalarOrVec1()) {
         TType targetVectorType(trueBlock->getType().getBasicType(), EvqTemporary,
                                cond->getType().getVectorSize());
-        // smear true/false operations if needed
-        if (trueBlock->getType().isScalarOrVec1())
-            trueBlock = addShapeConversion(EOpAssign, targetVectorType, trueBlock);
-        if (falseBlock->getType().isScalarOrVec1())
-            falseBlock = addShapeConversion(EOpAssign, targetVectorType, falseBlock);
+        // smear true/false operands as needed
+        trueBlock = addUniShapeConversion(EOpMix, targetVectorType, trueBlock);
+        falseBlock = addUniShapeConversion(EOpMix, targetVectorType, falseBlock);
+
+        // After conversion, types have to match.
+        if (falseBlock->getType() != trueBlock->getType())
+            return nullptr;
 
         // make the mix operation
         TIntermAggregate* mix = makeAggregate(loc);
@@ -1331,6 +1452,13 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
 
     // Now have a scalar condition...
 
+    // Convert true and false expressions to matching types
+    addBiShapeConversion(EOpMix, trueBlock, falseBlock);
+
+    // After conversion, types have to match.
+    if (falseBlock->getType() != trueBlock->getType())
+        return nullptr;
+
     // Eliminate the selection when the condition is a scalar and all operands are constant.
     if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) {
         if (cond->getAsConstantUnion()->getConstArray()[0].getBConst())
@@ -2139,8 +2267,6 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
     case EOpLogicalXor:
         return left->getType() == right->getType();
 
-    // no shifts: they can mix types (scalar int can shift a vector uint, etc.)
-
     case EOpMod:
     case EOpModAssign:
 
@@ -2154,6 +2280,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
     case EOpAdd:
     case EOpSub:
     case EOpDiv:
+
     case EOpAddAssign:
     case EOpSubAssign:
     case EOpDivAssign:
@@ -2178,7 +2305,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
         return true;
 
     // Finish handling the case, for all ops, where there are two vectors of different sizes
-    if (left->isVector() && right->isVector() && left->getVectorSize() != right->getVectorSize())
+    if (left->isVector() && right->isVector() && left->getVectorSize() != right->getVectorSize() && right->getVectorSize() > 1)
         return false;
 
     //

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

@@ -255,6 +255,10 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector<TString>&
             error(loc, "\")\" expected to end 'debug' pragma", "#pragma", "");
             return;
         }
+    } else if (spvVersion.spv > 0 && tokens[0].compare("use_storage_buffer") == 0) {
+        if (tokens.size() != 1)
+            error(loc, "extra tokens", "#pragma", "");
+        intermediate.setUseStorageBuffer();
     }
 }
 

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

@@ -1555,12 +1555,24 @@ void TShader::setSourceEntryPoint(const char* name)
     sourceEntryPointName = name;
 }
 
+// Set binding base for sampler types
 void TShader::setShiftSamplerBinding(unsigned int base) { intermediate->setShiftSamplerBinding(base); }
+// Set binding base for texture types (SRV)
 void TShader::setShiftTextureBinding(unsigned int base) { intermediate->setShiftTextureBinding(base); }
+// Set binding base for image types
 void TShader::setShiftImageBinding(unsigned int base)   { intermediate->setShiftImageBinding(base); }
+// Set binding base for uniform buffer objects (CBV)
 void TShader::setShiftUboBinding(unsigned int base)     { intermediate->setShiftUboBinding(base); }
+// Synonym for setShiftUboBinding, to match HLSL language.
+void TShader::setShiftCbufferBinding(unsigned int base) { intermediate->setShiftUboBinding(base); }
+// Set binding base for UAV (unordered access view)
+void TShader::setShiftUavBinding(unsigned int base)     { intermediate->setShiftUavBinding(base); }
+// Set binding base for SSBOs
 void TShader::setShiftSsboBinding(unsigned int base)    { intermediate->setShiftSsboBinding(base); }
+// Enables binding automapping using TIoMapper
 void TShader::setAutoMapBindings(bool map)              { intermediate->setAutoMapBindings(map); }
+// See comment above TDefaultHlslIoMapper in iomapper.cpp:
+void TShader::setHlslIoMapping(bool hlslIoMap)          { intermediate->setHlslIoMapping(hlslIoMap); }
 void TShader::setFlattenUniformArrays(bool flatten)     { intermediate->setFlattenUniformArrays(flatten); }
 void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); }
 
@@ -1778,6 +1790,7 @@ const char* TProgram::getUniformBlockName(int index) const   { return reflection
 int TProgram::getUniformBlockSize(int index) const           { return reflection->getUniformBlock(index).size; }
 int TProgram::getUniformIndex(const char* name) const        { return reflection->getIndex(name); }
 int TProgram::getUniformBlockIndex(int index) const          { return reflection->getUniform(index).index; }
+int TProgram::getUniformBlockCounterIndex(int index) const   { return reflection->getUniformBlock(index).counterIndex; }
 int TProgram::getUniformType(int index) const                { return reflection->getUniform(index).glDefineType; }
 int TProgram::getUniformBufferOffset(int index) const        { return reflection->getUniform(index).offset; }
 int TProgram::getUniformArraySize(int index) const           { return reflection->getUniform(index).size; }

+ 2 - 0
3rdparty/glslang/glslang/MachineIndependent/glslang.y

@@ -63,6 +63,8 @@ using namespace glslang;
 
 %}
 
+%define parse.error verbose
+
 %union {
     struct {
         glslang::TSourceLoc loc;

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 432 - 590
3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp


+ 308 - 321
3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h

@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.7.  */
+/* A Bison parser, made by GNU Bison 3.0.4.  */
 
 /* Bison interface for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -26,13 +26,13 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
-#ifndef YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
-# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
-/* Enabling traces.  */
+#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
+# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED
+/* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 1
 #endif
@@ -40,306 +40,305 @@
 extern int yydebug;
 #endif
 
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     ATTRIBUTE = 258,
-     VARYING = 259,
-     CONST = 260,
-     BOOL = 261,
-     FLOAT = 262,
-     DOUBLE = 263,
-     INT = 264,
-     UINT = 265,
-     INT64_T = 266,
-     UINT64_T = 267,
-     FLOAT16_T = 268,
-     BREAK = 269,
-     CONTINUE = 270,
-     DO = 271,
-     ELSE = 272,
-     FOR = 273,
-     IF = 274,
-     DISCARD = 275,
-     RETURN = 276,
-     SWITCH = 277,
-     CASE = 278,
-     DEFAULT = 279,
-     SUBROUTINE = 280,
-     BVEC2 = 281,
-     BVEC3 = 282,
-     BVEC4 = 283,
-     IVEC2 = 284,
-     IVEC3 = 285,
-     IVEC4 = 286,
-     I64VEC2 = 287,
-     I64VEC3 = 288,
-     I64VEC4 = 289,
-     UVEC2 = 290,
-     UVEC3 = 291,
-     UVEC4 = 292,
-     U64VEC2 = 293,
-     U64VEC3 = 294,
-     U64VEC4 = 295,
-     VEC2 = 296,
-     VEC3 = 297,
-     VEC4 = 298,
-     MAT2 = 299,
-     MAT3 = 300,
-     MAT4 = 301,
-     CENTROID = 302,
-     IN = 303,
-     OUT = 304,
-     INOUT = 305,
-     UNIFORM = 306,
-     PATCH = 307,
-     SAMPLE = 308,
-     BUFFER = 309,
-     SHARED = 310,
-     COHERENT = 311,
-     VOLATILE = 312,
-     RESTRICT = 313,
-     READONLY = 314,
-     WRITEONLY = 315,
-     DVEC2 = 316,
-     DVEC3 = 317,
-     DVEC4 = 318,
-     DMAT2 = 319,
-     DMAT3 = 320,
-     DMAT4 = 321,
-     F16VEC2 = 322,
-     F16VEC3 = 323,
-     F16VEC4 = 324,
-     F16MAT2 = 325,
-     F16MAT3 = 326,
-     F16MAT4 = 327,
-     NOPERSPECTIVE = 328,
-     FLAT = 329,
-     SMOOTH = 330,
-     LAYOUT = 331,
-     __EXPLICITINTERPAMD = 332,
-     MAT2X2 = 333,
-     MAT2X3 = 334,
-     MAT2X4 = 335,
-     MAT3X2 = 336,
-     MAT3X3 = 337,
-     MAT3X4 = 338,
-     MAT4X2 = 339,
-     MAT4X3 = 340,
-     MAT4X4 = 341,
-     DMAT2X2 = 342,
-     DMAT2X3 = 343,
-     DMAT2X4 = 344,
-     DMAT3X2 = 345,
-     DMAT3X3 = 346,
-     DMAT3X4 = 347,
-     DMAT4X2 = 348,
-     DMAT4X3 = 349,
-     DMAT4X4 = 350,
-     F16MAT2X2 = 351,
-     F16MAT2X3 = 352,
-     F16MAT2X4 = 353,
-     F16MAT3X2 = 354,
-     F16MAT3X3 = 355,
-     F16MAT3X4 = 356,
-     F16MAT4X2 = 357,
-     F16MAT4X3 = 358,
-     F16MAT4X4 = 359,
-     ATOMIC_UINT = 360,
-     SAMPLER1D = 361,
-     SAMPLER2D = 362,
-     SAMPLER3D = 363,
-     SAMPLERCUBE = 364,
-     SAMPLER1DSHADOW = 365,
-     SAMPLER2DSHADOW = 366,
-     SAMPLERCUBESHADOW = 367,
-     SAMPLER1DARRAY = 368,
-     SAMPLER2DARRAY = 369,
-     SAMPLER1DARRAYSHADOW = 370,
-     SAMPLER2DARRAYSHADOW = 371,
-     ISAMPLER1D = 372,
-     ISAMPLER2D = 373,
-     ISAMPLER3D = 374,
-     ISAMPLERCUBE = 375,
-     ISAMPLER1DARRAY = 376,
-     ISAMPLER2DARRAY = 377,
-     USAMPLER1D = 378,
-     USAMPLER2D = 379,
-     USAMPLER3D = 380,
-     USAMPLERCUBE = 381,
-     USAMPLER1DARRAY = 382,
-     USAMPLER2DARRAY = 383,
-     SAMPLER2DRECT = 384,
-     SAMPLER2DRECTSHADOW = 385,
-     ISAMPLER2DRECT = 386,
-     USAMPLER2DRECT = 387,
-     SAMPLERBUFFER = 388,
-     ISAMPLERBUFFER = 389,
-     USAMPLERBUFFER = 390,
-     SAMPLERCUBEARRAY = 391,
-     SAMPLERCUBEARRAYSHADOW = 392,
-     ISAMPLERCUBEARRAY = 393,
-     USAMPLERCUBEARRAY = 394,
-     SAMPLER2DMS = 395,
-     ISAMPLER2DMS = 396,
-     USAMPLER2DMS = 397,
-     SAMPLER2DMSARRAY = 398,
-     ISAMPLER2DMSARRAY = 399,
-     USAMPLER2DMSARRAY = 400,
-     SAMPLEREXTERNALOES = 401,
-     SAMPLER = 402,
-     SAMPLERSHADOW = 403,
-     TEXTURE1D = 404,
-     TEXTURE2D = 405,
-     TEXTURE3D = 406,
-     TEXTURECUBE = 407,
-     TEXTURE1DARRAY = 408,
-     TEXTURE2DARRAY = 409,
-     ITEXTURE1D = 410,
-     ITEXTURE2D = 411,
-     ITEXTURE3D = 412,
-     ITEXTURECUBE = 413,
-     ITEXTURE1DARRAY = 414,
-     ITEXTURE2DARRAY = 415,
-     UTEXTURE1D = 416,
-     UTEXTURE2D = 417,
-     UTEXTURE3D = 418,
-     UTEXTURECUBE = 419,
-     UTEXTURE1DARRAY = 420,
-     UTEXTURE2DARRAY = 421,
-     TEXTURE2DRECT = 422,
-     ITEXTURE2DRECT = 423,
-     UTEXTURE2DRECT = 424,
-     TEXTUREBUFFER = 425,
-     ITEXTUREBUFFER = 426,
-     UTEXTUREBUFFER = 427,
-     TEXTURECUBEARRAY = 428,
-     ITEXTURECUBEARRAY = 429,
-     UTEXTURECUBEARRAY = 430,
-     TEXTURE2DMS = 431,
-     ITEXTURE2DMS = 432,
-     UTEXTURE2DMS = 433,
-     TEXTURE2DMSARRAY = 434,
-     ITEXTURE2DMSARRAY = 435,
-     UTEXTURE2DMSARRAY = 436,
-     SUBPASSINPUT = 437,
-     SUBPASSINPUTMS = 438,
-     ISUBPASSINPUT = 439,
-     ISUBPASSINPUTMS = 440,
-     USUBPASSINPUT = 441,
-     USUBPASSINPUTMS = 442,
-     IMAGE1D = 443,
-     IIMAGE1D = 444,
-     UIMAGE1D = 445,
-     IMAGE2D = 446,
-     IIMAGE2D = 447,
-     UIMAGE2D = 448,
-     IMAGE3D = 449,
-     IIMAGE3D = 450,
-     UIMAGE3D = 451,
-     IMAGE2DRECT = 452,
-     IIMAGE2DRECT = 453,
-     UIMAGE2DRECT = 454,
-     IMAGECUBE = 455,
-     IIMAGECUBE = 456,
-     UIMAGECUBE = 457,
-     IMAGEBUFFER = 458,
-     IIMAGEBUFFER = 459,
-     UIMAGEBUFFER = 460,
-     IMAGE1DARRAY = 461,
-     IIMAGE1DARRAY = 462,
-     UIMAGE1DARRAY = 463,
-     IMAGE2DARRAY = 464,
-     IIMAGE2DARRAY = 465,
-     UIMAGE2DARRAY = 466,
-     IMAGECUBEARRAY = 467,
-     IIMAGECUBEARRAY = 468,
-     UIMAGECUBEARRAY = 469,
-     IMAGE2DMS = 470,
-     IIMAGE2DMS = 471,
-     UIMAGE2DMS = 472,
-     IMAGE2DMSARRAY = 473,
-     IIMAGE2DMSARRAY = 474,
-     UIMAGE2DMSARRAY = 475,
-     STRUCT = 476,
-     VOID = 477,
-     WHILE = 478,
-     IDENTIFIER = 479,
-     TYPE_NAME = 480,
-     FLOATCONSTANT = 481,
-     DOUBLECONSTANT = 482,
-     INTCONSTANT = 483,
-     UINTCONSTANT = 484,
-     INT64CONSTANT = 485,
-     UINT64CONSTANT = 486,
-     BOOLCONSTANT = 487,
-     FLOAT16CONSTANT = 488,
-     LEFT_OP = 489,
-     RIGHT_OP = 490,
-     INC_OP = 491,
-     DEC_OP = 492,
-     LE_OP = 493,
-     GE_OP = 494,
-     EQ_OP = 495,
-     NE_OP = 496,
-     AND_OP = 497,
-     OR_OP = 498,
-     XOR_OP = 499,
-     MUL_ASSIGN = 500,
-     DIV_ASSIGN = 501,
-     ADD_ASSIGN = 502,
-     MOD_ASSIGN = 503,
-     LEFT_ASSIGN = 504,
-     RIGHT_ASSIGN = 505,
-     AND_ASSIGN = 506,
-     XOR_ASSIGN = 507,
-     OR_ASSIGN = 508,
-     SUB_ASSIGN = 509,
-     LEFT_PAREN = 510,
-     RIGHT_PAREN = 511,
-     LEFT_BRACKET = 512,
-     RIGHT_BRACKET = 513,
-     LEFT_BRACE = 514,
-     RIGHT_BRACE = 515,
-     DOT = 516,
-     COMMA = 517,
-     COLON = 518,
-     EQUAL = 519,
-     SEMICOLON = 520,
-     BANG = 521,
-     DASH = 522,
-     TILDE = 523,
-     PLUS = 524,
-     STAR = 525,
-     SLASH = 526,
-     PERCENT = 527,
-     LEFT_ANGLE = 528,
-     RIGHT_ANGLE = 529,
-     VERTICAL_BAR = 530,
-     CARET = 531,
-     AMPERSAND = 532,
-     QUESTION = 533,
-     INVARIANT = 534,
-     PRECISE = 535,
-     HIGH_PRECISION = 536,
-     MEDIUM_PRECISION = 537,
-     LOW_PRECISION = 538,
-     PRECISION = 539,
-     PACKED = 540,
-     RESOURCE = 541,
-     SUPERP = 542
-   };
+  enum yytokentype
+  {
+    ATTRIBUTE = 258,
+    VARYING = 259,
+    CONST = 260,
+    BOOL = 261,
+    FLOAT = 262,
+    DOUBLE = 263,
+    INT = 264,
+    UINT = 265,
+    INT64_T = 266,
+    UINT64_T = 267,
+    FLOAT16_T = 268,
+    BREAK = 269,
+    CONTINUE = 270,
+    DO = 271,
+    ELSE = 272,
+    FOR = 273,
+    IF = 274,
+    DISCARD = 275,
+    RETURN = 276,
+    SWITCH = 277,
+    CASE = 278,
+    DEFAULT = 279,
+    SUBROUTINE = 280,
+    BVEC2 = 281,
+    BVEC3 = 282,
+    BVEC4 = 283,
+    IVEC2 = 284,
+    IVEC3 = 285,
+    IVEC4 = 286,
+    I64VEC2 = 287,
+    I64VEC3 = 288,
+    I64VEC4 = 289,
+    UVEC2 = 290,
+    UVEC3 = 291,
+    UVEC4 = 292,
+    U64VEC2 = 293,
+    U64VEC3 = 294,
+    U64VEC4 = 295,
+    VEC2 = 296,
+    VEC3 = 297,
+    VEC4 = 298,
+    MAT2 = 299,
+    MAT3 = 300,
+    MAT4 = 301,
+    CENTROID = 302,
+    IN = 303,
+    OUT = 304,
+    INOUT = 305,
+    UNIFORM = 306,
+    PATCH = 307,
+    SAMPLE = 308,
+    BUFFER = 309,
+    SHARED = 310,
+    COHERENT = 311,
+    VOLATILE = 312,
+    RESTRICT = 313,
+    READONLY = 314,
+    WRITEONLY = 315,
+    DVEC2 = 316,
+    DVEC3 = 317,
+    DVEC4 = 318,
+    DMAT2 = 319,
+    DMAT3 = 320,
+    DMAT4 = 321,
+    F16VEC2 = 322,
+    F16VEC3 = 323,
+    F16VEC4 = 324,
+    F16MAT2 = 325,
+    F16MAT3 = 326,
+    F16MAT4 = 327,
+    NOPERSPECTIVE = 328,
+    FLAT = 329,
+    SMOOTH = 330,
+    LAYOUT = 331,
+    __EXPLICITINTERPAMD = 332,
+    MAT2X2 = 333,
+    MAT2X3 = 334,
+    MAT2X4 = 335,
+    MAT3X2 = 336,
+    MAT3X3 = 337,
+    MAT3X4 = 338,
+    MAT4X2 = 339,
+    MAT4X3 = 340,
+    MAT4X4 = 341,
+    DMAT2X2 = 342,
+    DMAT2X3 = 343,
+    DMAT2X4 = 344,
+    DMAT3X2 = 345,
+    DMAT3X3 = 346,
+    DMAT3X4 = 347,
+    DMAT4X2 = 348,
+    DMAT4X3 = 349,
+    DMAT4X4 = 350,
+    F16MAT2X2 = 351,
+    F16MAT2X3 = 352,
+    F16MAT2X4 = 353,
+    F16MAT3X2 = 354,
+    F16MAT3X3 = 355,
+    F16MAT3X4 = 356,
+    F16MAT4X2 = 357,
+    F16MAT4X3 = 358,
+    F16MAT4X4 = 359,
+    ATOMIC_UINT = 360,
+    SAMPLER1D = 361,
+    SAMPLER2D = 362,
+    SAMPLER3D = 363,
+    SAMPLERCUBE = 364,
+    SAMPLER1DSHADOW = 365,
+    SAMPLER2DSHADOW = 366,
+    SAMPLERCUBESHADOW = 367,
+    SAMPLER1DARRAY = 368,
+    SAMPLER2DARRAY = 369,
+    SAMPLER1DARRAYSHADOW = 370,
+    SAMPLER2DARRAYSHADOW = 371,
+    ISAMPLER1D = 372,
+    ISAMPLER2D = 373,
+    ISAMPLER3D = 374,
+    ISAMPLERCUBE = 375,
+    ISAMPLER1DARRAY = 376,
+    ISAMPLER2DARRAY = 377,
+    USAMPLER1D = 378,
+    USAMPLER2D = 379,
+    USAMPLER3D = 380,
+    USAMPLERCUBE = 381,
+    USAMPLER1DARRAY = 382,
+    USAMPLER2DARRAY = 383,
+    SAMPLER2DRECT = 384,
+    SAMPLER2DRECTSHADOW = 385,
+    ISAMPLER2DRECT = 386,
+    USAMPLER2DRECT = 387,
+    SAMPLERBUFFER = 388,
+    ISAMPLERBUFFER = 389,
+    USAMPLERBUFFER = 390,
+    SAMPLERCUBEARRAY = 391,
+    SAMPLERCUBEARRAYSHADOW = 392,
+    ISAMPLERCUBEARRAY = 393,
+    USAMPLERCUBEARRAY = 394,
+    SAMPLER2DMS = 395,
+    ISAMPLER2DMS = 396,
+    USAMPLER2DMS = 397,
+    SAMPLER2DMSARRAY = 398,
+    ISAMPLER2DMSARRAY = 399,
+    USAMPLER2DMSARRAY = 400,
+    SAMPLEREXTERNALOES = 401,
+    SAMPLER = 402,
+    SAMPLERSHADOW = 403,
+    TEXTURE1D = 404,
+    TEXTURE2D = 405,
+    TEXTURE3D = 406,
+    TEXTURECUBE = 407,
+    TEXTURE1DARRAY = 408,
+    TEXTURE2DARRAY = 409,
+    ITEXTURE1D = 410,
+    ITEXTURE2D = 411,
+    ITEXTURE3D = 412,
+    ITEXTURECUBE = 413,
+    ITEXTURE1DARRAY = 414,
+    ITEXTURE2DARRAY = 415,
+    UTEXTURE1D = 416,
+    UTEXTURE2D = 417,
+    UTEXTURE3D = 418,
+    UTEXTURECUBE = 419,
+    UTEXTURE1DARRAY = 420,
+    UTEXTURE2DARRAY = 421,
+    TEXTURE2DRECT = 422,
+    ITEXTURE2DRECT = 423,
+    UTEXTURE2DRECT = 424,
+    TEXTUREBUFFER = 425,
+    ITEXTUREBUFFER = 426,
+    UTEXTUREBUFFER = 427,
+    TEXTURECUBEARRAY = 428,
+    ITEXTURECUBEARRAY = 429,
+    UTEXTURECUBEARRAY = 430,
+    TEXTURE2DMS = 431,
+    ITEXTURE2DMS = 432,
+    UTEXTURE2DMS = 433,
+    TEXTURE2DMSARRAY = 434,
+    ITEXTURE2DMSARRAY = 435,
+    UTEXTURE2DMSARRAY = 436,
+    SUBPASSINPUT = 437,
+    SUBPASSINPUTMS = 438,
+    ISUBPASSINPUT = 439,
+    ISUBPASSINPUTMS = 440,
+    USUBPASSINPUT = 441,
+    USUBPASSINPUTMS = 442,
+    IMAGE1D = 443,
+    IIMAGE1D = 444,
+    UIMAGE1D = 445,
+    IMAGE2D = 446,
+    IIMAGE2D = 447,
+    UIMAGE2D = 448,
+    IMAGE3D = 449,
+    IIMAGE3D = 450,
+    UIMAGE3D = 451,
+    IMAGE2DRECT = 452,
+    IIMAGE2DRECT = 453,
+    UIMAGE2DRECT = 454,
+    IMAGECUBE = 455,
+    IIMAGECUBE = 456,
+    UIMAGECUBE = 457,
+    IMAGEBUFFER = 458,
+    IIMAGEBUFFER = 459,
+    UIMAGEBUFFER = 460,
+    IMAGE1DARRAY = 461,
+    IIMAGE1DARRAY = 462,
+    UIMAGE1DARRAY = 463,
+    IMAGE2DARRAY = 464,
+    IIMAGE2DARRAY = 465,
+    UIMAGE2DARRAY = 466,
+    IMAGECUBEARRAY = 467,
+    IIMAGECUBEARRAY = 468,
+    UIMAGECUBEARRAY = 469,
+    IMAGE2DMS = 470,
+    IIMAGE2DMS = 471,
+    UIMAGE2DMS = 472,
+    IMAGE2DMSARRAY = 473,
+    IIMAGE2DMSARRAY = 474,
+    UIMAGE2DMSARRAY = 475,
+    STRUCT = 476,
+    VOID = 477,
+    WHILE = 478,
+    IDENTIFIER = 479,
+    TYPE_NAME = 480,
+    FLOATCONSTANT = 481,
+    DOUBLECONSTANT = 482,
+    INTCONSTANT = 483,
+    UINTCONSTANT = 484,
+    INT64CONSTANT = 485,
+    UINT64CONSTANT = 486,
+    BOOLCONSTANT = 487,
+    FLOAT16CONSTANT = 488,
+    LEFT_OP = 489,
+    RIGHT_OP = 490,
+    INC_OP = 491,
+    DEC_OP = 492,
+    LE_OP = 493,
+    GE_OP = 494,
+    EQ_OP = 495,
+    NE_OP = 496,
+    AND_OP = 497,
+    OR_OP = 498,
+    XOR_OP = 499,
+    MUL_ASSIGN = 500,
+    DIV_ASSIGN = 501,
+    ADD_ASSIGN = 502,
+    MOD_ASSIGN = 503,
+    LEFT_ASSIGN = 504,
+    RIGHT_ASSIGN = 505,
+    AND_ASSIGN = 506,
+    XOR_ASSIGN = 507,
+    OR_ASSIGN = 508,
+    SUB_ASSIGN = 509,
+    LEFT_PAREN = 510,
+    RIGHT_PAREN = 511,
+    LEFT_BRACKET = 512,
+    RIGHT_BRACKET = 513,
+    LEFT_BRACE = 514,
+    RIGHT_BRACE = 515,
+    DOT = 516,
+    COMMA = 517,
+    COLON = 518,
+    EQUAL = 519,
+    SEMICOLON = 520,
+    BANG = 521,
+    DASH = 522,
+    TILDE = 523,
+    PLUS = 524,
+    STAR = 525,
+    SLASH = 526,
+    PERCENT = 527,
+    LEFT_ANGLE = 528,
+    RIGHT_ANGLE = 529,
+    VERTICAL_BAR = 530,
+    CARET = 531,
+    AMPERSAND = 532,
+    QUESTION = 533,
+    INVARIANT = 534,
+    PRECISE = 535,
+    HIGH_PRECISION = 536,
+    MEDIUM_PRECISION = 537,
+    LOW_PRECISION = 538,
+    PRECISION = 539,
+    PACKED = 540,
+    RESOURCE = 541,
+    SUPERP = 542
+  };
 #endif
 
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+
+union YYSTYPE
 {
-/* Line 2058 of yacc.c  */
-#line 66 "glslang.y"
+#line 68 "MachineIndependent/glslang.y" /* yacc.c:1909  */
 
     struct {
         glslang::TSourceLoc loc;
@@ -373,28 +372,16 @@ typedef union YYSTYPE
         };
     } interm;
 
+#line 376 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909  */
+};
 
-/* Line 2058 of yacc.c  */
-#line 379 "glslang_tab.cpp.h"
-} YYSTYPE;
+typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
 
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
+
 int yyparse (glslang::TParseContext* pParseContext);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
 
-#endif /* !YY_YY_GLSLANG_TAB_CPP_H_INCLUDED  */
+#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED  */

+ 234 - 77
3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp

@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2016 LunarG, Inc.
+// Copyright (C) 2016-2017 LunarG, Inc.
 //
 // All rights reserved.
 //
@@ -310,20 +310,15 @@ private:
     TResolverInOutAdaptor& operator=(TResolverInOutAdaptor&);
 };
 
-/*
- * Basic implementation of glslang::TIoMapResolver that replaces the
- * previous offset behavior.
- * It does the same, uses the offsets for the corresponding uniform
- * types. Also respects the EOptionAutoMapBindings flag and binds
- * them if needed.
- */
-struct TDefaultIoResolver : public glslang::TIoMapResolver
+// Base class for shared TIoMapResolver services, used by several derivations.
+struct TDefaultIoResolverBase : public glslang::TIoMapResolver
 {
     int baseSamplerBinding;
     int baseTextureBinding;
     int baseImageBinding;
     int baseUboBinding;
     int baseSsboBinding;
+    int baseUavBinding;
     bool doAutoMapping;
     typedef std::vector<int> TSlotSet;
     typedef std::unordered_map<int, TSlotSet> TSlotSetMap;
@@ -360,109 +355,259 @@ struct TDefaultIoResolver : public glslang::TIoMapResolver
         return reserveSlot(set, base);
     }
 
+    virtual bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override = 0;
+
+    virtual int resolveBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool is_live) override = 0;
+
+    int resolveSet(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override
+    {
+        if (type.getQualifier().hasSet())
+            return type.getQualifier().layoutSet;
+        return 0;
+    }
+
+    bool validateInOut(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
+    {
+        return true;
+    }
+    int resolveInOutLocation(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
+    {
+        return -1;
+    }
+    int resolveInOutComponent(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
+    {
+        return -1;
+    }
+    int resolveInOutIndex(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
+    {
+        return -1;
+    }
+
+protected:
+    static int getLayoutSet(const glslang::TType& type) {
+        if (type.getQualifier().hasSet())
+            return type.getQualifier().layoutSet;
+        else
+            return 0;
+    }
+
+    static bool isSamplerType(const glslang::TType& type) {
+        return type.getBasicType() == glslang::EbtSampler && type.getSampler().isPureSampler();
+    }
+
+    static bool isTextureType(const glslang::TType& type) {
+        return type.getBasicType() == glslang::EbtSampler && type.getSampler().isTexture();
+    }
+
+    static bool isUboType(const glslang::TType& type) {
+        return type.getQualifier().storage == EvqUniform;
+    }
+};
+
+/*
+ * Basic implementation of glslang::TIoMapResolver that replaces the
+ * previous offset behavior.
+ * It does the same, uses the offsets for the corresponding uniform
+ * types. Also respects the EOptionAutoMapBindings flag and binds
+ * them if needed.
+ */
+/*
+ * Default resolver
+ */
+struct TDefaultIoResolver : public TDefaultIoResolverBase
+{
     bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override
     {
         if (type.getQualifier().hasBinding()) {
-            int set;
-            if (type.getQualifier().hasSet())
-                set = type.getQualifier().layoutSet;
-            else
-                set = 0;
+            const int set = getLayoutSet(type);
 
-            if (type.getBasicType() == glslang::EbtSampler) {
-                const glslang::TSampler& sampler = type.getSampler();
-                if (sampler.isPureSampler())
-                    return checkEmpty(set, baseSamplerBinding + type.getQualifier().layoutBinding);
+            if (isImageType(type))
+                return checkEmpty(set, baseImageBinding + type.getQualifier().layoutBinding);
 
-                if (sampler.isTexture())
-                    return checkEmpty(set, baseTextureBinding + type.getQualifier().layoutBinding);
-            }
-
-            if (type.getQualifier().storage == EvqUniform)
-                return checkEmpty(set, baseUboBinding + type.getQualifier().layoutBinding);
+            if (isTextureType(type))
+                return checkEmpty(set, baseTextureBinding + type.getQualifier().layoutBinding);
 
-            if (type.getQualifier().storage == EvqBuffer)
+            if (isSsboType(type))
                 return checkEmpty(set, baseSsboBinding + type.getQualifier().layoutBinding);
+
+            if (isSamplerType(type))
+                return checkEmpty(set, baseSamplerBinding + type.getQualifier().layoutBinding);
+
+            if (isUboType(type))
+                return checkEmpty(set, baseUboBinding + type.getQualifier().layoutBinding);
         }
         return true;
     }
 
     int resolveBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool is_live) override
     {
-        int set;
-        if (type.getQualifier().hasSet())
-            set = type.getQualifier().layoutSet;
-        else
-            set = 0;
+        const int set = getLayoutSet(type);
 
         if (type.getQualifier().hasBinding()) {
-            if (type.getBasicType() == glslang::EbtSampler) {
-                const glslang::TSampler& sampler = type.getSampler();
-                if (sampler.isImage())
-                    return reserveSlot(set, baseImageBinding + type.getQualifier().layoutBinding);
+            if (isImageType(type))
+                return reserveSlot(set, baseImageBinding + type.getQualifier().layoutBinding);
+                
+            if (isTextureType(type))
+                return reserveSlot(set, baseTextureBinding + type.getQualifier().layoutBinding);
 
-                if (sampler.isPureSampler())
-                    return reserveSlot(set, baseSamplerBinding + type.getQualifier().layoutBinding);
+            if (isSsboType(type))
+                return reserveSlot(set, baseSsboBinding + type.getQualifier().layoutBinding);
 
-                if (sampler.isTexture())
-                    return reserveSlot(set, baseTextureBinding + type.getQualifier().layoutBinding);
-            }
+            if (isSamplerType(type))
+                return reserveSlot(set, baseSamplerBinding + type.getQualifier().layoutBinding);
 
-            if (type.getQualifier().storage == EvqUniform)
+            if (isUboType(type))
                 return reserveSlot(set, baseUboBinding + type.getQualifier().layoutBinding);
-
-            if (type.getQualifier().storage == EvqBuffer)
-                return reserveSlot(set, baseSsboBinding + type.getQualifier().layoutBinding);
         } else if (is_live && doAutoMapping) {
             // find free slot, the caller did make sure it passes all vars with binding
             // first and now all are passed that do not have a binding and needs one
-            if (type.getBasicType() == glslang::EbtSampler) {
-                const glslang::TSampler& sampler = type.getSampler();
-                if (sampler.isImage())
-                    return getFreeSlot(set, baseImageBinding);
-
-                if (sampler.isPureSampler())
-                    return getFreeSlot(set, baseSamplerBinding);
 
-                if (sampler.isTexture())
-                    return getFreeSlot(set, baseTextureBinding);
-            }
+            if (isImageType(type))
+                return getFreeSlot(set, baseImageBinding);
 
-            if (type.getQualifier().storage == EvqUniform)
-                return getFreeSlot(set, baseUboBinding);
+            if (isTextureType(type))
+                return getFreeSlot(set, baseTextureBinding);
 
-            if (type.getQualifier().storage == EvqBuffer)
+            if (isSsboType(type))
                 return getFreeSlot(set, baseSsboBinding);
+
+            if (isSamplerType(type))
+                return getFreeSlot(set, baseSamplerBinding);
+
+            if (isUboType(type))
+                return getFreeSlot(set, baseUboBinding);
         }
 
         return -1;
     }
 
-    int resolveSet(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override
-    {
-        if (type.getQualifier().hasSet())
-            return type.getQualifier().layoutSet;
-        return 0;
+protected:
+    static bool isImageType(const glslang::TType& type) {
+        return type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage();
     }
 
-    bool validateInOut(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
+    static bool isSsboType(const glslang::TType& type) {
+        return type.getQualifier().storage == EvqBuffer;
+    }
+};
+
+/********************************************************************************
+The following IO resolver maps types in HLSL register space, as follows:
+
+t – for shader resource views (SRV)
+   TEXTURE1D
+   TEXTURE1DARRAY
+   TEXTURE2D
+   TEXTURE2DARRAY
+   TEXTURE3D
+   TEXTURECUBE
+   TEXTURECUBEARRAY
+   TEXTURE2DMS
+   TEXTURE2DMSARRAY
+   STRUCTUREDBUFFER
+   BYTEADDRESSBUFFER
+   BUFFER
+   TBUFFER
+    
+s – for samplers
+   SAMPLER
+   SAMPLER1D
+   SAMPLER2D
+   SAMPLER3D
+   SAMPLERCUBE
+   SAMPLERSTATE
+   SAMPLERCOMPARISONSTATE
+
+u – for unordered access views (UAV)
+   RWBYTEADDRESSBUFFER
+   RWSTRUCTUREDBUFFER
+   APPENDSTRUCTUREDBUFFER
+   CONSUMESTRUCTUREDBUFFER
+   RWBUFFER
+   RWTEXTURE1D
+   RWTEXTURE1DARRAY
+   RWTEXTURE2D
+   RWTEXTURE2DARRAY
+   RWTEXTURE3D
+
+b – for constant buffer views (CBV)
+   CBUFFER
+ ********************************************************************************/
+struct TDefaultHlslIoResolver : public TDefaultIoResolverBase
+{
+    bool validateBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool /*is_live*/) override
     {
+        if (type.getQualifier().hasBinding()) {
+            const int set = getLayoutSet(type);
+
+            if (isUavType(type))
+                return checkEmpty(set, baseUavBinding + type.getQualifier().layoutBinding);
+
+            if (isSrvType(type))
+                return checkEmpty(set, baseTextureBinding + type.getQualifier().layoutBinding);
+
+            if (isSamplerType(type))
+                return checkEmpty(set, baseSamplerBinding + type.getQualifier().layoutBinding);
+
+            if (isUboType(type))
+                return checkEmpty(set, baseUboBinding + type.getQualifier().layoutBinding);
+        }
         return true;
     }
-    int resolveInOutLocation(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
+
+    int resolveBinding(EShLanguage /*stage*/, const char* /*name*/, const glslang::TType& type, bool is_live) override
     {
+        const int set = getLayoutSet(type);
+
+        if (type.getQualifier().hasBinding()) {
+            if (isUavType(type))
+                return reserveSlot(set, baseUavBinding + type.getQualifier().layoutBinding);
+
+            if (isSrvType(type))
+                return reserveSlot(set, baseTextureBinding + type.getQualifier().layoutBinding);
+
+            if (isSamplerType(type))
+                return reserveSlot(set, baseSamplerBinding + type.getQualifier().layoutBinding);
+
+            if (isUboType(type))
+                return reserveSlot(set, baseUboBinding + type.getQualifier().layoutBinding);
+        } else if (is_live && doAutoMapping) {
+            // find free slot, the caller did make sure it passes all vars with binding
+            // first and now all are passed that do not have a binding and needs one
+
+            if (isUavType(type))
+                return getFreeSlot(set, baseUavBinding);
+
+            if (isSrvType(type))
+                return getFreeSlot(set, baseTextureBinding);
+
+            if (isSamplerType(type))
+                return getFreeSlot(set, baseSamplerBinding);
+
+            if (isUboType(type))
+                return getFreeSlot(set, baseUboBinding);
+        }
+
         return -1;
     }
-    int resolveInOutComponent(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
-    {
-        return -1;
+
+protected:
+    // Return true if this is a SRV (shader resource view) type:
+    static bool isSrvType(const glslang::TType& type) {
+        return isTextureType(type) || type.getQualifier().storage == EvqBuffer;
     }
-    int resolveInOutIndex(EShLanguage /*stage*/, const char* /*name*/, const TType& /*type*/, bool /*is_live*/) override
-    {
-        return -1;
+
+    // Return true if this is a UAV (unordered access view) type:
+    static bool isUavType(const glslang::TType& type) {
+        if (type.getQualifier().readonly)
+            return false;
+
+        return (type.getBasicType() == glslang::EbtSampler && type.getSampler().isImage()) ||
+            (type.getQualifier().storage == EvqBuffer);
     }
 };
 
+
 // Map I/O variables to provided offsets, and make bindings for
 // unbound but live variables.
 //
@@ -475,6 +620,7 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi
         intermediate.getShiftImageBinding() == 0 &&
         intermediate.getShiftUboBinding() == 0 &&
         intermediate.getShiftSsboBinding() == 0 &&
+        intermediate.getShiftUavBinding() == 0 &&
         intermediate.getAutoMapBindings() == false &&
         resolver == nullptr)
         return true;
@@ -488,15 +634,26 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi
 
     // if no resolver is provided, use the default resolver with the given shifts and auto map settings
     TDefaultIoResolver defaultResolver;
+    TDefaultHlslIoResolver defaultHlslResolver;
+
     if (resolver == nullptr) {
-        defaultResolver.baseSamplerBinding = intermediate.getShiftSamplerBinding();
-        defaultResolver.baseTextureBinding = intermediate.getShiftTextureBinding();
-        defaultResolver.baseImageBinding = intermediate.getShiftImageBinding();
-        defaultResolver.baseUboBinding = intermediate.getShiftUboBinding();
-        defaultResolver.baseSsboBinding = intermediate.getShiftSsboBinding();
-        defaultResolver.doAutoMapping = intermediate.getAutoMapBindings();
-
-        resolver = &defaultResolver;
+        TDefaultIoResolverBase* resolverBase;
+
+        // TODO: use a passed in IO mapper for this
+        if (intermediate.usingHlslIoMapping())
+            resolverBase = &defaultHlslResolver;
+        else
+            resolverBase = &defaultResolver;
+
+        resolverBase->baseSamplerBinding = intermediate.getShiftSamplerBinding();
+        resolverBase->baseTextureBinding = intermediate.getShiftTextureBinding();
+        resolverBase->baseImageBinding = intermediate.getShiftImageBinding();
+        resolverBase->baseUboBinding = intermediate.getShiftUboBinding();
+        resolverBase->baseSsboBinding = intermediate.getShiftSsboBinding();
+        resolverBase->baseUavBinding = intermediate.getShiftUavBinding();
+        resolverBase->doAutoMapping = intermediate.getAutoMapBindings();
+
+        resolver = resolverBase;
     }
 
     TVarLiveMap inVarMap, outVarMap, uniformVarMap;

+ 16 - 2
3rdparty/glslang/glslang/MachineIndependent/localintermediate.h

@@ -175,10 +175,13 @@ public:
         shiftImageBinding(0),
         shiftUboBinding(0),
         shiftSsboBinding(0),
+        shiftUavBinding(0),
         autoMapBindings(false),
         flattenUniformArrays(false),
         useUnknownFormat(false),
-        hlslOffsets(false)
+        hlslOffsets(false),
+        useStorageBuffer(false),
+        hlslIoMapping(false)
     {
         localSize[0] = 1;
         localSize[1] = 1;
@@ -211,6 +214,8 @@ public:
     unsigned int getShiftUboBinding()     const { return shiftUboBinding; }
     void setShiftSsboBinding(unsigned int shift)     { shiftSsboBinding = shift; }
     unsigned int getShiftSsboBinding()  const { return shiftSsboBinding; }
+    void setShiftUavBinding(unsigned int shift) { shiftUavBinding = shift; }
+    unsigned int getShiftUavBinding()  const { return shiftUavBinding; }
     void setAutoMapBindings(bool map)               { autoMapBindings = map; }
     bool getAutoMapBindings()             const { return autoMapBindings; }
     void setFlattenUniformArrays(bool flatten)      { flattenUniformArrays = flatten; }
@@ -219,6 +224,10 @@ public:
     bool getNoStorageFormat()             const { return useUnknownFormat; }
     void setHlslOffsets()         { hlslOffsets = true; }
     bool usingHlslOFfsets() const { return hlslOffsets; }
+    void setUseStorageBuffer() { useStorageBuffer = true; }
+    bool usingStorageBuffer() const { return useStorageBuffer; }
+    void setHlslIoMapping(bool b) { hlslIoMapping = b; }
+    bool usingHlslIoMapping()     { return hlslIoMapping; }
 
     void setVersion(int v) { version = v; }
     int getVersion() const { return version; }
@@ -243,7 +252,9 @@ public:
     TIntermSymbol* addSymbol(const TType&, const TSourceLoc&);
     TIntermSymbol* addSymbol(const TIntermSymbol&);
     TIntermTyped* addConversion(TOperator, const TType&, TIntermTyped*) const;
-    TIntermTyped* addShapeConversion(TOperator, const TType&, TIntermTyped*);
+    TIntermTyped* addUniShapeConversion(TOperator, const TType&, TIntermTyped*);
+    void addBiShapeConversion(TOperator, TIntermTyped*& lhsNode, TIntermTyped*& rhsNode);
+    TIntermTyped* addShapeConversion(const TType&, TIntermTyped*);
     TIntermTyped* addBinaryMath(TOperator, TIntermTyped* left, TIntermTyped* right, TSourceLoc);
     TIntermTyped* addAssign(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc);
     TIntermTyped* addIndex(TOperator op, TIntermTyped* base, TIntermTyped* index, TSourceLoc);
@@ -500,10 +511,13 @@ protected:
     unsigned int shiftImageBinding;
     unsigned int shiftUboBinding;
     unsigned int shiftSsboBinding;
+    unsigned int shiftUavBinding;
     bool autoMapBindings;
     bool flattenUniformArrays;
     bool useUnknownFormat;
     bool hlslOffsets;
+    bool useStorageBuffer;
+    bool hlslIoMapping;
 
     typedef std::list<TCall> TGraph;
     TGraph callGraph;

+ 15 - 0
3rdparty/glslang/glslang/MachineIndependent/reflection.cpp

@@ -707,6 +707,19 @@ void TReflection::buildAttributeReflection(EShLanguage stage, const TIntermediat
     }
 }
 
+// build counter block index associations for buffers
+void TReflection::buildCounterIndices()
+{
+    // search for ones that have counters
+    for (int i = 0; i < int(indexToUniformBlock.size()); ++i) {
+        const TString counterName(indexToUniformBlock[i].name + "@count");
+        const int index = getIndex(counterName);
+
+        if (index >= 0)
+            indexToUniformBlock[i].counterIndex = index;
+    }
+}
+
 // Merge live symbols from 'intermediate' into the existing reflection database.
 //
 // Returns false if the input is too malformed to do this.
@@ -729,6 +742,8 @@ bool TReflection::addStage(EShLanguage stage, const TIntermediate& intermediate)
         function->traverse(&it);
     }
 
+    buildCounterIndices();
+
     return true;
 }
 

+ 12 - 2
3rdparty/glslang/glslang/MachineIndependent/reflection.h

@@ -57,11 +57,16 @@ class TObjectReflection {
 public:
     TObjectReflection(const TString& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) :
         name(pName), offset(pOffset),
-        glDefineType(pGLDefineType), size(pSize), index(pIndex), type(pType.clone()) { }
+        glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), type(pType.clone()) { }
 
     void dump() const {
-        printf("%s: offset %d, type %x, size %d, index %d, binding %d\n",
+        printf("%s: offset %d, type %x, size %d, index %d, binding %d",
                name.c_str(), offset, glDefineType, size, index, getBinding() );
+
+        if (counterIndex != -1)
+            printf(", counter %d", counterIndex);
+
+        printf("\n");
     }
 
     const TType* const getType() const { return type; }
@@ -71,6 +76,7 @@ public:
     int glDefineType;
     int size;         // data size in bytes for a block, array size for a (non-block) object that's an array
     int index;
+    int counterIndex;
 
     static TObjectReflection badReflection() { return TObjectReflection(); }
 
@@ -140,6 +146,9 @@ public:
             return it->second;
     }
 
+    // see getIndex(const char*)
+    int getIndex(const TString& name) const { return getIndex(name.c_str()); }
+
     // Thread local size
     unsigned getLocalSize(int dim) const { return dim <= 2 ? localSize[dim] : 0; }
 
@@ -148,6 +157,7 @@ public:
 protected:
     friend class glslang::TReflectionTraverser;
 
+    void buildCounterIndices();
     void buildAttributeReflection(EShLanguage, const TIntermediate&);
 
     // Need a TString hash: typedef std::unordered_map<TString, int> TNameToIndex;

+ 4 - 0
3rdparty/glslang/glslang/Public/ShaderLang.h

@@ -303,8 +303,11 @@ public:
     void setShiftTextureBinding(unsigned int base);
     void setShiftImageBinding(unsigned int base);
     void setShiftUboBinding(unsigned int base);
+    void setShiftUavBinding(unsigned int base);
+    void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding
     void setShiftSsboBinding(unsigned int base);
     void setAutoMapBindings(bool map);
+    void setHlslIoMapping(bool hlslIoMap);
     void setFlattenUniformArrays(bool flatten);
     void setNoStorageFormat(bool useUnknownFormat);
 
@@ -518,6 +521,7 @@ public:
     int getUniformBlockSize(int blockIndex) const;         // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE)
     int getUniformIndex(const char* name) const;           // can be used for glGetUniformIndices()
     int getUniformBlockIndex(int index) const;             // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX)
+    int getUniformBlockCounterIndex(int index) const;      // returns block index of associated counter.
     int getUniformType(int index) const;                   // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE)
     int getUniformBufferOffset(int index) const;           // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET)
     int getUniformArraySize(int index) const;              // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE)

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

@@ -212,6 +212,8 @@ INSTANTIATE_TEST_CASE_P(
         {"hlsl.samplecmp.basic.dx10.frag", "main"},
         {"hlsl.samplecmp.offset.dx10.frag", "main"},
         {"hlsl.samplecmp.offsetarray.dx10.frag", "main"},
+        {"hlsl.samplecmp.negative.frag", "main"},
+        {"hlsl.samplecmp.negative2.frag", "main"},
         {"hlsl.samplecmplevelzero.array.dx10.frag", "main"},
         {"hlsl.samplecmplevelzero.basic.dx10.frag", "main"},
         {"hlsl.samplecmplevelzero.offset.dx10.frag", "main"},
@@ -245,10 +247,14 @@ INSTANTIATE_TEST_CASE_P(
         {"hlsl.structarray.flatten.frag", "main"},
         {"hlsl.structarray.flatten.geom", "main"},
         {"hlsl.structbuffer.frag", "main"},
+        {"hlsl.structbuffer.append.frag", "main"},
         {"hlsl.structbuffer.atomics.frag", "main"},
         {"hlsl.structbuffer.byte.frag", "main"},
         {"hlsl.structbuffer.coherent.frag", "main"},
+        {"hlsl.structbuffer.floatidx.comp", "main"},
+        {"hlsl.structbuffer.incdec.frag", "main"},
         {"hlsl.structbuffer.fn.frag", "main"},
+        {"hlsl.structbuffer.fn2.comp", "main"},
         {"hlsl.structbuffer.rw.frag", "main"},
         {"hlsl.structbuffer.rwbyte.frag", "main"},
         {"hlsl.structin.vert", "main"},

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

@@ -303,6 +303,7 @@ INSTANTIATE_TEST_CASE_P(
         "spv.specConstant.comp",
         "spv.specConstantComposite.vert",
         "spv.specConstantOperations.vert",
+        "spv.storageBuffer.vert",
         "spv.precise.tese",
         "spv.precise.tesc",
     })),

+ 26 - 18
3rdparty/glslang/hlsl/hlslGrammar.cpp

@@ -475,9 +475,10 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
             if (variableType.getBasicType() != EbtString && parseContext.getAnnotationNestingLevel() == 0) {
                 if (typedefDecl)
                     parseContext.declareTypedef(idToken.loc, *fullName, variableType);
-                else if (variableType.getBasicType() == EbtBlock)
+                else if (variableType.getBasicType() == EbtBlock) {
                     parseContext.declareBlock(idToken.loc, variableType, fullName);
-                else {
+                    parseContext.declareStructBufferCounter(idToken.loc, variableType, *fullName);
+                } else {
                     if (variableType.getQualifier().storage == EvqUniform && ! variableType.containsOpaque()) {
                         // this isn't really an individual variable, but a member of the $Global buffer
                         parseContext.growGlobalUniformBlock(idToken.loc, variableType, *fullName);
@@ -1845,13 +1846,16 @@ 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.
     TStorageQualifier storageQualifier = EvqTemporary;
+    bool readonly = false;
 
     // CBUFFER
-    if (acceptTokenClass(EHTokCBuffer))
+    if (acceptTokenClass(EHTokCBuffer)) {
         storageQualifier = EvqUniform;
     // TBUFFER
-    else if (acceptTokenClass(EHTokTBuffer))
+    } else if (acceptTokenClass(EHTokTBuffer)) {
         storageQualifier = EvqBuffer;
+        readonly = true;
+    }
     // CLASS
     // STRUCT
     else if (! acceptTokenClass(EHTokClass) && ! acceptTokenClass(EHTokStruct))
@@ -1907,6 +1911,7 @@ bool HlslGrammar::acceptStruct(TType& type, TIntermNode*& nodeList)
         new(&type) TType(typeList, structName);
     else {
         postDeclQualifier.storage = storageQualifier;
+        postDeclQualifier.readonly = readonly;
         new(&type) TType(typeList, structName, postDeclQualifier); // sets EbtBlock
     }
 
@@ -1955,24 +1960,29 @@ bool HlslGrammar::acceptStructBufferType(TType& type)
     bool readonly = false;
 
     TStorageQualifier storage = EvqBuffer;
+    TBuiltInVariable  builtinType = EbvNone;
 
     switch (structBuffType) {
     case EHTokAppendStructuredBuffer:
-        unimplemented("AppendStructuredBuffer");
-        return false;
+        builtinType = EbvAppendConsume;
+        break;
     case EHTokByteAddressBuffer:
         hasTemplateType = false;
         readonly = true;
+        builtinType = EbvByteAddressBuffer;
         break;
     case EHTokConsumeStructuredBuffer:
-        unimplemented("ConsumeStructuredBuffer");
-        return false;
+        builtinType = EbvAppendConsume;
+        break;
     case EHTokRWByteAddressBuffer:
         hasTemplateType = false;
+        builtinType = EbvRWByteAddressBuffer;
         break;
     case EHTokRWStructuredBuffer:
+        builtinType = EbvRWStructuredBuffer;
         break;
     case EHTokStructuredBuffer:
+        builtinType = EbvStructuredBuffer;
         readonly = true;
         break;
     default:
@@ -2014,8 +2024,6 @@ bool HlslGrammar::acceptStructBufferType(TType& type)
     // field name is canonical for all structbuffers
     templateType->setFieldName("@data");
 
-    // Create block type.  TODO: hidden internal uint member when needed
-
     TTypeList* blockStruct = new TTypeList;
     TTypeLoc  member = { templateType, token.loc };
     blockStruct->push_back(member);
@@ -2025,6 +2033,7 @@ bool HlslGrammar::acceptStructBufferType(TType& type)
 
     blockType.getQualifier().storage = storage;
     blockType.getQualifier().readonly = readonly;
+    blockType.getQualifier().builtIn = builtinType;
 
     // We may have created an equivalent type before, in which case we should use its
     // deep structure.
@@ -2926,11 +2935,16 @@ bool HlslGrammar::acceptArguments(TFunction* function, TIntermTyped*& arguments)
     if (! acceptTokenClass(EHTokLeftParen))
         return false;
 
+    // RIGHT_PAREN
+    if (acceptTokenClass(EHTokRightParen))
+        return true;
+
+    // must now be at least one expression...
     do {
         // expression
         TIntermTyped* arg;
         if (! acceptAssignmentExpression(arg))
-            break;
+            return false;
 
         // hook it up
         parseContext.handleFunctionArgument(function, arguments, arg);
@@ -3318,18 +3332,12 @@ bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement)
     case EHTokDo:
         parseContext.nestLooping();
 
-        if (! acceptTokenClass(EHTokLeftBrace))
-            expected("{");
-
         // statement
-        if (! peekTokenClass(EHTokRightBrace) && ! acceptScopedStatement(statement)) {
+        if (! acceptScopedStatement(statement)) {
             expected("do sub-statement");
             return false;
         }
 
-        if (! acceptTokenClass(EHTokRightBrace))
-            expected("}");
-
         // WHILE
         if (! acceptTokenClass(EHTokWhile)) {
             expected("while");

+ 258 - 34
3rdparty/glslang/hlsl/hlslParseHelper.cpp

@@ -713,27 +713,38 @@ TIntermTyped* HlslParseContext::handleBracketOperator(const TSourceLoc& loc, TIn
 }
 
 //
-// Handle seeing a base[index] dereference in the grammar.
-//
-TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index)
+// Cast index value to a uint if it isn't already (for operator[], load indexes, etc)
+TIntermTyped* HlslParseContext::makeIntegerIndex(TIntermTyped* index)
 {
-    TIntermTyped* result = handleBracketOperator(loc, base, index);
-
-    if (result != nullptr)
-        return result;  // it was handled as an operator[]
-
     const TBasicType indexBasicType = index->getType().getBasicType();
+    const int vecSize = index->getType().getVectorSize();
+
+    // We can use int types directly as the index
+    if (indexBasicType == EbtInt || indexBasicType == EbtUint ||
+        indexBasicType == EbtInt64 || indexBasicType == EbtUint64)
+        return index;
 
     // Cast index to unsigned integer if it isn't one.
-    if (indexBasicType != EbtInt && indexBasicType != EbtUint &&
-        indexBasicType != EbtInt64 && indexBasicType != EbtUint64)
-        index = intermediate.addConversion(EOpConstructUint, TType(EbtUint), index);
+    return intermediate.addConversion(EOpConstructUint, TType(EbtUint, EvqTemporary, vecSize), index);
+}
+
+//
+// Handle seeing a base[index] dereference in the grammar.
+//
+TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index)
+{
+    index = makeIntegerIndex(index);
 
     if (index == nullptr) {
         error(loc, " unknown undex type ", "", "");
         return nullptr;
     }
 
+    TIntermTyped* result = handleBracketOperator(loc, base, index);
+
+    if (result != nullptr)
+        return result;  // it was handled as an operator[]
+
     bool flattened = false;
     int indexValue = 0;
     if (index->getQualifier().storage == EvqConst) {
@@ -842,7 +853,11 @@ bool HlslParseContext::isStructBufferMethod(const TString& name) const
         name == "InterlockedMax"             ||
         name == "InterlockedMin"             ||
         name == "InterlockedOr"              ||
-        name == "InterlockedXor";
+        name == "InterlockedXor"             ||
+        name == "IncrementCounter"           ||
+        name == "DecrementCounter"           ||
+        name == "Append"                     ||
+        name == "Consume";
 }
 
 //
@@ -1514,7 +1529,7 @@ void HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunction
         error(loc, "function name is redeclaration of existing name", function.getName().c_str(), "");
 }
 
-// Add interstage IO variables to the linkage in canonical order.
+// Finalization step: Add interstage IO variables to the linkage in canonical order.
 void HlslParseContext::addInterstageIoToLinkage()
 {
     TSourceLoc loc;
@@ -1608,6 +1623,8 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l
             paramNodes = intermediate.growAggregate(paramNodes,
                                                     intermediate.addSymbol(*variable, loc),
                                                     loc);
+
+            // TODO: for struct buffers with counters, pass counter buffer as hidden parameter
         } else
             paramNodes = intermediate.growAggregate(paramNodes, intermediate.addSymbol(*param.type, loc), loc);
     }
@@ -2087,7 +2104,7 @@ TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermT
     } else if (*currentFunctionType != value->getType()) {
         value = intermediate.addConversion(EOpReturn, *currentFunctionType, value);
         if (value && *currentFunctionType != value->getType())
-            value = intermediate.addShapeConversion(EOpReturn, *currentFunctionType, value);
+            value = intermediate.addUniShapeConversion(EOpReturn, *currentFunctionType, value);
         if (value == nullptr) {
             error(loc, "type does not match, or is not convertible to, the function's return type", "return", "");
             return value;
@@ -2438,24 +2455,119 @@ TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc
     return txcombine;
 }
 
+// Return true if this a buffer type that has an associated counter buffer.
+bool HlslParseContext::hasStructBuffCounter(const TString& name) const
+{
+    const auto bivIt = structBufferBuiltIn.find(name);
+    if (bivIt == structBufferBuiltIn.end())
+        return false;
+
+    switch (bivIt->second) {
+    case EbvAppendConsume:       // fall through...
+    case EbvRWStructuredBuffer:  // ...
+        return true;
+    default:
+        return false; // the other structuredbfufer types do not have a counter.
+    }
+}
+
+// declare counter for a structured buffer type
+void HlslParseContext::declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name)
+{
+    // Bail out if not a struct buffer
+    if (! isStructBufferType(bufferType))
+        return;
+
+    if (! hasStructBuffCounter(name))
+        return;
+
+    // Counter type
+    TType* counterType = new TType(EbtInt, EvqBuffer);
+    counterType->setFieldName("@count");
+
+    TTypeList* blockStruct = new TTypeList;
+    TTypeLoc  member = { counterType, loc };
+    blockStruct->push_back(member);
+
+    TString* blockName = new TString(name);
+    *blockName += "@count";
+
+    structBufferCounter[*blockName] = false;
+
+    TType blockType(blockStruct, "", counterType->getQualifier());
+    blockType.getQualifier().storage = EvqBuffer;
+
+    shareStructBufferType(blockType);
+    declareBlock(loc, blockType, blockName);
+}
+
+// return the counter that goes with a given structuredbuffer
+TIntermTyped* HlslParseContext::getStructBufferCounter(const TSourceLoc& loc, TIntermTyped* buffer)
+{
+    // Bail out if not a struct buffer
+    if (buffer == nullptr || ! isStructBufferType(buffer->getType()))
+        return nullptr;
+
+    TString blockName(buffer->getAsSymbolNode()->getName());
+    blockName += "@count";
+
+    // Mark the counter as being used
+    structBufferCounter[blockName] = true;
+
+    TIntermTyped* counterVar = handleVariable(loc, &blockName);  // find the block structure
+    TIntermTyped* index = intermediate.addConstantUnion(0, loc); // index to counter inside block struct
+
+    TIntermTyped* counterMember = intermediate.addIndex(EOpIndexDirectStruct, counterVar, index, loc);
+    counterMember->setType(TType(EbtInt));
+    return counterMember;
+}
+
+
 //
 // Decompose structure buffer methods into AST
 //
 void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments)
 {
-    if (!node || !node->getAsOperator())
+    if (node == nullptr || node->getAsOperator() == nullptr || arguments == nullptr)
         return;
 
     const TOperator op  = node->getAsOperator()->getOp();
-    TIntermAggregate* argAggregate = arguments ? arguments->getAsAggregate() : nullptr;
-    if (argAggregate == nullptr)
-        return;
+    TIntermAggregate* argAggregate = arguments->getAsAggregate();
+
+    // Buffer is the object upon which method is called, so always arg 0
+    TIntermTyped* bufferObj = nullptr;
+
+    // The parameters can be an aggregate, or just a the object as a symbol if there are no fn params.
+    if (argAggregate) {
+        if (argAggregate->getSequence().empty())
+            return;
+        bufferObj = argAggregate->getSequence()[0]->getAsTyped();
+    } else {
+        bufferObj = arguments->getAsSymbolNode();
+    }
 
-    if (argAggregate->getSequence().empty())
+    if (bufferObj == nullptr || bufferObj->getAsSymbolNode() == nullptr)
         return;
 
-    // Buffer is the object upon which method is called, so always arg 0
-    TIntermTyped* bufferObj = argAggregate->getSequence()[0]->getAsTyped();
+    const TString bufferName(bufferObj->getAsSymbolNode()->getName());
+
+    // Some methods require a hidden internal counter, obtained via getStructBufferCounter().
+    // This lambda adds something to it and returns the old value.
+    const auto incDecCounter = [&](int incval) -> TIntermTyped* {
+        TIntermTyped* incrementValue = intermediate.addConstantUnion(incval, loc, true);
+        TIntermTyped* counter = getStructBufferCounter(loc, bufferObj); // obtain the counter member
+
+        if (counter == nullptr)
+            return nullptr;
+
+        TIntermAggregate* counterIncrement = new TIntermAggregate(EOpAtomicAdd);
+        counterIncrement->setType(TType(EbtUint, EvqTemporary));
+        counterIncrement->setLoc(loc);
+        counterIncrement->getSequence().push_back(counter);
+        counterIncrement->getSequence().push_back(incrementValue);
+
+        return counterIncrement;
+    };
 
     // Index to obtain the runtime sized array out of the buffer.
     TIntermTyped* argArray = indexStructBufferContent(loc, bufferObj);
@@ -2465,11 +2577,24 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
     switch (op) {
     case EOpMethodLoad:
         {
-            TIntermTyped* argIndex = argAggregate->getSequence()[1]->getAsTyped();  // index
+            TIntermTyped* argIndex = makeIntegerIndex(argAggregate->getSequence()[1]->getAsTyped());  // index
+
+            const auto bivIt = structBufferBuiltIn.find(bufferName);
+
+            const TBuiltInVariable builtInType = (bivIt != structBufferBuiltIn.end()) ? bivIt->second : EbvNone;
+
+            const TType& bufferType = bufferObj->getType();
 
             // Byte address buffers index in bytes (only multiples of 4 permitted... not so much a byte address
             // buffer then, but that's what it calls itself.
-            const bool isByteAddressBuffer = (argArray->getBasicType() == EbtUint);
+            // TODO: it would be easier to track the declared (pre-sanitized) builtInType in the TType.
+            //       If/when that happens, this should be simplified to look *only* at the builtin type.
+            const bool isByteAddressBuffer = (builtInType == EbvByteAddressBuffer   || 
+                                              builtInType == EbvRWByteAddressBuffer ||
+                                              (builtInType == EbvNone && !bufferType.isVector() &&
+                                               bufferType.getBasicType() == EbtUint));
+                
+
             if (isByteAddressBuffer)
                 argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex, intermediate.addConstantUnion(2, loc, true),
                                                       loc, TType(EbtInt));
@@ -2489,7 +2614,7 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
     case EOpMethodLoad3:
     case EOpMethodLoad4:
         {
-            TIntermTyped* argIndex = argAggregate->getSequence()[1]->getAsTyped();  // index
+            TIntermTyped* argIndex = makeIntegerIndex(argAggregate->getSequence()[1]->getAsTyped());  // index
 
             TOperator constructOp = EOpNull;
             int size = 0;
@@ -2547,7 +2672,7 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
     case EOpMethodStore3:
     case EOpMethodStore4:
         {
-            TIntermTyped* argIndex = argAggregate->getSequence()[1]->getAsTyped();  // address
+            TIntermTyped* argIndex = makeIntegerIndex(argAggregate->getSequence()[1]->getAsTyped());  // index
             TIntermTyped* argValue = argAggregate->getSequence()[2]->getAsTyped();  // value
 
             // Index into the array to find the item being loaded.
@@ -2654,7 +2779,7 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
 
             TIntermSequence& sequence = argAggregate->getSequence();
 
-            TIntermTyped* argIndex     = sequence[1]->getAsTyped();  // index
+            TIntermTyped* argIndex     = makeIntegerIndex(sequence[1]->getAsTyped());  // index
             argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex, intermediate.addConstantUnion(2, loc, true),
                                                   loc, TType(EbtInt));
 
@@ -2670,6 +2795,50 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
         }
         break;
 
+    case EOpMethodIncrementCounter:
+        {
+            node = incDecCounter(1);
+            break;
+        }
+
+    case EOpMethodDecrementCounter:
+        {
+            TIntermTyped* preIncValue = incDecCounter(-1); // result is original value
+            node = intermediate.addBinaryNode(EOpAdd, preIncValue, intermediate.addConstantUnion(-1, loc, true), loc,
+                                              preIncValue->getType());
+            break;
+        }
+
+    case EOpMethodAppend:
+        {
+            TIntermTyped* oldCounter = incDecCounter(1);
+
+            TIntermTyped* lValue = intermediate.addIndex(EOpIndexIndirect, argArray, oldCounter, loc);
+            TIntermTyped* rValue = argAggregate->getSequence()[1]->getAsTyped();
+
+            const TType derefType(argArray->getType(), 0);
+            lValue->setType(derefType);
+
+            node = intermediate.addAssign(EOpAssign, lValue, rValue, loc);
+
+            break;
+        }
+
+    case EOpMethodConsume:
+        {
+            TIntermTyped* oldCounter = incDecCounter(-1);
+
+            TIntermTyped* newCounter = intermediate.addBinaryNode(EOpAdd, oldCounter, intermediate.addConstantUnion(-1, loc, true), loc,
+                                                        oldCounter->getType());
+
+            node = intermediate.addIndex(EOpIndexIndirect, argArray, newCounter, loc);
+
+            const TType derefType(argArray->getType(), 0);
+            node->setType(derefType);
+
+            break;
+        }
+
     default:
         break; // most pass through unchanged
     }
@@ -2975,6 +3144,18 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
             TIntermTyped* argCmpVal = argAggregate->getSequence()[3]->getAsTyped();
             TIntermTyped* argOffset = nullptr;
 
+            // Sampler argument should be a sampler.
+            if (argSamp->getType().getBasicType() != EbtSampler) {
+                error(loc, "expected: sampler type", "", "");
+                return;
+            }
+
+            // Sampler should be a SamplerComparisonState
+            if (! argSamp->getType().getSampler().isShadow()) {
+                error(loc, "expected: SamplerComparisonState", "", "");
+                return;
+            }
+
             // optional offset value
             if (argAggregate->getSequence().size() > 4)
                 argOffset = argAggregate->getSequence()[4]->getAsTyped();
@@ -3212,6 +3393,18 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
             bool hasOffset1    = false;
             bool hasOffset4    = false;
 
+            // Sampler argument should be a sampler.
+            if (argSamp->getType().getBasicType() != EbtSampler) {
+                error(loc, "expected: sampler type", "", "");
+                return;
+            }
+
+            // Cmp forms require SamplerComparisonState
+            if (cmpValues > 0 && ! argSamp->getType().getSampler().isShadow()) {
+                error(loc, "expected: SamplerComparisonState", "", "");
+                return;
+            }
+
             // Only 2D forms can have offsets.  Discover if we have 0, 1 or 4 offsets.
             if (dim == Esd2D) {
                 hasOffset1 = (argSize == (4+cmpValues) || argSize == (5+cmpValues));
@@ -3978,10 +4171,20 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct
         // TODO: this needs improvement: there's no way at present to look up a signature in
         // the symbol table for an arbitrary type.  This is a temporary hack until that ability exists.
         // It will have false positives, since it doesn't check arg counts or types.
-        if (arguments && arguments->getAsAggregate()) {
-            const TIntermSequence& sequence = arguments->getAsAggregate()->getSequence();
+        if (arguments) {
+            // Check if first argument is struct buffer type.  It may be an aggregate or a symbol, so we
+            // look for either case.
+
+            TIntermTyped* arg0 = nullptr;
+
+            if (arguments->getAsAggregate() && arguments->getAsAggregate()->getSequence().size() > 0)
+                arg0 = arguments->getAsAggregate()->getSequence()[0]->getAsTyped();
+            else if (arguments->getAsSymbolNode())
+                arg0 = arguments->getAsSymbolNode();
+
+            if (arg0 != nullptr && isStructBufferType(arg0->getType())) {
+                // TODO: for struct buffers with counters, pass counter buffer as hidden parameter
 
-            if (!sequence.empty() && isStructBufferType(sequence[0]->getAsTyped()->getType())) {
                 static const int methodPrefixSize = sizeof(BUILTIN_PREFIX)-1;
 
                 if (function->getName().length() > methodPrefixSize &&
@@ -4105,7 +4308,7 @@ void HlslParseContext::addInputArgumentConversions(const TFunction& function, TI
             // convert to the correct type.
             TIntermTyped* convArg = intermediate.addConversion(EOpFunctionCall, *function[i].type, arg);
             if (convArg != nullptr)
-                convArg = intermediate.addShapeConversion(EOpFunctionCall, *function[i].type, convArg);
+                convArg = intermediate.addUniShapeConversion(EOpFunctionCall, *function[i].type, convArg);
             if (convArg != nullptr)
                 setArg(i, convArg);
             else
@@ -5845,8 +6048,11 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction
     // These builtin ops can accept any type, so we bypass the argument selection
     if (candidateList.size() == 1 && builtIn &&
         (candidateList[0]->getBuiltInOp() == EOpMethodAppend ||
-         candidateList[0]->getBuiltInOp() == EOpMethodRestartStrip)) {
-
+         candidateList[0]->getBuiltInOp() == EOpMethodRestartStrip ||
+         candidateList[0]->getBuiltInOp() == EOpMethodIncrementCounter ||
+         candidateList[0]->getBuiltInOp() == EOpMethodDecrementCounter ||
+         candidateList[0]->getBuiltInOp() == EOpMethodAppend ||
+         candidateList[0]->getBuiltInOp() == EOpMethodConsume)) {
         return candidateList[0];
     }
 
@@ -6439,7 +6645,7 @@ TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TInterm
 
         initializer = intermediate.addConversion(EOpAssign, variable->getType(), initializer);
         if (initializer != nullptr && variable->getType() != initializer->getType())
-            initializer = intermediate.addShapeConversion(EOpAssign, variable->getType(), initializer);
+            initializer = intermediate.addUniShapeConversion(EOpAssign, variable->getType(), initializer);
         if (initializer == nullptr || !initializer->getAsConstantUnion() ||
                                       variable->getType() != initializer->getType()) {
             error(loc, "non-matching or non-convertible constant type for const initializer",
@@ -6856,6 +7062,10 @@ void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TS
     switch (type.getQualifier().storage) {
     case EvqUniform:
     case EvqBuffer:
+        // remember pre-sanitized builtin type
+        if (type.getQualifier().storage == EvqBuffer && instanceName != nullptr)
+            structBufferBuiltIn[*instanceName] = type.getQualifier().builtIn;
+
         correctUniform(type.getQualifier());
         break;
     case EvqVaryingIn:
@@ -7670,7 +7880,7 @@ TIntermSymbol* HlslParseContext::findLinkageSymbol(TBuiltInVariable biType) cons
     return intermediate.addSymbol(*it->second->getAsVariable());
 }
 
-// Add patch constant function invocation
+// Finalization step: Add patch constant function invocation
 void HlslParseContext::addPatchConstantInvocation()
 {
     TSourceLoc loc;
@@ -8039,9 +8249,23 @@ void HlslParseContext::addPatchConstantInvocation()
     epBodySeq.insert(epBodySeq.end(), invocationIdTest);
 }
 
+// Finalization step: remove unused buffer blocks from linkage (we don't know until the
+// shader is entirely compiled)
+void HlslParseContext::removeUnusedStructBufferCounters()
+{
+    const auto endIt = std::remove_if(linkageSymbols.begin(), linkageSymbols.end(),
+                                      [this](const TSymbol* sym) {
+                                          const auto sbcIt = structBufferCounter.find(sym->getName());
+                                          return sbcIt != structBufferCounter.end() && !sbcIt->second;
+                                      });
+
+    linkageSymbols.erase(endIt, linkageSymbols.end());
+}
+
 // post-processing
 void HlslParseContext::finish()
 {
+    removeUnusedStructBufferCounters();
     addPatchConstantInvocation();
     addInterstageIoToLinkage();
 

+ 13 - 0
3rdparty/glslang/hlsl/hlslParseHelper.h

@@ -146,6 +146,7 @@ public:
     TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&);
     TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
     void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
+    void declareStructBufferCounter(const TSourceLoc& loc, const TType& bufferType, const TString& name);
     void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation);
     void fixBlockXfbOffsets(TQualifier&, TTypeList&);
     void fixBlockUniformOffsets(const TQualifier&, TTypeList&);
@@ -249,6 +250,7 @@ protected:
     TVariable* getSplitIoVar(int id) const;
     void addInterstageIoToLinkage();
     void addPatchConstantInvocation();
+    TIntermTyped* makeIntegerIndex(TIntermTyped*);
 
     void fixBuiltInIoType(TType&);
 
@@ -274,11 +276,19 @@ protected:
     TType* getStructBufferContentType(const TType& type) const;
     bool isStructBufferType(const TType& type) const { return getStructBufferContentType(type) != nullptr; }
     TIntermTyped* indexStructBufferContent(const TSourceLoc& loc, TIntermTyped* buffer) const;
+    TIntermTyped* getStructBufferCounter(const TSourceLoc& loc, TIntermTyped* buffer);
 
     // Return true if this type is a reference.  This is not currently a type method in case that's
     // a language specific answer.
     bool isReference(const TType& type) const { return isStructBufferType(type); }
 
+    // Return true if this a buffer type that has an associated counter buffer.
+    bool hasStructBuffCounter(const TString& name) const;
+
+    // Finalization step: remove unused buffer blocks from linkage (we don't know until the
+    // shader is entirely compiled)
+    void removeUnusedStructBufferCounters();
+
     // Pass through to base class after remembering builtin mappings.
     using TParseContextBase::trackLinkage;
     void trackLinkage(TSymbol& variable) override;
@@ -366,6 +376,9 @@ protected:
 
     // Structuredbuffer shared types.  Typically there are only a few.
     TVector<TType*> structBufferTypes;
+    
+    TMap<TString, TBuiltInVariable> structBufferBuiltIn;
+    TMap<TString, bool> structBufferCounter;
 
     // The builtin interstage IO map considers e.g, EvqPosition on input and output separately, so that we
     // can build the linkage correctly if position appears on both sides.  Otherwise, multiple positions

+ 7 - 0
3rdparty/glslang/hlsl/hlslParseables.cpp

@@ -871,6 +871,9 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
         { "InterlockedMin",                   nullptr, nullptr,   "-",              "-",              EShLangAll,   true },
         { "InterlockedOr",                    nullptr, nullptr,   "-",              "-",              EShLangAll,   true },
         { "InterlockedXor",                   nullptr, nullptr,   "-",              "-",              EShLangAll,   true },
+        { "IncrementCounter",                 nullptr, nullptr,   "-",              "-",              EShLangAll,   true },
+        { "DecrementCounter",                 nullptr, nullptr,   "-",              "-",              EShLangAll,   true },
+        { "Consume",                          nullptr, nullptr,   "-",              "-",              EShLangAll,   true },
 
         // Mark end of list, since we want to avoid a range-based for, as some compilers don't handle it yet.
         { nullptr,                            nullptr, nullptr,   nullptr,      nullptr,  0, false },
@@ -1180,6 +1183,10 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil
     symbolTable.relateToOperator(BUILTIN_PREFIX "Store2",                      EOpMethodStore2);
     symbolTable.relateToOperator(BUILTIN_PREFIX "Store3",                      EOpMethodStore3);
     symbolTable.relateToOperator(BUILTIN_PREFIX "Store4",                      EOpMethodStore4);
+    symbolTable.relateToOperator(BUILTIN_PREFIX "IncrementCounter",            EOpMethodIncrementCounter);
+    symbolTable.relateToOperator(BUILTIN_PREFIX "DecrementCounter",            EOpMethodDecrementCounter);
+    // Append is also a GS method: we don't add it twice
+    symbolTable.relateToOperator(BUILTIN_PREFIX "Consume",                     EOpMethodConsume);
 
     symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedAdd",              EOpInterlockedAdd);
     symbolTable.relateToOperator(BUILTIN_PREFIX "InterlockedAnd",              EOpInterlockedAnd);

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio