Browse Source

Updated glslang.

Branimir Karadžić 8 years ago
parent
commit
942544e822
43 changed files with 1483 additions and 98 deletions
  1. 3 3
      3rdparty/glslang/Test/baseResults/hlsl.amend.frag.out
  2. 241 0
      3rdparty/glslang/Test/baseResults/hlsl.constantbuffer.frag.out
  3. 112 0
      3rdparty/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out
  4. 1 1
      3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out
  5. 1 1
      3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out
  6. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out
  7. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out
  8. 1 1
      3rdparty/glslang/Test/baseResults/hlsl.gathercmpRGBA.offset.dx10.frag.out
  9. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.getdimensions.rw.dx10.frag.out
  10. 801 32
      3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out
  11. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.implicitBool.frag.out
  12. 1 1
      3rdparty/glslang/Test/baseResults/hlsl.isfinite.frag.out
  13. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out
  14. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out
  15. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.frag.out
  16. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.basic.dx10.vert.out
  17. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out
  18. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out
  19. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out
  20. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out
  21. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out
  22. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out
  23. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out
  24. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.multiReturn.frag.out
  25. 1 1
      3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out
  26. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out
  27. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out
  28. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out
  29. 2 2
      3rdparty/glslang/Test/baseResults/hlsl.tx.bracket.frag.out
  30. 26 0
      3rdparty/glslang/Test/hlsl.constantbuffer.frag
  31. 8 0
      3rdparty/glslang/Test/hlsl.emptystruct.init.vert
  32. 3 3
      3rdparty/glslang/Test/hlsl.getsampleposition.dx10.frag
  33. 1 1
      3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
  34. 45 4
      3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
  35. 0 6
      3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp
  36. 13 0
      3rdparty/glslang/glslang/Public/ShaderLang.h
  37. 2 0
      3rdparty/glslang/gtests/Hlsl.FromFile.cpp
  38. 46 1
      3rdparty/glslang/hlsl/hlslGrammar.cpp
  39. 1 0
      3rdparty/glslang/hlsl/hlslGrammar.h
  40. 130 3
      3rdparty/glslang/hlsl/hlslParseHelper.cpp
  41. 3 0
      3rdparty/glslang/hlsl/hlslParseHelper.h
  42. 2 0
      3rdparty/glslang/hlsl/hlslScanContext.cpp
  43. 1 0
      3rdparty/glslang/hlsl/hlslTokens.h

+ 3 - 3
3rdparty/glslang/Test/baseResults/hlsl.amend.frag.out

@@ -184,9 +184,9 @@ gl_FragCoord origin is upper left
                               Name 22  ""
                               MemberDecorate 20($Global) 0 Offset 0
                               MemberDecorate 20($Global) 1 Offset 16
-                              MemberDecorate 20($Global) 2 Offset 32
-                              MemberDecorate 20($Global) 3 Offset 44
-                              MemberDecorate 20($Global) 4 Offset 48
+                              MemberDecorate 20($Global) 2 Offset 20
+                              MemberDecorate 20($Global) 3 Offset 32
+                              MemberDecorate 20($Global) 4 Offset 36
                               Decorate 20($Global) Block
                               Decorate 22 DescriptorSet 0
                2:             TypeVoid

+ 241 - 0
3rdparty/glslang/Test/baseResults/hlsl.constantbuffer.frag.out

@@ -0,0 +1,241 @@
+hlsl.constantbuffer.frag
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:20  Function Definition: @main( ( temp 4-component vector of float)
+0:20    Function Parameters: 
+0:?     Sequence
+0:21      Test condition and select ( temp void)
+0:21        Condition
+0:21        x: direct index for structure (layout( row_major std140) uniform bool)
+0:21          direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:21            direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:21              'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:21              Constant:
+0:21                1 (const int)
+0:21            Constant:
+0:21              2 (const int)
+0:21          Constant:
+0:21            0 (const int)
+0:21        true case
+0:22        Branch: Return with expression
+0:22          add ( temp 4-component vector of float)
+0:22            add ( temp 4-component vector of float)
+0:22              x: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
+0:22                'cb1' (layout( binding=12 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float x})
+0:22                Constant:
+0:22                  0 (const int)
+0:22              y: direct index for structure (layout( row_major std140) uniform float)
+0:22                direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:22                  'cb2' (layout( row_major std140) uniform 3-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:22                  Constant:
+0:22                    1 (const int)
+0:22                Constant:
+0:22                  1 (const int)
+0:22            Convert int to float ( temp float)
+0:22              c1: direct index for structure (layout( row_major std140) uniform int)
+0:22                'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1})
+0:22                Constant:
+0:22                  0 (const uint)
+0:21        false case
+0:24        Branch: Return with expression
+0:24          Construct vec4 ( temp 4-component vector of float)
+0:24            y: direct index for structure (layout( row_major std140) uniform float)
+0:24              direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:24                direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:24                  'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:24                  Constant:
+0:24                    2 (const int)
+0:24                Constant:
+0:24                  3 (const int)
+0:24              Constant:
+0:24                1 (const int)
+0:20  Function Definition: main( ( temp void)
+0:20    Function Parameters: 
+0:?     Sequence
+0:20      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:20        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'cb1' (layout( binding=12 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float x})
+0:?     'cb2' (layout( row_major std140) uniform 3-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:?     'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:?     'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1})
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+
+Linked fragment stage:
+
+
+Shader version: 500
+gl_FragCoord origin is upper left
+0:? Sequence
+0:20  Function Definition: @main( ( temp 4-component vector of float)
+0:20    Function Parameters: 
+0:?     Sequence
+0:21      Test condition and select ( temp void)
+0:21        Condition
+0:21        x: direct index for structure (layout( row_major std140) uniform bool)
+0:21          direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:21            direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:21              'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:21              Constant:
+0:21                1 (const int)
+0:21            Constant:
+0:21              2 (const int)
+0:21          Constant:
+0:21            0 (const int)
+0:21        true case
+0:22        Branch: Return with expression
+0:22          add ( temp 4-component vector of float)
+0:22            add ( temp 4-component vector of float)
+0:22              x: direct index for structure (layout( row_major std140) uniform 4-component vector of float)
+0:22                'cb1' (layout( binding=12 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float x})
+0:22                Constant:
+0:22                  0 (const int)
+0:22              y: direct index for structure (layout( row_major std140) uniform float)
+0:22                direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:22                  'cb2' (layout( row_major std140) uniform 3-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:22                  Constant:
+0:22                    1 (const int)
+0:22                Constant:
+0:22                  1 (const int)
+0:22            Convert int to float ( temp float)
+0:22              c1: direct index for structure (layout( row_major std140) uniform int)
+0:22                'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1})
+0:22                Constant:
+0:22                  0 (const uint)
+0:21        false case
+0:24        Branch: Return with expression
+0:24          Construct vec4 ( temp 4-component vector of float)
+0:24            y: direct index for structure (layout( row_major std140) uniform float)
+0:24              direct index (layout( row_major std140) temp block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:24                direct index (layout( row_major std140) temp 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:24                  'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:24                  Constant:
+0:24                    2 (const int)
+0:24                Constant:
+0:24                  3 (const int)
+0:24              Constant:
+0:24                1 (const int)
+0:20  Function Definition: main( ( temp void)
+0:20    Function Parameters: 
+0:?     Sequence
+0:20      move second child to first child ( temp 4-component vector of float)
+0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:20        Function Call: @main( ( temp 4-component vector of float)
+0:?   Linker Objects
+0:?     'cb1' (layout( binding=12 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float x})
+0:?     'cb2' (layout( row_major std140) uniform 3-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:?     'cb3' (layout( row_major std140) uniform 2-element array of 4-element array of block{layout( row_major std140) uniform bool x, layout( row_major std140) uniform float y})
+0:?     'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform int c1})
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 66
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 64
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 9  "@main("
+                              Name 12  "cb3"
+                              MemberName 12(cb3) 0  "x"
+                              MemberName 12(cb3) 1  "y"
+                              Name 18  "cb3"
+                              Name 31  "cb1"
+                              MemberName 31(cb1) 0  "x"
+                              Name 33  "cb1"
+                              Name 40  "cb2"
+                              Name 46  "cbuff"
+                              MemberName 46(cbuff) 0  "c1"
+                              Name 48  ""
+                              Name 64  "@entryPointOutput"
+                              MemberDecorate 12(cb3) 0 Offset 0
+                              MemberDecorate 12(cb3) 1 Offset 4
+                              Decorate 12(cb3) Block
+                              Decorate 18(cb3) DescriptorSet 0
+                              MemberDecorate 31(cb1) 0 Offset 0
+                              Decorate 31(cb1) Block
+                              Decorate 33(cb1) DescriptorSet 0
+                              Decorate 33(cb1) Binding 12
+                              Decorate 40(cb2) DescriptorSet 0
+                              MemberDecorate 46(cbuff) 0 Offset 0
+                              Decorate 46(cbuff) Block
+                              Decorate 48 DescriptorSet 0
+                              Decorate 64(@entryPointOutput) Location 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeFloat 32
+               7:             TypeVector 6(float) 4
+               8:             TypeFunction 7(fvec4)
+              11:             TypeInt 32 0
+         12(cb3):             TypeStruct 11(int) 6(float)
+              13:     11(int) Constant 4
+              14:             TypeArray 12(cb3) 13
+              15:     11(int) Constant 2
+              16:             TypeArray 14 15
+              17:             TypePointer Uniform 16
+         18(cb3):     17(ptr) Variable Uniform
+              19:             TypeInt 32 1
+              20:     19(int) Constant 1
+              21:     19(int) Constant 2
+              22:     19(int) Constant 0
+              23:             TypePointer Uniform 11(int)
+              26:             TypeBool
+              27:     11(int) Constant 0
+         31(cb1):             TypeStruct 7(fvec4)
+              32:             TypePointer Uniform 31(cb1)
+         33(cb1):     32(ptr) Variable Uniform
+              34:             TypePointer Uniform 7(fvec4)
+              37:     11(int) Constant 3
+              38:             TypeArray 12(cb3) 37
+              39:             TypePointer Uniform 38
+         40(cb2):     39(ptr) Variable Uniform
+              41:             TypePointer Uniform 6(float)
+       46(cbuff):             TypeStruct 19(int)
+              47:             TypePointer Uniform 46(cbuff)
+              48:     47(ptr) Variable Uniform
+              49:             TypePointer Uniform 19(int)
+              57:     19(int) Constant 3
+              63:             TypePointer Output 7(fvec4)
+64(@entryPointOutput):     63(ptr) Variable Output
+         4(main):           2 Function None 3
+               5:             Label
+              65:    7(fvec4) FunctionCall 9(@main()
+                              Store 64(@entryPointOutput) 65
+                              Return
+                              FunctionEnd
+       9(@main():    7(fvec4) Function None 8
+              10:             Label
+              24:     23(ptr) AccessChain 18(cb3) 20 21 22
+              25:     11(int) Load 24
+              28:    26(bool) INotEqual 25 27
+                              SelectionMerge 30 None
+                              BranchConditional 28 29 56
+              29:               Label
+              35:     34(ptr)   AccessChain 33(cb1) 22
+              36:    7(fvec4)   Load 35
+              42:     41(ptr)   AccessChain 40(cb2) 20 20
+              43:    6(float)   Load 42
+              44:    7(fvec4)   CompositeConstruct 43 43 43 43
+              45:    7(fvec4)   FAdd 36 44
+              50:     49(ptr)   AccessChain 48 22
+              51:     19(int)   Load 50
+              52:    6(float)   ConvertSToF 51
+              53:    7(fvec4)   CompositeConstruct 52 52 52 52
+              54:    7(fvec4)   FAdd 45 53
+                                ReturnValue 54
+              56:               Label
+              58:     41(ptr)   AccessChain 18(cb3) 21 57 20
+              59:    6(float)   Load 58
+              60:    7(fvec4)   CompositeConstruct 59 59 59 59
+                                ReturnValue 60
+              30:             Label
+              62:    7(fvec4) Undef
+                              ReturnValue 62
+                              FunctionEnd

+ 112 - 0
3rdparty/glslang/Test/baseResults/hlsl.emptystruct.init.vert.out

@@ -0,0 +1,112 @@
+hlsl.emptystruct.init.vert
+WARNING: 0:3: 'Test_Empty' : variable with qualifier 'const' not initialized; zero initializing 
+
+Shader version: 500
+0:? Sequence
+0:6  Function Definition: @main(u1; ( temp 4-component vector of float)
+0:6    Function Parameters: 
+0:6      'vertexIndex' ( in uint)
+0:?     Sequence
+0:7      Branch: Return with expression
+0:7        Constant:
+0:7          0.000000
+0:7          0.000000
+0:7          0.000000
+0:7          0.000000
+0:6  Function Definition: main( ( temp void)
+0:6    Function Parameters: 
+0:?     Sequence
+0:6      move second child to first child ( temp uint)
+0:?         'vertexIndex' ( temp uint)
+0:?         'vertexIndex' (layout( location=0) in uint)
+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(u1; ( temp 4-component vector of float)
+0:?           'vertexIndex' ( temp uint)
+0:?   Linker Objects
+0:?     'Test_Empty' ( const structure{})
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:?     'vertexIndex' (layout( location=0) in uint)
+
+
+Linked vertex stage:
+
+
+Shader version: 500
+0:? Sequence
+0:6  Function Definition: @main(u1; ( temp 4-component vector of float)
+0:6    Function Parameters: 
+0:6      'vertexIndex' ( in uint)
+0:?     Sequence
+0:7      Branch: Return with expression
+0:7        Constant:
+0:7          0.000000
+0:7          0.000000
+0:7          0.000000
+0:7          0.000000
+0:6  Function Definition: main( ( temp void)
+0:6    Function Parameters: 
+0:?     Sequence
+0:6      move second child to first child ( temp uint)
+0:?         'vertexIndex' ( temp uint)
+0:?         'vertexIndex' (layout( location=0) in uint)
+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(u1; ( temp 4-component vector of float)
+0:?           'vertexIndex' ( temp uint)
+0:?   Linker Objects
+0:?     'Test_Empty' ( const structure{})
+0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
+0:?     'vertexIndex' (layout( location=0) in uint)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 29
+
+                              Capability Shader
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Vertex 4  "main" 20 23
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 12  "@main(u1;"
+                              Name 11  "vertexIndex"
+                              Name 18  "vertexIndex"
+                              Name 20  "vertexIndex"
+                              Name 23  "@entryPointOutput"
+                              Name 24  "param"
+                              Name 27  "Test"
+                              Decorate 20(vertexIndex) Location 0
+                              Decorate 23(@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:    8(float) Constant 0
+              15:    9(fvec4) ConstantComposite 14 14 14 14
+              19:             TypePointer Input 6(int)
+ 20(vertexIndex):     19(ptr) Variable Input
+              22:             TypePointer Output 9(fvec4)
+23(@entryPointOutput):     22(ptr) Variable Output
+        27(Test):             TypeStruct
+              28:    27(Test) ConstantComposite
+         4(main):           2 Function None 3
+               5:             Label
+ 18(vertexIndex):      7(ptr) Variable Function
+       24(param):      7(ptr) Variable Function
+              21:      6(int) Load 20(vertexIndex)
+                              Store 18(vertexIndex) 21
+              25:      6(int) Load 18(vertexIndex)
+                              Store 24(param) 25
+              26:    9(fvec4) FunctionCall 12(@main(u1;) 24(param)
+                              Store 23(@entryPointOutput) 26
+                              Return
+                              FunctionEnd
+   12(@main(u1;):    9(fvec4) Function None 10
+ 11(vertexIndex):      7(ptr) FunctionParameter
+              13:             Label
+                              ReturnValue 15
+                              FunctionEnd

+ 1 - 1
3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.array.dx10.frag.out

@@ -813,7 +813,7 @@ gl_FragCoord origin is upper left
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
                               MemberDecorate 26($Global) 0 Offset 0
-                              MemberDecorate 26($Global) 1 Offset 8
+                              MemberDecorate 26($Global) 1 Offset 4
                               MemberDecorate 26($Global) 2 Offset 16
                               MemberDecorate 26($Global) 3 Offset 32
                               Decorate 26($Global) Block

+ 1 - 1
3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.basic.dx10.frag.out

@@ -824,7 +824,7 @@ gl_FragCoord origin is upper left
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
                               MemberDecorate 26($Global) 0 Offset 0
-                              MemberDecorate 26($Global) 1 Offset 8
+                              MemberDecorate 26($Global) 1 Offset 4
                               MemberDecorate 26($Global) 2 Offset 16
                               MemberDecorate 26($Global) 3 Offset 32
                               Decorate 26($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offset.dx10.frag.out

@@ -1333,11 +1333,11 @@ gl_FragCoord origin is upper left
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
                               MemberDecorate 30($Global) 0 Offset 0
-                              MemberDecorate 30($Global) 1 Offset 8
+                              MemberDecorate 30($Global) 1 Offset 4
                               MemberDecorate 30($Global) 2 Offset 16
                               MemberDecorate 30($Global) 3 Offset 32
                               MemberDecorate 30($Global) 4 Offset 48
-                              MemberDecorate 30($Global) 5 Offset 56
+                              MemberDecorate 30($Global) 5 Offset 52
                               MemberDecorate 30($Global) 6 Offset 64
                               MemberDecorate 30($Global) 7 Offset 80
                               Decorate 30($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.gatherRGBA.offsetarray.dx10.frag.out

@@ -1322,11 +1322,11 @@ gl_FragCoord origin is upper left
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
                               MemberDecorate 30($Global) 0 Offset 0
-                              MemberDecorate 30($Global) 1 Offset 8
+                              MemberDecorate 30($Global) 1 Offset 4
                               MemberDecorate 30($Global) 2 Offset 16
                               MemberDecorate 30($Global) 3 Offset 32
                               MemberDecorate 30($Global) 4 Offset 48
-                              MemberDecorate 30($Global) 5 Offset 56
+                              MemberDecorate 30($Global) 5 Offset 52
                               MemberDecorate 30($Global) 6 Offset 64
                               MemberDecorate 30($Global) 7 Offset 80
                               Decorate 30($Global) Block

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

@@ -407,7 +407,7 @@ gl_FragCoord origin is upper left
                               Decorate 20(g_sSampCmp) DescriptorSet 0
                               Decorate 20(g_sSampCmp) Binding 0
                               MemberDecorate 27($Global) 0 Offset 0
-                              MemberDecorate 27($Global) 1 Offset 8
+                              MemberDecorate 27($Global) 1 Offset 4
                               MemberDecorate 27($Global) 2 Offset 16
                               MemberDecorate 27($Global) 3 Offset 32
                               Decorate 27($Global) Block

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

@@ -812,11 +812,11 @@ gl_FragCoord origin is upper left
                               Decorate 225(g_sSamp) DescriptorSet 0
                               Decorate 225(g_sSamp) Binding 0
                               MemberDecorate 229($Global) 0 Offset 0
-                              MemberDecorate 229($Global) 1 Offset 8
+                              MemberDecorate 229($Global) 1 Offset 4
                               MemberDecorate 229($Global) 2 Offset 16
                               MemberDecorate 229($Global) 3 Offset 32
                               MemberDecorate 229($Global) 4 Offset 48
-                              MemberDecorate 229($Global) 5 Offset 56
+                              MemberDecorate 229($Global) 5 Offset 52
                               MemberDecorate 229($Global) 6 Offset 64
                               MemberDecorate 229($Global) 7 Offset 80
                               Decorate 229($Global) Block

+ 801 - 32
3rdparty/glslang/Test/baseResults/hlsl.getsampleposition.dx10.frag.out

@@ -1,31 +1,241 @@
 hlsl.getsampleposition.dx10.frag
-ERROR: 0:16: '' : unimplemented: GetSamplePosition 
-ERROR: 0:17: '' : unimplemented: GetSamplePosition 
-ERROR: 2 compilation errors.  No code generated.
-
-
 Shader version: 500
 gl_FragCoord origin is upper left
-ERROR: node is still EOpNull!
-0:13  Function Definition: @main( ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:? Sequence
+0:13  Function Definition: @main(i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:13    Function Parameters: 
+0:13      'sample' ( in int)
 0:?     Sequence
 0:16      Sequence
 0:16        move second child to first child ( temp 2-component vector of float)
 0:16          'r00' ( temp 2-component vector of float)
-0:16          ERROR: Bad aggregation op
- ( temp 2-component vector of float)
-0:16            'g_tTex2dmsf4' ( uniform texture2DMS)
-0:16            Constant:
-0:16              1 (const int)
+0:16          Sequence
+0:16            move second child to first child ( temp uint)
+0:16              '@sampleCount' ( temp uint)
+0:16              imageQuerySamples ( temp uint)
+0:16                'g_tTex2dmsf4' ( uniform texture2DMS)
+0:16            Test condition and select ( temp 2-component vector of float)
+0:16              Condition
+0:16              Compare Equal ( temp bool)
+0:16                '@sampleCount' ( temp uint)
+0:16                Constant:
+0:16                  2 (const int)
+0:16              true case
+0:16              indirect index ( temp 2-component vector of float)
+0:?                 Constant:
+0:?                   0.250000
+0:?                   0.250000
+0:?                   -0.250000
+0:?                   -0.250000
+0:16                'sample' ( in int)
+0:16              false case
+0:16              Test condition and select ( temp 2-component vector of float)
+0:16                Condition
+0:16                Compare Equal ( temp bool)
+0:16                  '@sampleCount' ( temp uint)
+0:16                  Constant:
+0:16                    4 (const int)
+0:16                true case
+0:16                indirect index ( temp 2-component vector of float)
+0:?                   Constant:
+0:?                     -0.125000
+0:?                     -0.375000
+0:?                     0.375000
+0:?                     -0.125000
+0:?                     -0.375000
+0:?                     0.125000
+0:?                     0.125000
+0:?                     0.375000
+0:16                  'sample' ( in int)
+0:16                false case
+0:16                Test condition and select ( temp 2-component vector of float)
+0:16                  Condition
+0:16                  Compare Equal ( temp bool)
+0:16                    '@sampleCount' ( temp uint)
+0:16                    Constant:
+0:16                      8 (const int)
+0:16                  true case
+0:16                  indirect index ( temp 2-component vector of float)
+0:?                     Constant:
+0:?                       0.062500
+0:?                       -0.187500
+0:?                       -0.062500
+0:?                       0.187500
+0:?                       0.312500
+0:?                       0.062500
+0:?                       -0.187500
+0:?                       -0.312500
+0:?                       -0.312500
+0:?                       0.312500
+0:?                       -0.437500
+0:?                       -0.062500
+0:?                       0.187500
+0:?                       0.437500
+0:?                       0.437500
+0:?                       -0.437500
+0:16                    'sample' ( in int)
+0:16                  false case
+0:16                  Test condition and select ( temp 2-component vector of float)
+0:16                    Condition
+0:16                    Compare Equal ( temp bool)
+0:16                      '@sampleCount' ( temp uint)
+0:16                      Constant:
+0:16                        16 (const int)
+0:16                    true case
+0:16                    indirect index ( temp 2-component vector of float)
+0:?                       Constant:
+0:?                         0.062500
+0:?                         0.062500
+0:?                         -0.062500
+0:?                         -0.187500
+0:?                         -0.187500
+0:?                         0.125000
+0:?                         0.250000
+0:?                         -0.062500
+0:?                         -0.312500
+0:?                         -0.125000
+0:?                         0.125000
+0:?                         0.312500
+0:?                         0.312500
+0:?                         0.187500
+0:?                         0.187500
+0:?                         -0.312500
+0:?                         -0.125000
+0:?                         0.375000
+0:?                         0.000000
+0:?                         -0.437500
+0:?                         -0.250000
+0:?                         -0.375000
+0:?                         -0.375000
+0:?                         0.250000
+0:?                         -0.500000
+0:?                         0.000000
+0:?                         0.437500
+0:?                         -0.250000
+0:?                         0.375000
+0:?                         0.437500
+0:?                         -0.437500
+0:?                         -0.500000
+0:16                      'sample' ( in int)
+0:16                    false case
+0:?                     Constant:
+0:?                       0.000000
+0:?                       0.000000
 0:17      Sequence
 0:17        move second child to first child ( temp 2-component vector of float)
 0:17          'r01' ( temp 2-component vector of float)
-0:17          ERROR: Bad aggregation op
- ( temp 2-component vector of float)
-0:17            'g_tTex2dmsf4a' ( uniform texture2DMSArray)
-0:17            Constant:
-0:17              2 (const int)
+0:17          Sequence
+0:17            move second child to first child ( temp uint)
+0:17              '@sampleCount' ( temp uint)
+0:17              imageQuerySamples ( temp uint)
+0:17                'g_tTex2dmsf4a' ( uniform texture2DMSArray)
+0:17            Test condition and select ( temp 2-component vector of float)
+0:17              Condition
+0:17              Compare Equal ( temp bool)
+0:17                '@sampleCount' ( temp uint)
+0:17                Constant:
+0:17                  2 (const int)
+0:17              true case
+0:17              indirect index ( temp 2-component vector of float)
+0:?                 Constant:
+0:?                   0.250000
+0:?                   0.250000
+0:?                   -0.250000
+0:?                   -0.250000
+0:17                'sample' ( in int)
+0:17              false case
+0:17              Test condition and select ( temp 2-component vector of float)
+0:17                Condition
+0:17                Compare Equal ( temp bool)
+0:17                  '@sampleCount' ( temp uint)
+0:17                  Constant:
+0:17                    4 (const int)
+0:17                true case
+0:17                indirect index ( temp 2-component vector of float)
+0:?                   Constant:
+0:?                     -0.125000
+0:?                     -0.375000
+0:?                     0.375000
+0:?                     -0.125000
+0:?                     -0.375000
+0:?                     0.125000
+0:?                     0.125000
+0:?                     0.375000
+0:17                  'sample' ( in int)
+0:17                false case
+0:17                Test condition and select ( temp 2-component vector of float)
+0:17                  Condition
+0:17                  Compare Equal ( temp bool)
+0:17                    '@sampleCount' ( temp uint)
+0:17                    Constant:
+0:17                      8 (const int)
+0:17                  true case
+0:17                  indirect index ( temp 2-component vector of float)
+0:?                     Constant:
+0:?                       0.062500
+0:?                       -0.187500
+0:?                       -0.062500
+0:?                       0.187500
+0:?                       0.312500
+0:?                       0.062500
+0:?                       -0.187500
+0:?                       -0.312500
+0:?                       -0.312500
+0:?                       0.312500
+0:?                       -0.437500
+0:?                       -0.062500
+0:?                       0.187500
+0:?                       0.437500
+0:?                       0.437500
+0:?                       -0.437500
+0:17                    'sample' ( in int)
+0:17                  false case
+0:17                  Test condition and select ( temp 2-component vector of float)
+0:17                    Condition
+0:17                    Compare Equal ( temp bool)
+0:17                      '@sampleCount' ( temp uint)
+0:17                      Constant:
+0:17                        16 (const int)
+0:17                    true case
+0:17                    indirect index ( temp 2-component vector of float)
+0:?                       Constant:
+0:?                         0.062500
+0:?                         0.062500
+0:?                         -0.062500
+0:?                         -0.187500
+0:?                         -0.187500
+0:?                         0.125000
+0:?                         0.250000
+0:?                         -0.062500
+0:?                         -0.312500
+0:?                         -0.125000
+0:?                         0.125000
+0:?                         0.312500
+0:?                         0.312500
+0:?                         0.187500
+0:?                         0.187500
+0:?                         -0.312500
+0:?                         -0.125000
+0:?                         0.375000
+0:?                         0.000000
+0:?                         -0.437500
+0:?                         -0.250000
+0:?                         -0.375000
+0:?                         -0.375000
+0:?                         0.250000
+0:?                         -0.500000
+0:?                         0.000000
+0:?                         0.437500
+0:?                         -0.250000
+0:?                         0.375000
+0:?                         0.437500
+0:?                         -0.437500
+0:?                         -0.500000
+0:17                      'sample' ( in int)
+0:17                    false case
+0:?                     Constant:
+0:?                       0.000000
+0:?                       0.000000
 0:19      move second child to first child ( temp 4-component vector of float)
 0:19        Color: direct index for structure ( temp 4-component vector of float)
 0:19          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
@@ -48,10 +258,14 @@ ERROR: node is still EOpNull!
 0:13  Function Definition: main( ( temp void)
 0:13    Function Parameters: 
 0:?     Sequence
+0:13      move second child to first child ( temp int)
+0:?         'sample' ( temp int)
+0:?         'sample' (layout( location=0) in int)
 0:13      Sequence
 0:13        move second child to first child ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:13          'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:13          Function Call: @main( ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:13          Function Call: @main(i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:?             'sample' ( temp int)
 0:13        move second child to first child ( temp 4-component vector of float)
 0:?           'Color' (layout( location=0) out 4-component vector of float)
 0:13          Color: direct index for structure ( temp 4-component vector of float)
@@ -70,6 +284,7 @@ ERROR: node is still EOpNull!
 0:?     'g_tTex2dmsf4a' ( uniform texture2DMSArray)
 0:?     'Color' (layout( location=0) out 4-component vector of float)
 0:?     'Depth' ( out float FragDepth)
+0:?     'sample' (layout( location=0) in int)
 
 
 Linked fragment stage:
@@ -77,26 +292,241 @@ Linked fragment stage:
 
 Shader version: 500
 gl_FragCoord origin is upper left
-ERROR: node is still EOpNull!
-0:13  Function Definition: @main( ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:? Sequence
+0:13  Function Definition: @main(i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:13    Function Parameters: 
+0:13      'sample' ( in int)
 0:?     Sequence
 0:16      Sequence
 0:16        move second child to first child ( temp 2-component vector of float)
 0:16          'r00' ( temp 2-component vector of float)
-0:16          ERROR: Bad aggregation op
- ( temp 2-component vector of float)
-0:16            'g_tTex2dmsf4' ( uniform texture2DMS)
-0:16            Constant:
-0:16              1 (const int)
+0:16          Sequence
+0:16            move second child to first child ( temp uint)
+0:16              '@sampleCount' ( temp uint)
+0:16              imageQuerySamples ( temp uint)
+0:16                'g_tTex2dmsf4' ( uniform texture2DMS)
+0:16            Test condition and select ( temp 2-component vector of float)
+0:16              Condition
+0:16              Compare Equal ( temp bool)
+0:16                '@sampleCount' ( temp uint)
+0:16                Constant:
+0:16                  2 (const int)
+0:16              true case
+0:16              indirect index ( temp 2-component vector of float)
+0:?                 Constant:
+0:?                   0.250000
+0:?                   0.250000
+0:?                   -0.250000
+0:?                   -0.250000
+0:16                'sample' ( in int)
+0:16              false case
+0:16              Test condition and select ( temp 2-component vector of float)
+0:16                Condition
+0:16                Compare Equal ( temp bool)
+0:16                  '@sampleCount' ( temp uint)
+0:16                  Constant:
+0:16                    4 (const int)
+0:16                true case
+0:16                indirect index ( temp 2-component vector of float)
+0:?                   Constant:
+0:?                     -0.125000
+0:?                     -0.375000
+0:?                     0.375000
+0:?                     -0.125000
+0:?                     -0.375000
+0:?                     0.125000
+0:?                     0.125000
+0:?                     0.375000
+0:16                  'sample' ( in int)
+0:16                false case
+0:16                Test condition and select ( temp 2-component vector of float)
+0:16                  Condition
+0:16                  Compare Equal ( temp bool)
+0:16                    '@sampleCount' ( temp uint)
+0:16                    Constant:
+0:16                      8 (const int)
+0:16                  true case
+0:16                  indirect index ( temp 2-component vector of float)
+0:?                     Constant:
+0:?                       0.062500
+0:?                       -0.187500
+0:?                       -0.062500
+0:?                       0.187500
+0:?                       0.312500
+0:?                       0.062500
+0:?                       -0.187500
+0:?                       -0.312500
+0:?                       -0.312500
+0:?                       0.312500
+0:?                       -0.437500
+0:?                       -0.062500
+0:?                       0.187500
+0:?                       0.437500
+0:?                       0.437500
+0:?                       -0.437500
+0:16                    'sample' ( in int)
+0:16                  false case
+0:16                  Test condition and select ( temp 2-component vector of float)
+0:16                    Condition
+0:16                    Compare Equal ( temp bool)
+0:16                      '@sampleCount' ( temp uint)
+0:16                      Constant:
+0:16                        16 (const int)
+0:16                    true case
+0:16                    indirect index ( temp 2-component vector of float)
+0:?                       Constant:
+0:?                         0.062500
+0:?                         0.062500
+0:?                         -0.062500
+0:?                         -0.187500
+0:?                         -0.187500
+0:?                         0.125000
+0:?                         0.250000
+0:?                         -0.062500
+0:?                         -0.312500
+0:?                         -0.125000
+0:?                         0.125000
+0:?                         0.312500
+0:?                         0.312500
+0:?                         0.187500
+0:?                         0.187500
+0:?                         -0.312500
+0:?                         -0.125000
+0:?                         0.375000
+0:?                         0.000000
+0:?                         -0.437500
+0:?                         -0.250000
+0:?                         -0.375000
+0:?                         -0.375000
+0:?                         0.250000
+0:?                         -0.500000
+0:?                         0.000000
+0:?                         0.437500
+0:?                         -0.250000
+0:?                         0.375000
+0:?                         0.437500
+0:?                         -0.437500
+0:?                         -0.500000
+0:16                      'sample' ( in int)
+0:16                    false case
+0:?                     Constant:
+0:?                       0.000000
+0:?                       0.000000
 0:17      Sequence
 0:17        move second child to first child ( temp 2-component vector of float)
 0:17          'r01' ( temp 2-component vector of float)
-0:17          ERROR: Bad aggregation op
- ( temp 2-component vector of float)
-0:17            'g_tTex2dmsf4a' ( uniform texture2DMSArray)
-0:17            Constant:
-0:17              2 (const int)
+0:17          Sequence
+0:17            move second child to first child ( temp uint)
+0:17              '@sampleCount' ( temp uint)
+0:17              imageQuerySamples ( temp uint)
+0:17                'g_tTex2dmsf4a' ( uniform texture2DMSArray)
+0:17            Test condition and select ( temp 2-component vector of float)
+0:17              Condition
+0:17              Compare Equal ( temp bool)
+0:17                '@sampleCount' ( temp uint)
+0:17                Constant:
+0:17                  2 (const int)
+0:17              true case
+0:17              indirect index ( temp 2-component vector of float)
+0:?                 Constant:
+0:?                   0.250000
+0:?                   0.250000
+0:?                   -0.250000
+0:?                   -0.250000
+0:17                'sample' ( in int)
+0:17              false case
+0:17              Test condition and select ( temp 2-component vector of float)
+0:17                Condition
+0:17                Compare Equal ( temp bool)
+0:17                  '@sampleCount' ( temp uint)
+0:17                  Constant:
+0:17                    4 (const int)
+0:17                true case
+0:17                indirect index ( temp 2-component vector of float)
+0:?                   Constant:
+0:?                     -0.125000
+0:?                     -0.375000
+0:?                     0.375000
+0:?                     -0.125000
+0:?                     -0.375000
+0:?                     0.125000
+0:?                     0.125000
+0:?                     0.375000
+0:17                  'sample' ( in int)
+0:17                false case
+0:17                Test condition and select ( temp 2-component vector of float)
+0:17                  Condition
+0:17                  Compare Equal ( temp bool)
+0:17                    '@sampleCount' ( temp uint)
+0:17                    Constant:
+0:17                      8 (const int)
+0:17                  true case
+0:17                  indirect index ( temp 2-component vector of float)
+0:?                     Constant:
+0:?                       0.062500
+0:?                       -0.187500
+0:?                       -0.062500
+0:?                       0.187500
+0:?                       0.312500
+0:?                       0.062500
+0:?                       -0.187500
+0:?                       -0.312500
+0:?                       -0.312500
+0:?                       0.312500
+0:?                       -0.437500
+0:?                       -0.062500
+0:?                       0.187500
+0:?                       0.437500
+0:?                       0.437500
+0:?                       -0.437500
+0:17                    'sample' ( in int)
+0:17                  false case
+0:17                  Test condition and select ( temp 2-component vector of float)
+0:17                    Condition
+0:17                    Compare Equal ( temp bool)
+0:17                      '@sampleCount' ( temp uint)
+0:17                      Constant:
+0:17                        16 (const int)
+0:17                    true case
+0:17                    indirect index ( temp 2-component vector of float)
+0:?                       Constant:
+0:?                         0.062500
+0:?                         0.062500
+0:?                         -0.062500
+0:?                         -0.187500
+0:?                         -0.187500
+0:?                         0.125000
+0:?                         0.250000
+0:?                         -0.062500
+0:?                         -0.312500
+0:?                         -0.125000
+0:?                         0.125000
+0:?                         0.312500
+0:?                         0.312500
+0:?                         0.187500
+0:?                         0.187500
+0:?                         -0.312500
+0:?                         -0.125000
+0:?                         0.375000
+0:?                         0.000000
+0:?                         -0.437500
+0:?                         -0.250000
+0:?                         -0.375000
+0:?                         -0.375000
+0:?                         0.250000
+0:?                         -0.500000
+0:?                         0.000000
+0:?                         0.437500
+0:?                         -0.250000
+0:?                         0.375000
+0:?                         0.437500
+0:?                         -0.437500
+0:?                         -0.500000
+0:17                      'sample' ( in int)
+0:17                    false case
+0:?                     Constant:
+0:?                       0.000000
+0:?                       0.000000
 0:19      move second child to first child ( temp 4-component vector of float)
 0:19        Color: direct index for structure ( temp 4-component vector of float)
 0:19          'psout' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
@@ -119,10 +549,14 @@ ERROR: node is still EOpNull!
 0:13  Function Definition: main( ( temp void)
 0:13    Function Parameters: 
 0:?     Sequence
+0:13      move second child to first child ( temp int)
+0:?         'sample' ( temp int)
+0:?         'sample' (layout( location=0) in int)
 0:13      Sequence
 0:13        move second child to first child ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
 0:13          'flattenTemp' ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
-0:13          Function Call: @main( ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:13          Function Call: @main(i1; ( temp structure{ temp 4-component vector of float Color,  temp float Depth})
+0:?             'sample' ( temp int)
 0:13        move second child to first child ( temp 4-component vector of float)
 0:?           'Color' (layout( location=0) out 4-component vector of float)
 0:13          Color: direct index for structure ( temp 4-component vector of float)
@@ -141,5 +575,340 @@ ERROR: node is still EOpNull!
 0:?     'g_tTex2dmsf4a' ( uniform texture2DMSArray)
 0:?     'Color' (layout( location=0) out 4-component vector of float)
 0:?     'Depth' ( out float FragDepth)
+0:?     'sample' (layout( location=0) in int)
+
+// Module Version 10000
+// Generated by (magic number): 80001
+// Id's are bound by 221
 
-SPIR-V is not generated for failed compile or link
+                              Capability Shader
+                              Capability ImageMSArray
+                              Capability ImageQuery
+               1:             ExtInstImport  "GLSL.std.450"
+                              MemoryModel Logical GLSL450
+                              EntryPoint Fragment 4  "main" 204 211 215
+                              ExecutionMode 4 OriginUpperLeft
+                              Source HLSL 500
+                              Name 4  "main"
+                              Name 10  "PS_OUTPUT"
+                              MemberName 10(PS_OUTPUT) 0  "Color"
+                              MemberName 10(PS_OUTPUT) 1  "Depth"
+                              Name 13  "@main(i1;"
+                              Name 12  "sample"
+                              Name 17  "r00"
+                              Name 20  "@sampleCount"
+                              Name 23  "g_tTex2dmsf4"
+                              Name 42  "indexable"
+                              Name 65  "indexable"
+                              Name 96  "indexable"
+                              Name 129  "indexable"
+                              Name 138  "r01"
+                              Name 139  "@sampleCount"
+                              Name 142  "g_tTex2dmsf4a"
+                              Name 151  "indexable"
+                              Name 161  "indexable"
+                              Name 171  "indexable"
+                              Name 181  "indexable"
+                              Name 190  "psout"
+                              Name 202  "sample"
+                              Name 204  "sample"
+                              Name 206  "flattenTemp"
+                              Name 207  "param"
+                              Name 211  "Color"
+                              Name 215  "Depth"
+                              Name 220  "g_sSamp"
+                              Decorate 23(g_tTex2dmsf4) DescriptorSet 0
+                              Decorate 142(g_tTex2dmsf4a) DescriptorSet 0
+                              Decorate 204(sample) Location 0
+                              Decorate 211(Color) Location 0
+                              Decorate 215(Depth) BuiltIn FragDepth
+                              Decorate 220(g_sSamp) DescriptorSet 0
+                              Decorate 220(g_sSamp) Binding 0
+               2:             TypeVoid
+               3:             TypeFunction 2
+               6:             TypeInt 32 1
+               7:             TypePointer Function 6(int)
+               8:             TypeFloat 32
+               9:             TypeVector 8(float) 4
+   10(PS_OUTPUT):             TypeStruct 9(fvec4) 8(float)
+              11:             TypeFunction 10(PS_OUTPUT) 7(ptr)
+              15:             TypeVector 8(float) 2
+              16:             TypePointer Function 15(fvec2)
+              18:             TypeInt 32 0
+              19:             TypePointer Function 18(int)
+              21:             TypeImage 8(float) 2D multi-sampled sampled format:Unknown
+              22:             TypePointer UniformConstant 21
+23(g_tTex2dmsf4):     22(ptr) Variable UniformConstant
+              28:      6(int) Constant 2
+              29:             TypeBool
+              33:     18(int) Constant 2
+              34:             TypeArray 15(fvec2) 33
+              35:    8(float) Constant 1048576000
+              36:   15(fvec2) ConstantComposite 35 35
+              37:    8(float) Constant 3196059648
+              38:   15(fvec2) ConstantComposite 37 37
+              39:          34 ConstantComposite 36 38
+              41:             TypePointer Function 34
+              48:      6(int) Constant 4
+              52:     18(int) Constant 4
+              53:             TypeArray 15(fvec2) 52
+              54:    8(float) Constant 3187671040
+              55:    8(float) Constant 3200253952
+              56:   15(fvec2) ConstantComposite 54 55
+              57:    8(float) Constant 1052770304
+              58:   15(fvec2) ConstantComposite 57 54
+              59:    8(float) Constant 1040187392
+              60:   15(fvec2) ConstantComposite 55 59
+              61:   15(fvec2) ConstantComposite 59 57
+              62:          53 ConstantComposite 56 58 60 61
+              64:             TypePointer Function 53
+              71:      6(int) Constant 8
+              75:     18(int) Constant 8
+              76:             TypeArray 15(fvec2) 75
+              77:    8(float) Constant 1031798784
+              78:    8(float) Constant 3191865344
+              79:   15(fvec2) ConstantComposite 77 78
+              80:    8(float) Constant 3179282432
+              81:    8(float) Constant 1044381696
+              82:   15(fvec2) ConstantComposite 80 81
+              83:    8(float) Constant 1050673152
+              84:   15(fvec2) ConstantComposite 83 77
+              85:    8(float) Constant 3198156800
+              86:   15(fvec2) ConstantComposite 78 85
+              87:   15(fvec2) ConstantComposite 85 83
+              88:    8(float) Constant 3202351104
+              89:   15(fvec2) ConstantComposite 88 80
+              90:    8(float) Constant 1054867456
+              91:   15(fvec2) ConstantComposite 81 90
+              92:   15(fvec2) ConstantComposite 90 88
+              93:          76 ConstantComposite 79 82 84 86 87 89 91 92
+              95:             TypePointer Function 76
+             102:      6(int) Constant 16
+             106:     18(int) Constant 16
+             107:             TypeArray 15(fvec2) 106
+             108:   15(fvec2) ConstantComposite 77 77
+             109:   15(fvec2) ConstantComposite 80 78
+             110:   15(fvec2) ConstantComposite 78 59
+             111:   15(fvec2) ConstantComposite 35 80
+             112:   15(fvec2) ConstantComposite 85 54
+             113:   15(fvec2) ConstantComposite 59 83
+             114:   15(fvec2) ConstantComposite 83 81
+             115:   15(fvec2) ConstantComposite 81 85
+             116:   15(fvec2) ConstantComposite 54 57
+             117:    8(float) Constant 0
+             118:   15(fvec2) ConstantComposite 117 88
+             119:   15(fvec2) ConstantComposite 37 55
+             120:   15(fvec2) ConstantComposite 55 35
+             121:    8(float) Constant 3204448256
+             122:   15(fvec2) ConstantComposite 121 117
+             123:   15(fvec2) ConstantComposite 90 37
+             124:   15(fvec2) ConstantComposite 57 90
+             125:   15(fvec2) ConstantComposite 88 121
+             126:         107 ConstantComposite 108 109 110 111 112 113 114 115 116 118 119 120 122 123 124 125
+             128:             TypePointer Function 107
+             133:   15(fvec2) ConstantComposite 117 117
+             140:             TypeImage 8(float) 2D array multi-sampled sampled format:Unknown
+             141:             TypePointer UniformConstant 140
+142(g_tTex2dmsf4a):    141(ptr) Variable UniformConstant
+             189:             TypePointer Function 10(PS_OUTPUT)
+             191:      6(int) Constant 0
+             192:    8(float) Constant 1065353216
+             193:    9(fvec4) ConstantComposite 192 192 192 192
+             194:             TypePointer Function 9(fvec4)
+             196:      6(int) Constant 1
+             197:             TypePointer Function 8(float)
+             203:             TypePointer Input 6(int)
+     204(sample):    203(ptr) Variable Input
+             210:             TypePointer Output 9(fvec4)
+      211(Color):    210(ptr) Variable Output
+             214:             TypePointer Output 8(float)
+      215(Depth):    214(ptr) Variable Output
+             218:             TypeSampler
+             219:             TypePointer UniformConstant 218
+    220(g_sSamp):    219(ptr) Variable UniformConstant
+         4(main):           2 Function None 3
+               5:             Label
+     202(sample):      7(ptr) Variable Function
+206(flattenTemp):    189(ptr) Variable Function
+      207(param):      7(ptr) Variable Function
+             205:      6(int) Load 204(sample)
+                              Store 202(sample) 205
+             208:      6(int) Load 202(sample)
+                              Store 207(param) 208
+             209:10(PS_OUTPUT) FunctionCall 13(@main(i1;) 207(param)
+                              Store 206(flattenTemp) 209
+             212:    194(ptr) AccessChain 206(flattenTemp) 191
+             213:    9(fvec4) Load 212
+                              Store 211(Color) 213
+             216:    197(ptr) AccessChain 206(flattenTemp) 196
+             217:    8(float) Load 216
+                              Store 215(Depth) 217
+                              Return
+                              FunctionEnd
+   13(@main(i1;):10(PS_OUTPUT) Function None 11
+      12(sample):      7(ptr) FunctionParameter
+              14:             Label
+         17(r00):     16(ptr) Variable Function
+20(@sampleCount):     19(ptr) Variable Function
+              26:     16(ptr) Variable Function
+   42(indexable):     41(ptr) Variable Function
+              46:     16(ptr) Variable Function
+   65(indexable):     64(ptr) Variable Function
+              69:     16(ptr) Variable Function
+   96(indexable):     95(ptr) Variable Function
+             100:     16(ptr) Variable Function
+  129(indexable):    128(ptr) Variable Function
+        138(r01):     16(ptr) Variable Function
+139(@sampleCount):     19(ptr) Variable Function
+             145:     16(ptr) Variable Function
+  151(indexable):     41(ptr) Variable Function
+             155:     16(ptr) Variable Function
+  161(indexable):     64(ptr) Variable Function
+             165:     16(ptr) Variable Function
+  171(indexable):     95(ptr) Variable Function
+             175:     16(ptr) Variable Function
+  181(indexable):    128(ptr) Variable Function
+      190(psout):    189(ptr) Variable Function
+              24:          21 Load 23(g_tTex2dmsf4)
+              25:     18(int) ImageQuerySamples 24
+                              Store 20(@sampleCount) 25
+              27:     18(int) Load 20(@sampleCount)
+              30:    29(bool) IEqual 27 28
+                              SelectionMerge 32 None
+                              BranchConditional 30 31 45
+              31:               Label
+              40:      6(int)   Load 12(sample)
+                                Store 42(indexable) 39
+              43:     16(ptr)   AccessChain 42(indexable) 40
+              44:   15(fvec2)   Load 43
+                                Store 26 44
+                                Branch 32
+              45:               Label
+              47:     18(int)   Load 20(@sampleCount)
+              49:    29(bool)   IEqual 47 48
+                                SelectionMerge 51 None
+                                BranchConditional 49 50 68
+              50:                 Label
+              63:      6(int)     Load 12(sample)
+                                  Store 65(indexable) 62
+              66:     16(ptr)     AccessChain 65(indexable) 63
+              67:   15(fvec2)     Load 66
+                                  Store 46 67
+                                  Branch 51
+              68:                 Label
+              70:     18(int)     Load 20(@sampleCount)
+              72:    29(bool)     IEqual 70 71
+                                  SelectionMerge 74 None
+                                  BranchConditional 72 73 99
+              73:                   Label
+              94:      6(int)       Load 12(sample)
+                                    Store 96(indexable) 93
+              97:     16(ptr)       AccessChain 96(indexable) 94
+              98:   15(fvec2)       Load 97
+                                    Store 69 98
+                                    Branch 74
+              99:                   Label
+             101:     18(int)       Load 20(@sampleCount)
+             103:    29(bool)       IEqual 101 102
+                                    SelectionMerge 105 None
+                                    BranchConditional 103 104 132
+             104:                     Label
+             127:      6(int)         Load 12(sample)
+                                      Store 129(indexable) 126
+             130:     16(ptr)         AccessChain 129(indexable) 127
+             131:   15(fvec2)         Load 130
+                                      Store 100 131
+                                      Branch 105
+             132:                     Label
+                                      Store 100 133
+                                      Branch 105
+             105:                   Label
+             134:   15(fvec2)       Load 100
+                                    Store 69 134
+                                    Branch 74
+              74:                 Label
+             135:   15(fvec2)     Load 69
+                                  Store 46 135
+                                  Branch 51
+              51:               Label
+             136:   15(fvec2)   Load 46
+                                Store 26 136
+                                Branch 32
+              32:             Label
+             137:   15(fvec2) Load 26
+                              Store 17(r00) 137
+             143:         140 Load 142(g_tTex2dmsf4a)
+             144:     18(int) ImageQuerySamples 143
+                              Store 139(@sampleCount) 144
+             146:     18(int) Load 139(@sampleCount)
+             147:    29(bool) IEqual 146 28
+                              SelectionMerge 149 None
+                              BranchConditional 147 148 154
+             148:               Label
+             150:      6(int)   Load 12(sample)
+                                Store 151(indexable) 39
+             152:     16(ptr)   AccessChain 151(indexable) 150
+             153:   15(fvec2)   Load 152
+                                Store 145 153
+                                Branch 149
+             154:               Label
+             156:     18(int)   Load 139(@sampleCount)
+             157:    29(bool)   IEqual 156 48
+                                SelectionMerge 159 None
+                                BranchConditional 157 158 164
+             158:                 Label
+             160:      6(int)     Load 12(sample)
+                                  Store 161(indexable) 62
+             162:     16(ptr)     AccessChain 161(indexable) 160
+             163:   15(fvec2)     Load 162
+                                  Store 155 163
+                                  Branch 159
+             164:                 Label
+             166:     18(int)     Load 139(@sampleCount)
+             167:    29(bool)     IEqual 166 71
+                                  SelectionMerge 169 None
+                                  BranchConditional 167 168 174
+             168:                   Label
+             170:      6(int)       Load 12(sample)
+                                    Store 171(indexable) 93
+             172:     16(ptr)       AccessChain 171(indexable) 170
+             173:   15(fvec2)       Load 172
+                                    Store 165 173
+                                    Branch 169
+             174:                   Label
+             176:     18(int)       Load 139(@sampleCount)
+             177:    29(bool)       IEqual 176 102
+                                    SelectionMerge 179 None
+                                    BranchConditional 177 178 184
+             178:                     Label
+             180:      6(int)         Load 12(sample)
+                                      Store 181(indexable) 126
+             182:     16(ptr)         AccessChain 181(indexable) 180
+             183:   15(fvec2)         Load 182
+                                      Store 175 183
+                                      Branch 179
+             184:                     Label
+                                      Store 175 133
+                                      Branch 179
+             179:                   Label
+             185:   15(fvec2)       Load 175
+                                    Store 165 185
+                                    Branch 169
+             169:                 Label
+             186:   15(fvec2)     Load 165
+                                  Store 155 186
+                                  Branch 159
+             159:               Label
+             187:   15(fvec2)   Load 155
+                                Store 145 187
+                                Branch 149
+             149:             Label
+             188:   15(fvec2) Load 145
+                              Store 138(r01) 188
+             195:    194(ptr) AccessChain 190(psout) 191
+                              Store 195 193
+             198:    197(ptr) AccessChain 190(psout) 196
+                              Store 198 192
+             199:10(PS_OUTPUT) Load 190(psout)
+                              ReturnValue 199
+                              FunctionEnd

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

@@ -358,8 +358,8 @@ gl_FragCoord origin is upper left
                               Name 143  "@entryPointOutput"
                               MemberDecorate 16($Global) 0 Offset 0
                               MemberDecorate 16($Global) 1 Offset 4
-                              MemberDecorate 16($Global) 2 Offset 16
-                              MemberDecorate 16($Global) 3 Offset 32
+                              MemberDecorate 16($Global) 2 Offset 8
+                              MemberDecorate 16($Global) 3 Offset 12
                               Decorate 16($Global) Block
                               Decorate 18 DescriptorSet 0
                               Decorate 143(@entryPointOutput) Location 0

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

@@ -196,7 +196,7 @@ gl_FragCoord origin is upper left
                               Name 73  "@finitetmp"
                               Name 93  "@entryPointOutput"
                               MemberDecorate 39($Global) 0 Offset 0
-                              MemberDecorate 39($Global) 1 Offset 8
+                              MemberDecorate 39($Global) 1 Offset 4
                               MemberDecorate 39($Global) 2 Offset 16
                               Decorate 39($Global) Block
                               Decorate 41 DescriptorSet 0

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.2dms.dx10.frag.out

@@ -395,11 +395,11 @@ gl_FragCoord origin is upper left
                               Name 129  "g_sSamp"
                               Decorate 14(g_tTex2dmsf4) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 8
+                              MemberDecorate 20($Global) 1 Offset 4
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 56
+                              MemberDecorate 20($Global) 5 Offset 52
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.array.dx10.frag.out

@@ -440,11 +440,11 @@ gl_FragCoord origin is upper left
                               Name 158  "g_tTexcdu4a"
                               Decorate 14(g_tTex1df4a) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 8
+                              MemberDecorate 20($Global) 1 Offset 4
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 56
+                              MemberDecorate 20($Global) 5 Offset 52
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block

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

@@ -543,11 +543,11 @@ gl_FragCoord origin is upper left
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 8
+                              MemberDecorate 20($Global) 1 Offset 4
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 56
+                              MemberDecorate 20($Global) 5 Offset 52
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block

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

@@ -505,11 +505,11 @@ Shader version: 500
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 8
+                              MemberDecorate 20($Global) 1 Offset 4
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 56
+                              MemberDecorate 20($Global) 5 Offset 52
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.buffer.dx10.frag.out

@@ -202,11 +202,11 @@ gl_FragCoord origin is upper left
                               Name 71  "g_tTexbf4_test"
                               Decorate 16(g_tTexbf4) DescriptorSet 0
                               MemberDecorate 22($Global) 0 Offset 0
-                              MemberDecorate 22($Global) 1 Offset 8
+                              MemberDecorate 22($Global) 1 Offset 4
                               MemberDecorate 22($Global) 2 Offset 16
                               MemberDecorate 22($Global) 3 Offset 32
                               MemberDecorate 22($Global) 4 Offset 48
-                              MemberDecorate 22($Global) 5 Offset 56
+                              MemberDecorate 22($Global) 5 Offset 52
                               MemberDecorate 22($Global) 6 Offset 64
                               MemberDecorate 22($Global) 7 Offset 80
                               Decorate 22($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.buffer.float.dx10.frag.out

@@ -208,11 +208,11 @@ gl_FragCoord origin is upper left
                               Name 74  "g_tTexbfs_test"
                               Decorate 16(g_tTexbfs) DescriptorSet 0
                               MemberDecorate 22($Global) 0 Offset 0
-                              MemberDecorate 22($Global) 1 Offset 8
+                              MemberDecorate 22($Global) 1 Offset 4
                               MemberDecorate 22($Global) 2 Offset 16
                               MemberDecorate 22($Global) 3 Offset 32
                               MemberDecorate 22($Global) 4 Offset 48
-                              MemberDecorate 22($Global) 5 Offset 56
+                              MemberDecorate 22($Global) 5 Offset 52
                               MemberDecorate 22($Global) 6 Offset 64
                               MemberDecorate 22($Global) 7 Offset 80
                               Decorate 22($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.offset.dx10.frag.out

@@ -616,11 +616,11 @@ gl_FragCoord origin is upper left
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 8
+                              MemberDecorate 20($Global) 1 Offset 4
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 56
+                              MemberDecorate 20($Global) 5 Offset 52
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.offsetarray.dx10.frag.out

@@ -489,11 +489,11 @@ gl_FragCoord origin is upper left
                               Name 173  "g_tTexcdu4a"
                               Decorate 14(g_tTex1df4a) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 8
+                              MemberDecorate 20($Global) 1 Offset 4
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 56
+                              MemberDecorate 20($Global) 5 Offset 52
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.rwbuffer.dx10.frag.out

@@ -141,11 +141,11 @@ gl_FragCoord origin is upper left
                               Name 54  "Color"
                               Decorate 14(g_tBuffF) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 8
+                              MemberDecorate 20($Global) 1 Offset 4
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 56
+                              MemberDecorate 20($Global) 5 Offset 52
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.array.dx10.frag.out

@@ -253,11 +253,11 @@ gl_FragCoord origin is upper left
                               Name 118  "g_tTex3du4"
                               Decorate 14(g_tTex1df4a) DescriptorSet 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 8
+                              MemberDecorate 20($Global) 1 Offset 4
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 56
+                              MemberDecorate 20($Global) 5 Offset 52
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.load.rwtexture.dx10.frag.out

@@ -290,11 +290,11 @@ gl_FragCoord origin is upper left
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
-                              MemberDecorate 20($Global) 1 Offset 8
+                              MemberDecorate 20($Global) 1 Offset 4
                               MemberDecorate 20($Global) 2 Offset 16
                               MemberDecorate 20($Global) 3 Offset 32
                               MemberDecorate 20($Global) 4 Offset 48
-                              MemberDecorate 20($Global) 5 Offset 56
+                              MemberDecorate 20($Global) 5 Offset 52
                               MemberDecorate 20($Global) 6 Offset 64
                               MemberDecorate 20($Global) 7 Offset 80
                               Decorate 20($Global) Block

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.multiReturn.frag.out

@@ -72,9 +72,9 @@ gl_FragCoord origin is upper left
                               MemberName 16(bufName) 0  "s"
                               Name 18  ""
                               MemberDecorate 15(S) 0 Offset 0
-                              MemberDecorate 15(S) 1 Offset 16
+                              MemberDecorate 15(S) 1 Offset 4
                               MemberDecorate 15(S) 2 RowMajor
-                              MemberDecorate 15(S) 2 Offset 32
+                              MemberDecorate 15(S) 2 Offset 16
                               MemberDecorate 15(S) 2 MatrixStride 16
                               MemberDecorate 16(bufName) 0 Offset 0
                               Decorate 16(bufName) Block

+ 1 - 1
3rdparty/glslang/Test/baseResults/hlsl.rw.atomics.frag.out

@@ -3998,7 +3998,7 @@ gl_FragCoord origin is upper left
                               Name 1146  "g_tBuffF"
                               Decorate 15(g_tTex1di1) DescriptorSet 0
                               MemberDecorate 21($Global) 0 Offset 0
-                              MemberDecorate 21($Global) 1 Offset 8
+                              MemberDecorate 21($Global) 1 Offset 4
                               MemberDecorate 21($Global) 2 Offset 16
                               MemberDecorate 21($Global) 3 Offset 28
                               MemberDecorate 21($Global) 4 Offset 32

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.rw.bracket.frag.out

@@ -1881,11 +1881,11 @@ gl_FragCoord origin is upper left
                               Name 603  "g_tTex2di4a"
                               Name 606  "g_tTex2du4a"
                               MemberDecorate 63($Global) 0 Offset 0
-                              MemberDecorate 63($Global) 1 Offset 8
+                              MemberDecorate 63($Global) 1 Offset 4
                               MemberDecorate 63($Global) 2 Offset 16
                               MemberDecorate 63($Global) 3 Offset 32
                               MemberDecorate 63($Global) 4 Offset 48
-                              MemberDecorate 63($Global) 5 Offset 56
+                              MemberDecorate 63($Global) 5 Offset 52
                               MemberDecorate 63($Global) 6 Offset 64
                               MemberDecorate 63($Global) 7 Offset 80
                               MemberDecorate 63($Global) 8 Offset 96

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.rw.scalar.bracket.frag.out

@@ -1827,11 +1827,11 @@ gl_FragCoord origin is upper left
                               Name 567  "g_tTex2di1a"
                               Name 570  "g_tTex2du1a"
                               MemberDecorate 59($Global) 0 Offset 0
-                              MemberDecorate 59($Global) 1 Offset 8
+                              MemberDecorate 59($Global) 1 Offset 4
                               MemberDecorate 59($Global) 2 Offset 16
                               MemberDecorate 59($Global) 3 Offset 32
                               MemberDecorate 59($Global) 4 Offset 48
-                              MemberDecorate 59($Global) 5 Offset 56
+                              MemberDecorate 59($Global) 5 Offset 52
                               MemberDecorate 59($Global) 6 Offset 64
                               MemberDecorate 59($Global) 7 Offset 80
                               MemberDecorate 59($Global) 8 Offset 96

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.rw.vec2.bracket.frag.out

@@ -1846,11 +1846,11 @@ gl_FragCoord origin is upper left
                               Name 601  "g_tTex2di2a"
                               Name 604  "g_tTex2du2a"
                               MemberDecorate 64($Global) 0 Offset 0
-                              MemberDecorate 64($Global) 1 Offset 8
+                              MemberDecorate 64($Global) 1 Offset 4
                               MemberDecorate 64($Global) 2 Offset 16
                               MemberDecorate 64($Global) 3 Offset 32
                               MemberDecorate 64($Global) 4 Offset 48
-                              MemberDecorate 64($Global) 5 Offset 56
+                              MemberDecorate 64($Global) 5 Offset 52
                               MemberDecorate 64($Global) 6 Offset 64
                               MemberDecorate 64($Global) 7 Offset 80
                               MemberDecorate 64($Global) 8 Offset 96

+ 2 - 2
3rdparty/glslang/Test/baseResults/hlsl.tx.bracket.frag.out

@@ -484,11 +484,11 @@ gl_FragCoord origin is upper left
                               Name 184  "g_tTex2di4a"
                               Name 187  "g_tTex2du4a"
                               MemberDecorate 45($Global) 0 Offset 0
-                              MemberDecorate 45($Global) 1 Offset 8
+                              MemberDecorate 45($Global) 1 Offset 4
                               MemberDecorate 45($Global) 2 Offset 16
                               MemberDecorate 45($Global) 3 Offset 32
                               MemberDecorate 45($Global) 4 Offset 48
-                              MemberDecorate 45($Global) 5 Offset 56
+                              MemberDecorate 45($Global) 5 Offset 52
                               MemberDecorate 45($Global) 6 Offset 64
                               MemberDecorate 45($Global) 7 Offset 80
                               Decorate 45($Global) Block

+ 26 - 0
3rdparty/glslang/Test/hlsl.constantbuffer.frag

@@ -0,0 +1,26 @@
+
+struct c1_t {
+    float4 x;
+};
+
+struct c2_t {
+    bool x;
+    float y;
+};
+
+ConstantBuffer<c1_t> cb1 : register(b12);
+ConstantBuffer<c2_t> cb2[3];
+ConstantBuffer<c2_t> cb3[2][4];
+
+cbuffer cbuff {
+    int c1;
+};
+
+float4 main() : SV_Target0
+{
+    if (cb3[1][2].x)
+        return cb1.x + cb2[1].y + c1;
+    else
+        return cb3[2][3].y;
+}
+

+ 8 - 0
3rdparty/glslang/Test/hlsl.emptystruct.init.vert

@@ -0,0 +1,8 @@
+struct Test { };
+
+static const Test Test_Empty;
+
+float4 main(in uint vertexIndex : VERTEXID) : VS_OUT_POSITION
+{
+    return 0;
+}

+ 3 - 3
3rdparty/glslang/Test/hlsl.getsampleposition.dx10.frag

@@ -9,12 +9,12 @@ struct PS_OUTPUT
     float  Depth : SV_Depth;
 };
 
-PS_OUTPUT main()
+PS_OUTPUT main(int sample : SAMPLE)
 {
    PS_OUTPUT psout;
 
-   float2 r00 = g_tTex2dmsf4.GetSamplePosition(1);
-   float2 r01 = g_tTex2dmsf4a.GetSamplePosition(2);
+   float2 r00 = g_tTex2dmsf4.GetSamplePosition(sample);
+   float2 r01 = g_tTex2dmsf4a.GetSamplePosition(sample);
 
    psout.Color = 1.0;
    psout.Depth = 1.0;

+ 1 - 1
3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp

@@ -726,7 +726,7 @@ bool ProcessDeferred(
     intermediate.setSpv(spvVersion);
     if (spvVersion.vulkan >= 100)
         intermediate.setOriginUpperLeft();
-    if (messages & EShMsgHlslOffsets) // source-language independent
+    if ((messages & EShMsgHlslOffsets) || (messages & EShMsgReadHlsl))
         intermediate.setHlslOffsets();
     SetupBuiltinSymbolTable(version, profile, spvVersion, source);
 

+ 45 - 4
3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp

@@ -201,11 +201,41 @@ public:
     const TVarLiveMap&    uniformList;
 };
 
+struct TNotifyUniformAdaptor
+{
+    EShLanguage stage;
+    TIoMapResolver& resolver;
+    inline TNotifyUniformAdaptor(EShLanguage s, TIoMapResolver& r)
+      : stage(s)
+      , resolver(r)
+    {
+    }
+    inline void operator()(TVarEntryInfo& ent)
+    {
+        resolver.notifyBinding(stage, ent.symbol->getName().c_str(), ent.symbol->getType(), ent.live);
+    }
+};
+
+struct TNotifyInOutAdaptor
+{
+    EShLanguage stage;
+    TIoMapResolver& resolver;
+    inline TNotifyInOutAdaptor(EShLanguage s, TIoMapResolver& r)
+      : stage(s)
+      , resolver(r)
+    {
+    }
+    inline void operator()(TVarEntryInfo& ent)
+    {
+        resolver.notifyInOut(stage, ent.symbol->getName().c_str(), ent.symbol->getType(), ent.live);
+    }
+};
+
 struct TResolverUniformAdaptor
 {
     TResolverUniformAdaptor(EShLanguage s, TIoMapResolver& r, TInfoSink& i, bool& e, TIntermediate& interm)
-      : resolver(r)
-      , stage(s)
+      : stage(s)
+      , resolver(r)
       , infoSink(i)
       , error(e)
       , intermediate(interm)
@@ -260,8 +290,8 @@ private:
 struct TResolverInOutAdaptor
 {
     TResolverInOutAdaptor(EShLanguage s, TIoMapResolver& r, TInfoSink& i, bool& e, TIntermediate& interm)
-      : resolver(r)
-      , stage(s)
+      : stage(s)
+      , resolver(r)
       , infoSink(i)
       , error(e)
       , intermediate(interm)
@@ -383,6 +413,10 @@ struct TDefaultIoResolverBase : public glslang::TIoMapResolver
         return -1;
     }
 
+    void notifyBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) override {}
+    void notifyInOut(EShLanguage stage, const char* name, const TType& type, bool is_live) override {}
+    void endNotifications() override {}
+
 protected:
     static int getLayoutSet(const glslang::TType& type) {
         if (type.getQualifier().hasSet())
@@ -532,6 +566,7 @@ u – for unordered access views (UAV)
 
 b – for constant buffer views (CBV)
    CBUFFER
+   CONSTANTBUFFER
  ********************************************************************************/
 struct TDefaultHlslIoResolver : public TDefaultIoResolverBase
 {
@@ -673,8 +708,14 @@ bool TIoMapper::addStage(EShLanguage stage, TIntermediate &intermediate, TInfoSi
     std::sort(uniformVarMap.begin(), uniformVarMap.end(), TVarEntryInfo::TOrderByPriority());
 
     bool hadError = false;
+    TNotifyInOutAdaptor inOutNotify(stage, *resolver);
+    TNotifyUniformAdaptor uniformNotify(stage, *resolver);
     TResolverUniformAdaptor uniformResolve(stage, *resolver, infoSink, hadError, intermediate);
     TResolverInOutAdaptor inOutResolve(stage, *resolver, infoSink, hadError, intermediate);
+    std::for_each(inVarMap.begin(), inVarMap.end(), inOutNotify);
+    std::for_each(outVarMap.begin(), outVarMap.end(), inOutNotify);
+    std::for_each(uniformVarMap.begin(), uniformVarMap.end(), uniformNotify);
+    resolver->endNotifications();
     std::for_each(inVarMap.begin(), inVarMap.end(), inOutResolve);
     std::for_each(outVarMap.begin(), outVarMap.end(), inOutResolve);
     std::for_each(uniformVarMap.begin(), uniformVarMap.end(), uniformResolve);

+ 0 - 6
3rdparty/glslang/glslang/MachineIndependent/parseConst.cpp

@@ -76,12 +76,6 @@ bool TConstTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
         return false;
     }
 
-    if (node->getSequence().size() == 0) {
-        error = true;
-
-        return false;
-    }
-
     bool flag = node->getSequence().size() == 1 && node->getSequence()[0]->getAsTyped()->getAsConstantUnion();
     if (flag) {
         singleConstantParam = true;

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

@@ -463,6 +463,13 @@ class TIoMapper;
 // 5) all uniforms with set but no binding defined
 // 6) all uniforms with no binding and no set defined
 //
+// mapIO will use this resolver in two phases. The first
+// phase is a notification phase, calling the corresponging
+// notifiy callbacks, this phase ends with a call to endNotifications.
+// Phase two starts directly after the call to endNotifications
+// and calls all other callbacks to validate and to get the
+// bindings, sets, locations, component and color indices. 
+//
 // NOTE: that still limit checks are applied to bindings and sets
 // and may result in an error.
 class TIoMapResolver
@@ -491,6 +498,12 @@ public:
   // Should return a value >= 0 if the current color index should be overridden.
   // Return -1 if the current color index (including no index) should be kept.
   virtual int resolveInOutIndex(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
+  // Notification of a uniform variable
+  virtual void notifyBinding(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
+  // Notification of a in or out variable
+  virtual void notifyInOut(EShLanguage stage, const char* name, const TType& type, bool is_live) = 0;
+  // Called by mapIO when it has finished the notify pass
+  virtual void endNotifications() = 0;
 };
 
 // Make one TProgram per set of shaders that will get linked together.  Add all

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

@@ -98,6 +98,7 @@ INSTANTIATE_TEST_CASE_P(
         {"hlsl.clip.frag", "main"},
         {"hlsl.comparison.vec.frag", "main"},
         {"hlsl.conditional.frag", "PixelShaderFunction"},
+        {"hlsl.constantbuffer.frag", "main"},
         {"hlsl.constructexpr.frag", "main"},
         {"hlsl.depthGreater.frag", "PixelShaderFunction"},
         {"hlsl.depthLess.frag", "PixelShaderFunction"},
@@ -105,6 +106,7 @@ INSTANTIATE_TEST_CASE_P(
         {"hlsl.doLoop.frag", "PixelShaderFunction"},
         {"hlsl.emptystructreturn.frag", "main"},
         {"hlsl.emptystructreturn.vert", "main"},
+        {"hlsl.emptystruct.init.vert", "main"},
         {"hlsl.entry-in.frag", "PixelShaderFunction"},
         {"hlsl.entry-out.frag", "PixelShaderFunction"},
         {"hlsl.float1.frag", "PixelShaderFunction"},

+ 46 - 1
3rdparty/glslang/hlsl/hlslGrammar.cpp

@@ -476,7 +476,8 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& nodeList)
                 if (typedefDecl)
                     parseContext.declareTypedef(idToken.loc, *fullName, variableType);
                 else if (variableType.getBasicType() == EbtBlock) {
-                    parseContext.declareBlock(idToken.loc, variableType, fullName);
+                    parseContext.declareBlock(idToken.loc, variableType, fullName,
+                                              variableType.isArray() ? &variableType.getArraySizes() : nullptr);
                     parseContext.declareStructBufferCounter(idToken.loc, variableType, *fullName);
                 } else {
                     if (variableType.getQualifier().storage == EvqUniform && ! variableType.containsOpaque()) {
@@ -1364,6 +1365,9 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList)
         return acceptStructBufferType(type);
         break;
 
+    case EHTokConstantBuffer:
+        return acceptConstantBufferType(type);
+
     case EHTokClass:
     case EHTokStruct:
     case EHTokCBuffer:
@@ -1944,6 +1948,47 @@ bool HlslGrammar::acceptStruct(TType& type, TIntermNode*& nodeList)
     return deferredSuccess;
 }
 
+// constantbuffer
+//    : CONSTANTBUFFER LEFT_ANGLE type RIGHT_ANGLE
+bool HlslGrammar::acceptConstantBufferType(TType& type)
+{
+    if (! acceptTokenClass(EHTokConstantBuffer))
+        return false;
+
+    if (! acceptTokenClass(EHTokLeftAngle)) {
+        expected("left angle bracket");
+        return false;
+    }
+    
+    TType templateType;
+    if (! acceptType(templateType)) {
+        expected("type");
+        return false;
+    }
+
+    if (! acceptTokenClass(EHTokRightAngle)) {
+        expected("right angle bracket");
+        return false;
+    }
+
+    TQualifier postDeclQualifier;
+    postDeclQualifier.clear();
+    postDeclQualifier.storage = EvqUniform;
+
+    if (templateType.isStruct()) {
+        // Make a block from the type parsed as the template argument
+        TTypeList* typeList = templateType.getWritableStruct();
+        new(&type) TType(typeList, "", postDeclQualifier); // sets EbtBlock
+
+        type.getQualifier().storage = EvqUniform;
+
+        return true;
+    } else {
+        parseContext.error(token.loc, "non-structure type in ConstantBuffer", "", "");
+        return false;
+    }
+}
+
 // struct_buffer
 //    : APPENDSTRUCTUREDBUFFER
 //    | BYTEADDRESSBUFFER

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

@@ -87,6 +87,7 @@ namespace glslang {
         bool acceptSamplerType(TType&);
         bool acceptTextureType(TType&);
         bool acceptStructBufferType(TType&);
+        bool acceptConstantBufferType(TType&);
         bool acceptStruct(TType&, TIntermNode*& nodeList);
         bool acceptStructDeclarationList(TTypeList*&, TIntermNode*& nodeList, TVector<TFunctionDeclarator>&);
         bool acceptMemberFunctionDefinition(TIntermNode*& nodeList, const TType&, const TString& memberName,

+ 130 - 3
3rdparty/glslang/hlsl/hlslParseHelper.cpp

@@ -61,14 +61,14 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int
     loopNestingLevel(0), annotationNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0),
     postEntryPointReturn(false),
     limits(resources.limits),
+    inputPatch(nullptr),
     builtInIoIndex(nullptr),
     builtInIoBase(nullptr),
     nextInLocation(0), nextOutLocation(0),
     sourceEntryPointName(sourceEntryPointName),
     entryPointFunction(nullptr),
     entryPointFunctionBody(nullptr),
-    gsStreamOutput(nullptr),
-    inputPatch(nullptr)
+    gsStreamOutput(nullptr)
 {
     globalUniformDefaults.clear();
     globalUniformDefaults.layoutMatrix = ElmRowMajor;
@@ -2843,7 +2843,73 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
         break; // most pass through unchanged
     }
 }
+
+// Create array of standard sample positions for given sample count.
+// TODO: remove when a real method to query sample pos exists in SPIR-V.
+TIntermConstantUnion* HlslParseContext::getSamplePosArray(int count)
+{
+    struct tSamplePos { float x, y; };
+
+    static const tSamplePos pos1[] = {
+        { 0.0/16.0,  0.0/16.0 },
+    };
+
+    // standard sample positions for 2, 4, 8, and 16 samples.
+    static const tSamplePos pos2[] = {
+        { 4.0/16.0,  4.0/16.0 }, {-4.0/16.0, -4.0/16.0 },
+    };
+
+    static const tSamplePos pos4[] = {
+        {-2.0/16.0, -6.0/16.0 }, { 6.0/16.0, -2.0/16.0 }, {-6.0/16.0,  2.0/16.0 }, { 2.0/16.0,  6.0/16.0 },
+    };
+
+    static const tSamplePos pos8[] = {
+        { 1.0/16.0, -3.0/16.0 }, {-1.0/16.0,  3.0/16.0 }, { 5.0/16.0,  1.0/16.0 }, {-3.0/16.0, -5.0/16.0 },
+        {-5.0/16.0,  5.0/16.0 }, {-7.0/16.0, -1.0/16.0 }, { 3.0/16.0,  7.0/16.0 }, { 7.0/16.0, -7.0/16.0 },
+    };
+
+    static const tSamplePos pos16[] = {
+        { 1.0/16.0,  1.0/16.0 }, {-1.0/16.0, -3.0/16.0 }, {-3.0/16.0,  2.0/16.0 }, { 4.0/16.0, -1.0/16.0 },
+        {-5.0/16.0, -2.0/16.0 }, { 2.0/16.0,  5.0/16.0 }, { 5.0/16.0,  3.0/16.0 }, { 3.0/16.0, -5.0/16.0 },
+        {-2.0/16.0,  6.0/16.0 }, { 0.0/16.0, -7.0/16.0 }, {-4.0/16.0, -6.0/16.0 }, {-6.0/16.0,  4.0/16.0 },
+        {-8.0/16.0,  0.0/16.0 }, { 7.0/16.0, -4.0/16.0 }, { 6.0/16.0,  7.0/16.0 }, {-7.0/16.0, -8.0/16.0 },
+    };
+
+    const tSamplePos* sampleLoc = nullptr;
+    int numSamples = count;
+
+    switch (count) {
+    case 2:  sampleLoc = pos2;  break;
+    case 4:  sampleLoc = pos4;  break;
+    case 8:  sampleLoc = pos8;  break;
+    case 16: sampleLoc = pos16; break;
+    default:
+        sampleLoc = pos1;
+        numSamples = 1;
+    }
+
+    TConstUnionArray* values = new TConstUnionArray(numSamples*2);
     
+    for (int pos=0; pos<count; ++pos) {
+        TConstUnion x, y;
+        x.setDConst(sampleLoc[pos].x);
+        y.setDConst(sampleLoc[pos].y);
+
+        (*values)[pos*2+0] = x;
+        (*values)[pos*2+1] = y;
+    }
+
+    TType retType(EbtFloat, EvqConst, 2);
+
+    if (numSamples != 1) {
+        TArraySizes arraySizes;
+        arraySizes.addInnerSize(numSamples);
+        retType.newArraySizes(arraySizes);
+    }
+
+    return new TIntermConstantUnion(*values, retType);
+}
+
 //
 // Decompose DX9 and DX10 sample intrinsics & object methods into AST
 //
@@ -3510,7 +3576,68 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
 
     case EOpMethodGetSamplePosition:
         {
-            error(loc, "unimplemented: GetSamplePosition", "", "");
+            // TODO: this entire decomposition exists because there is not yet a way to query
+            // the sample position directly through SPIR-V.  Instead, we return fixed sample
+            // positions for common cases.  *** If the sample positions are set differently,
+            // this will be wrong. ***
+
+            TIntermTyped* argTex     = argAggregate->getSequence()[0]->getAsTyped();
+            TIntermTyped* argSampIdx = argAggregate->getSequence()[1]->getAsTyped();
+
+            TIntermAggregate* samplesQuery = new TIntermAggregate(EOpImageQuerySamples);
+            samplesQuery->getSequence().push_back(argTex);
+            samplesQuery->setType(TType(EbtUint, EvqTemporary, 1));
+            samplesQuery->setLoc(loc);
+
+            TIntermAggregate* compoundStatement = nullptr;
+
+            TVariable* outSampleCount = makeInternalVariable("@sampleCount", TType(EbtUint));
+            outSampleCount->getWritableType().getQualifier().makeTemporary();
+            TIntermTyped* compAssign = intermediate.addAssign(EOpAssign, intermediate.addSymbol(*outSampleCount, loc),
+                                                              samplesQuery, loc);
+            compoundStatement = intermediate.growAggregate(compoundStatement, compAssign);
+
+            TIntermTyped* idxtest[4];
+
+            // Create tests against 2, 4, 8, and 16 sample values
+            int count = 0;
+            for (int val = 2; val <= 16; val *= 2)
+                idxtest[count++] =
+                    intermediate.addBinaryNode(EOpEqual, 
+                                               intermediate.addSymbol(*outSampleCount, loc),
+                                               intermediate.addConstantUnion(val, loc),
+                                               loc, TType(EbtBool));
+
+            const TOperator idxOp = (argSampIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect;
+            
+            // Create index ops into position arrays given sample index.
+            // TODO: should it be clamped?
+            TIntermTyped* index[4];
+            count = 0;
+            for (int val = 2; val <= 16; val *= 2) {
+                index[count] = intermediate.addIndex(idxOp, getSamplePosArray(val), argSampIdx, loc);
+                index[count++]->setType(TType(EbtFloat, EvqTemporary, 2));
+            }
+
+            // Create expression as:
+            // (sampleCount == 2)  ? pos2[idx] :
+            // (sampleCount == 4)  ? pos4[idx] :
+            // (sampleCount == 8)  ? pos8[idx] :
+            // (sampleCount == 16) ? pos16[idx] : float2(0,0);
+            TIntermTyped* test = 
+                intermediate.addSelection(idxtest[0], index[0], 
+                    intermediate.addSelection(idxtest[1], index[1], 
+                        intermediate.addSelection(idxtest[2], index[2],
+                            intermediate.addSelection(idxtest[3], index[3], 
+                                                      getSamplePosArray(1), loc), loc), loc), loc);
+                                         
+            compoundStatement = intermediate.growAggregate(compoundStatement, test);
+            compoundStatement->setOperator(EOpSequence);
+            compoundStatement->setLoc(loc);
+            compoundStatement->setType(TType(EbtFloat, EvqTemporary, 2));
+
+            node = compoundStatement;
+
             break;
         }
 

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

@@ -273,6 +273,9 @@ protected:
     // Test method names
     bool isStructBufferMethod(const TString& name) const;
 
+    // Return standard sample position array
+    TIntermConstantUnion* getSamplePosArray(int count);
+
     TType* getStructBufferContentType(const TType& type) const;
     bool isStructBufferType(const TType& type) const { return getStructBufferContentType(type) != nullptr; }
     TIntermTyped* indexStructBufferContent(const TSourceLoc& loc, TIntermTyped* buffer) const;

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

@@ -331,6 +331,7 @@ void HlslScanContext::fillInKeywordMap()
     (*KeywordMap)["class"] =                   EHTokClass;
     (*KeywordMap)["struct"] =                  EHTokStruct;
     (*KeywordMap)["cbuffer"] =                 EHTokCBuffer;
+    (*KeywordMap)["ConstantBuffer"] =          EHTokConstantBuffer;
     (*KeywordMap)["tbuffer"] =                 EHTokTBuffer;
     (*KeywordMap)["typedef"] =                 EHTokTypedef;
     (*KeywordMap)["this"] =                    EHTokThis;
@@ -827,6 +828,7 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier()
     case EHTokStruct:
     case EHTokTypedef:
     case EHTokCBuffer:
+    case EHTokConstantBuffer:
     case EHTokTBuffer:
     case EHTokThis:
     case EHTokNamespace:

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

@@ -275,6 +275,7 @@ enum EHlslTokenClass {
     EHTokTypedef,
     EHTokThis,
     EHTokNamespace,
+    EHTokConstantBuffer,
 
     // constant
     EHTokFloatConstant,