diff --git a/Test/baseResults/hlsl.basic.geom.out b/Test/baseResults/hlsl.basic.geom.out
index 64239c5df1739f6251155fd52d3963cd5bd89ed5..9e9628eca39638efad2ac9e9c31d32ab5cfbd235 100644
--- a/Test/baseResults/hlsl.basic.geom.out
+++ b/Test/baseResults/hlsl.basic.geom.out
@@ -42,14 +42,34 @@ output primitive = line_strip
 0:20            Constant:
 0:20              0 (const int)
 0:22      Sequence
-0:22        move second child to first child ( temp structure{ temp float myfloat,  temp int something})
-0:22          'OutputStream' (layout( location=0) out structure{ temp float myfloat,  temp int something})
-0:22          'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:22        Sequence
+0:22          move second child to first child ( temp float)
+0:?             'myfloat' (layout( location=0) out float)
+0:22            myfloat: direct index for structure ( temp float)
+0:22              'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:22              Constant:
+0:22                0 (const int)
+0:22          move second child to first child ( temp int)
+0:?             'something' (layout( location=1) out int)
+0:22            something: direct index for structure ( temp int)
+0:22              'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:22              Constant:
+0:22                1 (const int)
 0:22        EmitVertex ( temp void)
 0:23      Sequence
-0:23        move second child to first child ( temp structure{ temp float myfloat,  temp int something})
-0:23          'OutputStream' (layout( location=0) out structure{ temp float myfloat,  temp int something})
-0:23          'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:23        Sequence
+0:23          move second child to first child ( temp float)
+0:?             'myfloat' (layout( location=0) out float)
+0:23            myfloat: direct index for structure ( temp float)
+0:23              'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:23              Constant:
+0:23                0 (const int)
+0:23          move second child to first child ( temp int)
+0:?             'something' (layout( location=1) out int)
+0:23            something: direct index for structure ( temp int)
+0:23              'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:23              Constant:
+0:23                1 (const int)
 0:23        EmitVertex ( temp void)
 0:24      EndPrimitive ( temp void)
 0:16  Function Definition: main( ( temp void)
@@ -68,7 +88,8 @@ output primitive = line_strip
 0:?   Linker Objects
 0:?     'VertexID' (layout( location=0) in 3-element array of uint)
 0:?     'test' (layout( location=1) in 3-element array of uint)
-0:?     'OutputStream' (layout( location=0) out structure{ temp float myfloat,  temp int something})
+0:?     'myfloat' (layout( location=0) out float)
+0:?     'something' (layout( location=1) out int)
 
 
 Linked geometry stage:
@@ -117,14 +138,34 @@ output primitive = line_strip
 0:20            Constant:
 0:20              0 (const int)
 0:22      Sequence
-0:22        move second child to first child ( temp structure{ temp float myfloat,  temp int something})
-0:22          'OutputStream' (layout( location=0) out structure{ temp float myfloat,  temp int something})
-0:22          'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:22        Sequence
+0:22          move second child to first child ( temp float)
+0:?             'myfloat' (layout( location=0) out float)
+0:22            myfloat: direct index for structure ( temp float)
+0:22              'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:22              Constant:
+0:22                0 (const int)
+0:22          move second child to first child ( temp int)
+0:?             'something' (layout( location=1) out int)
+0:22            something: direct index for structure ( temp int)
+0:22              'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:22              Constant:
+0:22                1 (const int)
 0:22        EmitVertex ( temp void)
 0:23      Sequence
-0:23        move second child to first child ( temp structure{ temp float myfloat,  temp int something})
-0:23          'OutputStream' (layout( location=0) out structure{ temp float myfloat,  temp int something})
-0:23          'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:23        Sequence
+0:23          move second child to first child ( temp float)
+0:?             'myfloat' (layout( location=0) out float)
+0:23            myfloat: direct index for structure ( temp float)
+0:23              'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:23              Constant:
+0:23                0 (const int)
+0:23          move second child to first child ( temp int)
+0:?             'something' (layout( location=1) out int)
+0:23            something: direct index for structure ( temp int)
+0:23              'Vert' ( temp structure{ temp float myfloat,  temp int something})
+0:23              Constant:
+0:23                1 (const int)
 0:23        EmitVertex ( temp void)
 0:24      EndPrimitive ( temp void)
 0:16  Function Definition: main( ( temp void)
@@ -143,16 +184,17 @@ output primitive = line_strip
 0:?   Linker Objects
 0:?     'VertexID' (layout( location=0) in 3-element array of uint)
 0:?     'test' (layout( location=1) in 3-element array of uint)
-0:?     'OutputStream' (layout( location=0) out structure{ temp float myfloat,  temp int something})
+0:?     'myfloat' (layout( location=0) out float)
+0:?     'something' (layout( location=1) out int)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 60
+// Id's are bound by 68
 
                               Capability Geometry
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Geometry 4  "main" 42 47 50
+                              EntryPoint Geometry 4  "main" 42 46 55 58
                               ExecutionMode 4 Triangles
                               ExecutionMode 4 Invocations 1
                               ExecutionMode 4 OutputLineStrip
@@ -167,18 +209,20 @@ output primitive = line_strip
                               Name 16  "test"
                               Name 17  "OutputStream"
                               Name 20  "Vert"
-                              Name 42  "OutputStream"
-                              Name 45  "VertexID"
-                              Name 47  "VertexID"
-                              Name 49  "test"
-                              Name 50  "test"
-                              Name 52  "OutputStream"
-                              Name 53  "param"
-                              Name 55  "param"
-                              Name 57  "param"
-                              Decorate 42(OutputStream) Location 0
-                              Decorate 47(VertexID) Location 0
-                              Decorate 50(test) Location 1
+                              Name 42  "myfloat"
+                              Name 46  "something"
+                              Name 53  "VertexID"
+                              Name 55  "VertexID"
+                              Name 57  "test"
+                              Name 58  "test"
+                              Name 60  "OutputStream"
+                              Name 61  "param"
+                              Name 63  "param"
+                              Name 65  "param"
+                              Decorate 42(myfloat) Location 0
+                              Decorate 46(something) Location 1
+                              Decorate 55(VertexID) Location 0
+                              Decorate 58(test) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeInt 32 0
@@ -196,30 +240,32 @@ output primitive = line_strip
               29:     11(int) Constant 2
               34:             TypePointer Function 10(float)
               39:             TypePointer Function 11(int)
-              41:             TypePointer Output 12(PSInput)
-42(OutputStream):     41(ptr) Variable Output
-              46:             TypePointer Input 8
-    47(VertexID):     46(ptr) Variable Input
-        50(test):     46(ptr) Variable Input
+              41:             TypePointer Output 10(float)
+     42(myfloat):     41(ptr) Variable Output
+              45:             TypePointer Output 11(int)
+   46(something):     45(ptr) Variable Output
+              54:             TypePointer Input 8
+    55(VertexID):     54(ptr) Variable Input
+        58(test):     54(ptr) Variable Input
          4(main):           2 Function None 3
                5:             Label
-    45(VertexID):      9(ptr) Variable Function
-        49(test):      9(ptr) Variable Function
-52(OutputStream):     13(ptr) Variable Function
-       53(param):      9(ptr) Variable Function
-       55(param):      9(ptr) Variable Function
-       57(param):     13(ptr) Variable Function
-              48:           8 Load 47(VertexID)
-                              Store 45(VertexID) 48
-              51:           8 Load 50(test)
-                              Store 49(test) 51
-              54:           8 Load 45(VertexID)
-                              Store 53(param) 54
-              56:           8 Load 49(test)
-                              Store 55(param) 56
-              58:           2 FunctionCall 18(@main(u1[3];u1[3];struct-PSInput-f1-i11;) 53(param) 55(param) 57(param)
-              59: 12(PSInput) Load 57(param)
-                              Store 52(OutputStream) 59
+    53(VertexID):      9(ptr) Variable Function
+        57(test):      9(ptr) Variable Function
+60(OutputStream):     13(ptr) Variable Function
+       61(param):      9(ptr) Variable Function
+       63(param):      9(ptr) Variable Function
+       65(param):     13(ptr) Variable Function
+              56:           8 Load 55(VertexID)
+                              Store 53(VertexID) 56
+              59:           8 Load 58(test)
+                              Store 57(test) 59
+              62:           8 Load 53(VertexID)
+                              Store 61(param) 62
+              64:           8 Load 57(test)
+                              Store 63(param) 64
+              66:           2 FunctionCall 18(@main(u1[3];u1[3];struct-PSInput-f1-i11;) 61(param) 63(param) 65(param)
+              67: 12(PSInput) Load 65(param)
+                              Store 60(OutputStream) 67
                               Return
                               FunctionEnd
 18(@main(u1[3];u1[3];struct-PSInput-f1-i11;):           2 Function None 14
@@ -244,11 +290,19 @@ output primitive = line_strip
               38:     11(int) Bitcast 37
               40:     39(ptr) AccessChain 20(Vert) 25
                               Store 40 38
-              43: 12(PSInput) Load 20(Vert)
-                              Store 42(OutputStream) 43
+              43:     34(ptr) AccessChain 20(Vert) 21
+              44:   10(float) Load 43
+                              Store 42(myfloat) 44
+              47:     39(ptr) AccessChain 20(Vert) 25
+              48:     11(int) Load 47
+                              Store 46(something) 48
                               EmitVertex
-              44: 12(PSInput) Load 20(Vert)
-                              Store 42(OutputStream) 44
+              49:     34(ptr) AccessChain 20(Vert) 21
+              50:   10(float) Load 49
+                              Store 42(myfloat) 50
+              51:     39(ptr) AccessChain 20(Vert) 25
+              52:     11(int) Load 51
+                              Store 46(something) 52
                               EmitVertex
                               EndPrimitive
                               Return
diff --git a/Test/baseResults/hlsl.domain.1.tese.out b/Test/baseResults/hlsl.domain.1.tese.out
index 17094459c5388d0cd2ae78c0ed9b159c62618b3a..1bb09275d603fbee16a466e92de091ecda15ceb5 100644
--- a/Test/baseResults/hlsl.domain.1.tese.out
+++ b/Test/baseResults/hlsl.domain.1.tese.out
@@ -105,14 +105,28 @@ triangle order = none
 0:?             'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
 0:22            Constant:
 0:22              0 (const int)
-0:22      move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?         '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:22        Function Call: @main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'i' ( temp 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'tesscoord' ( temp 3-component vector of float)
-0:?           'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor})
+0:22      Sequence
+0:22        move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:22          'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:22          Function Call: @main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'i' ( temp 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'tesscoord' ( temp 3-component vector of float)
+0:?             'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor})
+0:22        move second child to first child ( temp 4-component vector of float)
+0:?           'pos' (layout( location=0) out 4-component vector of float)
+0:22          pos: direct index for structure ( temp 4-component vector of float)
+0:22            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:22            Constant:
+0:22              0 (const int)
+0:22        move second child to first child ( temp 3-component vector of float)
+0:?           'norm' (layout( location=1) out 3-component vector of float)
+0:22          norm: direct index for structure ( temp 3-component vector of float)
+0:22            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:22            Constant:
+0:22              1 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?     'pos' (layout( location=0) out 4-component vector of float)
+0:?     'norm' (layout( location=1) out 3-component vector of float)
 0:?     'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 0:?     'tesscoord' ( patch in 3-component vector of float TessCoord)
 0:?     'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
@@ -228,14 +242,28 @@ triangle order = none
 0:?             'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
 0:22            Constant:
 0:22              0 (const int)
-0:22      move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?         '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:22        Function Call: @main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'i' ( temp 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'tesscoord' ( temp 3-component vector of float)
-0:?           'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor})
+0:22      Sequence
+0:22        move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:22          'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:22          Function Call: @main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'i' ( temp 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'tesscoord' ( temp 3-component vector of float)
+0:?             'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor})
+0:22        move second child to first child ( temp 4-component vector of float)
+0:?           'pos' (layout( location=0) out 4-component vector of float)
+0:22          pos: direct index for structure ( temp 4-component vector of float)
+0:22            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:22            Constant:
+0:22              0 (const int)
+0:22        move second child to first child ( temp 3-component vector of float)
+0:?           'norm' (layout( location=1) out 3-component vector of float)
+0:22          norm: direct index for structure ( temp 3-component vector of float)
+0:22            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:22            Constant:
+0:22              1 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?     'pos' (layout( location=0) out 4-component vector of float)
+0:?     'norm' (layout( location=1) out 3-component vector of float)
 0:?     'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 0:?     'tesscoord' ( patch in 3-component vector of float TessCoord)
 0:?     'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
@@ -243,12 +271,12 @@ triangle order = none
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 88
+// Id's are bound by 95
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationEvaluation 4  "main" 51 55 61 76 81
+                              EntryPoint TessellationEvaluation 4  "main" 51 55 61 76 88 92
                               ExecutionMode 4 Triangles
                               Source HLSL 500
                               Name 4  "main"
@@ -273,9 +301,11 @@ triangle order = none
                               Name 57  "pcf_data"
                               Name 61  "pcf_data_flTessFactor"
                               Name 76  "pcf_data_flInsideTessFactor"
-                              Name 81  "@entryPointOutput"
-                              Name 83  "param"
-                              Name 85  "param"
+                              Name 80  "flattenTemp"
+                              Name 82  "param"
+                              Name 84  "param"
+                              Name 88  "pos"
+                              Name 92  "norm"
                               Decorate 51(i) Location 0
                               Decorate 55(tesscoord) Patch
                               Decorate 55(tesscoord) BuiltIn TessCoord
@@ -283,7 +313,8 @@ triangle order = none
                               Decorate 61(pcf_data_flTessFactor) BuiltIn TessLevelOuter
                               Decorate 76(pcf_data_flInsideTessFactor) Patch
                               Decorate 76(pcf_data_flInsideTessFactor) BuiltIn TessLevelInner
-                              Decorate 81(@entryPointOutput) Location 0
+                              Decorate 88(pos) Location 0
+                              Decorate 92(norm) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -322,15 +353,18 @@ triangle order = none
               74:             TypeArray 6(float) 73
               75:             TypePointer Input 74
 76(pcf_data_flInsideTessFactor):     75(ptr) Variable Input
-              80:             TypePointer Output 17(gs_in_t)
-81(@entryPointOutput):     80(ptr) Variable Output
+              87:             TypePointer Output 7(fvec4)
+         88(pos):     87(ptr) Variable Output
+              91:             TypePointer Output 8(fvec3)
+        92(norm):     91(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
            49(i):     48(ptr) Variable Function
    53(tesscoord):     13(ptr) Variable Function
     57(pcf_data):     16(ptr) Variable Function
-       83(param):     13(ptr) Variable Function
-       85(param):     16(ptr) Variable Function
+ 80(flattenTemp):     24(ptr) Variable Function
+       82(param):     13(ptr) Variable Function
+       84(param):     16(ptr) Variable Function
               52:          12 Load 51(i)
                               Store 49(i) 52
               56:    8(fvec3) Load 55(tesscoord)
@@ -351,13 +385,19 @@ triangle order = none
               78:    6(float) Load 77
               79:     30(ptr) AccessChain 57(pcf_data) 37
                               Store 79 78
-              82:          12 Load 49(i)
-              84:    8(fvec3) Load 53(tesscoord)
-                              Store 83(param) 84
-              86:15(pcf_in_t) Load 57(pcf_data)
-                              Store 85(param) 86
-              87: 17(gs_in_t) FunctionCall 22(@main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11;) 82 83(param) 85(param)
-                              Store 81(@entryPointOutput) 87
+              81:          12 Load 49(i)
+              83:    8(fvec3) Load 53(tesscoord)
+                              Store 82(param) 83
+              85:15(pcf_in_t) Load 57(pcf_data)
+                              Store 84(param) 85
+              86: 17(gs_in_t) FunctionCall 22(@main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11;) 81 82(param) 84(param)
+                              Store 80(flattenTemp) 86
+              89:     35(ptr) AccessChain 80(flattenTemp) 27
+              90:    7(fvec4) Load 89
+                              Store 88(pos) 90
+              93:     13(ptr) AccessChain 80(flattenTemp) 37
+              94:    8(fvec3) Load 93
+                              Store 92(norm) 94
                               Return
                               FunctionEnd
 22(@main(struct-ds_in_t-vf4-vf31[3];vf3;struct-pcf_in_t-f1[3]-f11;): 17(gs_in_t) Function None 18
diff --git a/Test/baseResults/hlsl.domain.2.tese.out b/Test/baseResults/hlsl.domain.2.tese.out
index 2336dfaa5862a3088e50905561484748f4a2173a..77683ed52a985babc5d9a9c12972432ebf5a5e75 100644
--- a/Test/baseResults/hlsl.domain.2.tese.out
+++ b/Test/baseResults/hlsl.domain.2.tese.out
@@ -114,14 +114,28 @@ triangle order = none
 0:25      move second child to first child ( temp 3-component vector of float)
 0:?         'tesscoord' ( temp 3-component vector of float)
 0:?         'tesscoord' ( patch in 3-component vector of float TessCoord)
-0:25      move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?         '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:25        Function Call: @main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor,  temp float foo})
-0:?           'i' ( temp 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'tesscoord' ( temp 3-component vector of float)
+0:25      Sequence
+0:25        move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:25          'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:25          Function Call: @main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor,  temp float foo})
+0:?             'i' ( temp 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'tesscoord' ( temp 3-component vector of float)
+0:25        move second child to first child ( temp 4-component vector of float)
+0:?           'pos' (layout( location=0) out 4-component vector of float)
+0:25          pos: direct index for structure ( temp 4-component vector of float)
+0:25            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:25            Constant:
+0:25              0 (const int)
+0:25        move second child to first child ( temp 3-component vector of float)
+0:?           'norm' (layout( location=1) out 3-component vector of float)
+0:25          norm: direct index for structure ( temp 3-component vector of float)
+0:25            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:25            Constant:
+0:25              1 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?     'pos' (layout( location=0) out 4-component vector of float)
+0:?     'norm' (layout( location=1) out 3-component vector of float)
 0:?     'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 0:?     'tesscoord' ( patch in 3-component vector of float TessCoord)
 0:?     'pcf_data' (layout( location=2) patch in structure{ temp float foo})
@@ -247,14 +261,28 @@ triangle order = none
 0:25      move second child to first child ( temp 3-component vector of float)
 0:?         'tesscoord' ( temp 3-component vector of float)
 0:?         'tesscoord' ( patch in 3-component vector of float TessCoord)
-0:25      move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?         '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:25        Function Call: @main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor,  temp float foo})
-0:?           'i' ( temp 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'tesscoord' ( temp 3-component vector of float)
+0:25      Sequence
+0:25        move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:25          'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:25          Function Call: @main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor,  temp float foo})
+0:?             'i' ( temp 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'tesscoord' ( temp 3-component vector of float)
+0:25        move second child to first child ( temp 4-component vector of float)
+0:?           'pos' (layout( location=0) out 4-component vector of float)
+0:25          pos: direct index for structure ( temp 4-component vector of float)
+0:25            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:25            Constant:
+0:25              0 (const int)
+0:25        move second child to first child ( temp 3-component vector of float)
+0:?           'norm' (layout( location=1) out 3-component vector of float)
+0:25          norm: direct index for structure ( temp 3-component vector of float)
+0:25            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:25            Constant:
+0:25              1 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?     'pos' (layout( location=0) out 4-component vector of float)
+0:?     'norm' (layout( location=1) out 3-component vector of float)
 0:?     'i' (layout( location=0) in 3-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 0:?     'tesscoord' ( patch in 3-component vector of float TessCoord)
 0:?     'pcf_data' (layout( location=2) patch in structure{ temp float foo})
@@ -263,12 +291,12 @@ triangle order = none
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 94
+// Id's are bound by 101
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationEvaluation 4  "main" 52 67 73 80 84 87
+                              EntryPoint TessellationEvaluation 4  "main" 52 67 73 80 84 94 98
                               ExecutionMode 4 Triangles
                               Source HLSL 500
                               Name 4  "main"
@@ -297,9 +325,11 @@ triangle order = none
                               Name 80  "i"
                               Name 82  "tesscoord"
                               Name 84  "tesscoord"
-                              Name 87  "@entryPointOutput"
-                              Name 89  "param"
-                              Name 91  "param"
+                              Name 86  "flattenTemp"
+                              Name 88  "param"
+                              Name 90  "param"
+                              Name 94  "pos"
+                              Name 98  "norm"
                               Decorate 52(pcf_data_flTessFactor) Patch
                               Decorate 52(pcf_data_flTessFactor) BuiltIn TessLevelOuter
                               Decorate 67(pcf_data_flInsideTessFactor) Patch
@@ -310,7 +340,8 @@ triangle order = none
                               Decorate 80(i) Location 0
                               Decorate 84(tesscoord) Patch
                               Decorate 84(tesscoord) BuiltIn TessCoord
-                              Decorate 87(@entryPointOutput) Location 0
+                              Decorate 94(pos) Location 0
+                              Decorate 98(norm) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -352,15 +383,18 @@ triangle order = none
            80(i):     79(ptr) Variable Input
               83:             TypePointer Input 13(fvec3)
    84(tesscoord):     83(ptr) Variable Input
-              86:             TypePointer Output 17(gs_in_t)
-87(@entryPointOutput):     86(ptr) Variable Output
+              93:             TypePointer Output 12(fvec4)
+         94(pos):     93(ptr) Variable Output
+              97:             TypePointer Output 13(fvec3)
+        98(norm):     97(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
     48(pcf_data):     11(ptr) Variable Function
            78(i):     77(ptr) Variable Function
    82(tesscoord):     16(ptr) Variable Function
-       89(param):     11(ptr) Variable Function
-       91(param):     16(ptr) Variable Function
+ 86(flattenTemp):     24(ptr) Variable Function
+       88(param):     11(ptr) Variable Function
+       90(param):     16(ptr) Variable Function
               54:     53(ptr) AccessChain 52(pcf_data_flTessFactor) 27
               55:    6(float) Load 54
               56:     30(ptr) AccessChain 48(pcf_data) 27 27
@@ -385,13 +419,19 @@ triangle order = none
                               Store 78(i) 81
               85:   13(fvec3) Load 84(tesscoord)
                               Store 82(tesscoord) 85
-              88:          15 Load 78(i)
-              90:10(pcf_in_t) Load 48(pcf_data)
-                              Store 89(param) 90
-              92:   13(fvec3) Load 82(tesscoord)
-                              Store 91(param) 92
-              93: 17(gs_in_t) FunctionCall 22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;) 89(param) 88 91(param)
-                              Store 87(@entryPointOutput) 93
+              87:          15 Load 78(i)
+              89:10(pcf_in_t) Load 48(pcf_data)
+                              Store 88(param) 89
+              91:   13(fvec3) Load 82(tesscoord)
+                              Store 90(param) 91
+              92: 17(gs_in_t) FunctionCall 22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;) 88(param) 87 90(param)
+                              Store 86(flattenTemp) 92
+              95:     35(ptr) AccessChain 86(flattenTemp) 27
+              96:   12(fvec4) Load 95
+                              Store 94(pos) 96
+              99:     16(ptr) AccessChain 86(flattenTemp) 37
+             100:   13(fvec3) Load 99
+                              Store 98(norm) 100
                               Return
                               FunctionEnd
 22(@main(struct-pcf_in_t-f1[3]-f1-f11;struct-ds_in_t-vf4-vf31[3];vf3;): 17(gs_in_t) Function None 18
diff --git a/Test/baseResults/hlsl.domain.3.tese.out b/Test/baseResults/hlsl.domain.3.tese.out
index 07282aaeaa4b2ca27cf92d31e0a6d425aa3e6e43..e012457980653e5a3e851b8236b5b5a96ff6b166 100644
--- a/Test/baseResults/hlsl.domain.3.tese.out
+++ b/Test/baseResults/hlsl.domain.3.tese.out
@@ -102,14 +102,28 @@ triangle order = none
 0:?             'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
 0:24            Constant:
 0:24              0 (const int)
-0:24      move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?         '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:24        Function Call: @main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'i' ( temp 2-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'tesscoord' ( temp 2-component vector of float)
-0:?           'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor})
+0:24      Sequence
+0:24        move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:24          'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:24          Function Call: @main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'i' ( temp 2-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'tesscoord' ( temp 2-component vector of float)
+0:?             'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor})
+0:24        move second child to first child ( temp 4-component vector of float)
+0:?           'pos' (layout( location=0) out 4-component vector of float)
+0:24          pos: direct index for structure ( temp 4-component vector of float)
+0:24            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:24            Constant:
+0:24              0 (const int)
+0:24        move second child to first child ( temp 3-component vector of float)
+0:?           'norm' (layout( location=1) out 3-component vector of float)
+0:24          norm: direct index for structure ( temp 3-component vector of float)
+0:24            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:24            Constant:
+0:24              1 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?     'pos' (layout( location=0) out 4-component vector of float)
+0:?     'norm' (layout( location=1) out 3-component vector of float)
 0:?     'i' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 0:?     'tesscoord' ( patch in 3-component vector of float TessCoord)
 0:?     'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
@@ -222,14 +236,28 @@ triangle order = none
 0:?             'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
 0:24            Constant:
 0:24              0 (const int)
-0:24      move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?         '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:24        Function Call: @main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'i' ( temp 2-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
-0:?           'tesscoord' ( temp 2-component vector of float)
-0:?           'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor})
+0:24      Sequence
+0:24        move second child to first child ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:24          'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:24          Function Call: @main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11; ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'i' ( temp 2-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?             'tesscoord' ( temp 2-component vector of float)
+0:?             'pcf_data' ( temp structure{ temp 3-element array of float flTessFactor,  temp float flInsideTessFactor})
+0:24        move second child to first child ( temp 4-component vector of float)
+0:?           'pos' (layout( location=0) out 4-component vector of float)
+0:24          pos: direct index for structure ( temp 4-component vector of float)
+0:24            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:24            Constant:
+0:24              0 (const int)
+0:24        move second child to first child ( temp 3-component vector of float)
+0:?           'norm' (layout( location=1) out 3-component vector of float)
+0:24          norm: direct index for structure ( temp 3-component vector of float)
+0:24            'flattenTemp' ( temp structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:24            Constant:
+0:24              1 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
+0:?     'pos' (layout( location=0) out 4-component vector of float)
+0:?     'norm' (layout( location=1) out 3-component vector of float)
 0:?     'i' (layout( location=0) in 2-element array of structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 0:?     'tesscoord' ( patch in 3-component vector of float TessCoord)
 0:?     'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
@@ -237,12 +265,12 @@ triangle order = none
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 93
+// Id's are bound by 100
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationEvaluation 4  "main" 54 58 67 81 86
+                              EntryPoint TessellationEvaluation 4  "main" 54 58 67 81 93 97
                               ExecutionMode 4 Isolines
                               Source HLSL 500
                               Name 4  "main"
@@ -267,9 +295,11 @@ triangle order = none
                               Name 63  "pcf_data"
                               Name 67  "pcf_data_flTessFactor"
                               Name 81  "pcf_data_flInsideTessFactor"
-                              Name 86  "@entryPointOutput"
-                              Name 88  "param"
-                              Name 90  "param"
+                              Name 85  "flattenTemp"
+                              Name 87  "param"
+                              Name 89  "param"
+                              Name 93  "pos"
+                              Name 97  "norm"
                               Decorate 54(i) Location 0
                               Decorate 58(tesscoord) Patch
                               Decorate 58(tesscoord) BuiltIn TessCoord
@@ -277,7 +307,8 @@ triangle order = none
                               Decorate 67(pcf_data_flTessFactor) BuiltIn TessLevelOuter
                               Decorate 81(pcf_data_flInsideTessFactor) Patch
                               Decorate 81(pcf_data_flInsideTessFactor) BuiltIn TessLevelInner
-                              Decorate 86(@entryPointOutput) Location 0
+                              Decorate 93(pos) Location 0
+                              Decorate 97(norm) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -318,15 +349,18 @@ triangle order = none
               79:             TypeArray 6(float) 11
               80:             TypePointer Input 79
 81(pcf_data_flInsideTessFactor):     80(ptr) Variable Input
-              85:             TypePointer Output 19(gs_in_t)
-86(@entryPointOutput):     85(ptr) Variable Output
+              92:             TypePointer Output 7(fvec4)
+         93(pos):     92(ptr) Variable Output
+              96:             TypePointer Output 8(fvec3)
+        97(norm):     96(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
            52(i):     51(ptr) Variable Function
    56(tesscoord):     14(ptr) Variable Function
     63(pcf_data):     18(ptr) Variable Function
-       88(param):     14(ptr) Variable Function
-       90(param):     18(ptr) Variable Function
+ 85(flattenTemp):     26(ptr) Variable Function
+       87(param):     14(ptr) Variable Function
+       89(param):     18(ptr) Variable Function
               55:          12 Load 54(i)
                               Store 52(i) 55
               59:    8(fvec3) Load 58(tesscoord)
@@ -350,13 +384,19 @@ triangle order = none
               83:    6(float) Load 82
               84:     32(ptr) AccessChain 63(pcf_data) 39
                               Store 84 83
-              87:          12 Load 52(i)
-              89:   13(fvec2) Load 56(tesscoord)
-                              Store 88(param) 89
-              91:17(pcf_in_t) Load 63(pcf_data)
-                              Store 90(param) 91
-              92: 19(gs_in_t) FunctionCall 24(@main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11;) 87 88(param) 90(param)
-                              Store 86(@entryPointOutput) 92
+              86:          12 Load 52(i)
+              88:   13(fvec2) Load 56(tesscoord)
+                              Store 87(param) 88
+              90:17(pcf_in_t) Load 63(pcf_data)
+                              Store 89(param) 90
+              91: 19(gs_in_t) FunctionCall 24(@main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11;) 86 87(param) 89(param)
+                              Store 85(flattenTemp) 91
+              94:     37(ptr) AccessChain 85(flattenTemp) 29
+              95:    7(fvec4) Load 94
+                              Store 93(pos) 95
+              98:     46(ptr) AccessChain 85(flattenTemp) 39
+              99:    8(fvec3) Load 98
+                              Store 97(norm) 99
                               Return
                               FunctionEnd
 24(@main(struct-ds_in_t-vf4-vf31[2];vf2;struct-pcf_in_t-f1[3]-f11;): 19(gs_in_t) Function None 20
diff --git a/Test/baseResults/hlsl.emptystructreturn.frag.out b/Test/baseResults/hlsl.emptystructreturn.frag.out
index bdcdb1f4c92ccba831ed8b7fb4259df00cfa6cc7..5440045db53bc40199f77878ab0f7e45c3f67a4d 100644
--- a/Test/baseResults/hlsl.emptystructreturn.frag.out
+++ b/Test/baseResults/hlsl.emptystructreturn.frag.out
@@ -11,9 +11,10 @@ gl_FragCoord origin is upper left
 0:10  Function Definition: main( ( temp void)
 0:10    Function Parameters: 
 0:?     Sequence
-0:10      move second child to first child ( temp structure{})
-0:?         'i' ( temp structure{})
-0:?         'i' ( in structure{})
+0:10      Sequence
+0:10        move second child to first child ( temp structure{})
+0:?           'i' ( temp structure{})
+0:?           'i' ( in structure{})
 0:10      Sequence
 0:10        move second child to first child ( temp structure{})
 0:?           '@entryPointOutput' ( out structure{})
@@ -37,9 +38,10 @@ gl_FragCoord origin is upper left
 0:10  Function Definition: main( ( temp void)
 0:10    Function Parameters: 
 0:?     Sequence
-0:10      move second child to first child ( temp structure{})
-0:?         'i' ( temp structure{})
-0:?         'i' ( in structure{})
+0:10      Sequence
+0:10        move second child to first child ( temp structure{})
+0:?           'i' ( temp structure{})
+0:?           'i' ( in structure{})
 0:10      Sequence
 0:10        move second child to first child ( temp structure{})
 0:?           '@entryPointOutput' ( out structure{})
diff --git a/Test/baseResults/hlsl.emptystructreturn.vert.out b/Test/baseResults/hlsl.emptystructreturn.vert.out
index b1ea61eb014d16155a6d001be1885c32c9a72bf9..c8cea5d1f2d019bfb652d52bb73a662769a6b9ee 100644
--- a/Test/baseResults/hlsl.emptystructreturn.vert.out
+++ b/Test/baseResults/hlsl.emptystructreturn.vert.out
@@ -14,10 +14,11 @@ Shader version: 500
 0:10        move second child to first child ( temp structure{})
 0:?           'i' ( temp structure{})
 0:?           'i' ( in structure{})
-0:10      move second child to first child ( temp structure{})
-0:?         '@entryPointOutput' ( out structure{})
-0:10        Function Call: @main(struct-vs_in1; ( temp structure{})
-0:?           'i' ( temp structure{})
+0:10      Sequence
+0:10        move second child to first child ( temp structure{})
+0:?           '@entryPointOutput' ( out structure{})
+0:10          Function Call: @main(struct-vs_in1; ( temp structure{})
+0:?             'i' ( temp structure{})
 0:?   Linker Objects
 
 
@@ -39,10 +40,11 @@ Shader version: 500
 0:10        move second child to first child ( temp structure{})
 0:?           'i' ( temp structure{})
 0:?           'i' ( in structure{})
-0:10      move second child to first child ( temp structure{})
-0:?         '@entryPointOutput' ( out structure{})
-0:10        Function Call: @main(struct-vs_in1; ( temp structure{})
-0:?           'i' ( temp structure{})
+0:10      Sequence
+0:10        move second child to first child ( temp structure{})
+0:?           '@entryPointOutput' ( out structure{})
+0:10          Function Call: @main(struct-vs_in1; ( temp structure{})
+0:?             'i' ( temp structure{})
 0:?   Linker Objects
 
 // Module Version 10000
diff --git a/Test/baseResults/hlsl.structIoFourWay.frag.out b/Test/baseResults/hlsl.structIoFourWay.frag.out
index cb26bb0016ab949bfbb0d841ed6086900c420bda..d88bb0921fc06a79131e8cf15dd0d90448526ac0 100755
--- a/Test/baseResults/hlsl.structIoFourWay.frag.out
+++ b/Test/baseResults/hlsl.structIoFourWay.frag.out
@@ -12,9 +12,31 @@ using depth_greater
 0:15  Function Definition: main( ( temp void)
 0:15    Function Parameters: 
 0:?     Sequence
-0:15      move second child to first child ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
-0:?         't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
-0:?         't' (layout( location=0) in structure{ temp float f,  centroid temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15      Sequence
+0:15        move second child to first child ( temp float)
+0:15          f: direct index for structure ( temp float)
+0:?             't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15            Constant:
+0:15              0 (const int)
+0:?           'f' (layout( location=0) in float)
+0:15        move second child to first child ( temp float)
+0:15          g: direct index for structure ( temp float)
+0:?             't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15            Constant:
+0:15              1 (const int)
+0:?           'g' (layout( location=1) centroid in float)
+0:15        move second child to first child ( temp float)
+0:15          d: direct index for structure ( temp float)
+0:?             't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15            Constant:
+0:15              2 (const int)
+0:?           'd' (layout( location=2) in float)
+0:15        move second child to first child ( temp 4-component vector of float)
+0:15          normal: direct index for structure ( temp 4-component vector of float)
+0:?             't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15            Constant:
+0:15              3 (const int)
+0:?           'normal' (layout( location=3) in 4-component vector of float)
 0:15      Sequence
 0:15        move second child to first child ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
 0:15          'flattenTemp' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
@@ -51,7 +73,10 @@ using depth_greater
 0:?     'g' (layout( location=1) out float)
 0:?     'd' ( out float FragDepth)
 0:?     'normal' (layout( location=2) out 4-component vector of float)
-0:?     't' (layout( location=0) in structure{ temp float f,  centroid temp float g,  temp float d,  temp 4-component vector of float normal})
+0:?     'f' (layout( location=0) in float)
+0:?     'g' (layout( location=1) centroid in float)
+0:?     'd' (layout( location=2) in float)
+0:?     'normal' (layout( location=3) in 4-component vector of float)
 
 
 Linked fragment stage:
@@ -70,9 +95,31 @@ using depth_greater
 0:15  Function Definition: main( ( temp void)
 0:15    Function Parameters: 
 0:?     Sequence
-0:15      move second child to first child ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
-0:?         't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
-0:?         't' (layout( location=0) in structure{ temp float f,  centroid temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15      Sequence
+0:15        move second child to first child ( temp float)
+0:15          f: direct index for structure ( temp float)
+0:?             't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15            Constant:
+0:15              0 (const int)
+0:?           'f' (layout( location=0) in float)
+0:15        move second child to first child ( temp float)
+0:15          g: direct index for structure ( temp float)
+0:?             't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15            Constant:
+0:15              1 (const int)
+0:?           'g' (layout( location=1) centroid in float)
+0:15        move second child to first child ( temp float)
+0:15          d: direct index for structure ( temp float)
+0:?             't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15            Constant:
+0:15              2 (const int)
+0:?           'd' (layout( location=2) in float)
+0:15        move second child to first child ( temp 4-component vector of float)
+0:15          normal: direct index for structure ( temp 4-component vector of float)
+0:?             't' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
+0:15            Constant:
+0:15              3 (const int)
+0:?           'normal' (layout( location=3) in 4-component vector of float)
 0:15      Sequence
 0:15        move second child to first child ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
 0:15          'flattenTemp' ( temp structure{ temp float f,  temp float g,  temp float d,  temp 4-component vector of float normal})
@@ -109,16 +156,19 @@ using depth_greater
 0:?     'g' (layout( location=1) out float)
 0:?     'd' ( out float FragDepth)
 0:?     'normal' (layout( location=2) out 4-component vector of float)
-0:?     't' (layout( location=0) in structure{ temp float f,  centroid temp float g,  temp float d,  temp 4-component vector of float normal})
+0:?     'f' (layout( location=0) in float)
+0:?     'g' (layout( location=1) centroid in float)
+0:?     'd' (layout( location=2) in float)
+0:?     'normal' (layout( location=3) in 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 64
+// Id's are bound by 66
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 21 43 46 49 53
+                              EntryPoint Fragment 4  "main" 22 27 31 36 45 48 51 55
                               ExecutionMode 4 OriginUpperLeft
                               ExecutionMode 4 DepthGreater
                               Source HLSL 500
@@ -132,54 +182,55 @@ using depth_greater
                               Name 11  "t"
                               Name 14  "local"
                               Name 18  "t"
-                              Name 19  "T"
-                              MemberName 19(T) 0  "f"
-                              MemberName 19(T) 1  "g"
-                              MemberName 19(T) 2  "d"
-                              MemberName 19(T) 3  "normal"
-                              Name 21  "t"
-                              Name 38  "flattenTemp"
-                              Name 39  "param"
-                              Name 43  "f"
-                              Name 46  "g"
-                              Name 49  "d"
-                              Name 53  "normal"
-                              Name 56  "T"
-                              MemberName 56(T) 0  "f"
-                              MemberName 56(T) 1  "g"
-                              MemberName 56(T) 2  "d"
-                              MemberName 56(T) 3  "normal"
-                              Name 57  "$Global"
-                              MemberName 57($Global) 0  "s"
-                              Name 59  ""
-                              Name 60  "T"
-                              MemberName 60(T) 0  "f"
-                              MemberName 60(T) 1  "g"
-                              MemberName 60(T) 2  "d"
-                              MemberName 60(T) 3  "normal"
-                              Name 61  "buff"
-                              MemberName 61(buff) 0  "t"
-                              Name 63  ""
-                              MemberDecorate 19(T) 1 Centroid
-                              Decorate 21(t) Location 0
-                              Decorate 43(f) Location 0
-                              Decorate 46(g) Location 1
-                              Decorate 49(d) BuiltIn FragDepth
-                              Decorate 53(normal) Location 2
-                              MemberDecorate 56(T) 0 Offset 68
-                              MemberDecorate 56(T) 1 Offset 72
-                              MemberDecorate 56(T) 2 Offset 76
-                              MemberDecorate 56(T) 3 Offset 80
-                              MemberDecorate 57($Global) 0 Offset 0
-                              Decorate 57($Global) Block
-                              Decorate 59 DescriptorSet 0
-                              MemberDecorate 60(T) 0 Offset 0
-                              MemberDecorate 60(T) 1 Offset 4
-                              MemberDecorate 60(T) 2 Offset 8
-                              MemberDecorate 60(T) 3 Offset 16
-                              MemberDecorate 61(buff) 0 Offset 96
-                              Decorate 61(buff) Block
-                              Decorate 63 DescriptorSet 0
+                              Name 22  "f"
+                              Name 27  "g"
+                              Name 31  "d"
+                              Name 36  "normal"
+                              Name 40  "flattenTemp"
+                              Name 41  "param"
+                              Name 45  "f"
+                              Name 48  "g"
+                              Name 51  "d"
+                              Name 55  "normal"
+                              Name 58  "T"
+                              MemberName 58(T) 0  "f"
+                              MemberName 58(T) 1  "g"
+                              MemberName 58(T) 2  "d"
+                              MemberName 58(T) 3  "normal"
+                              Name 59  "$Global"
+                              MemberName 59($Global) 0  "s"
+                              Name 61  ""
+                              Name 62  "T"
+                              MemberName 62(T) 0  "f"
+                              MemberName 62(T) 1  "g"
+                              MemberName 62(T) 2  "d"
+                              MemberName 62(T) 3  "normal"
+                              Name 63  "buff"
+                              MemberName 63(buff) 0  "t"
+                              Name 65  ""
+                              Decorate 22(f) Location 0
+                              Decorate 27(g) Centroid
+                              Decorate 27(g) Location 1
+                              Decorate 31(d) Location 2
+                              Decorate 36(normal) Location 3
+                              Decorate 45(f) Location 0
+                              Decorate 48(g) Location 1
+                              Decorate 51(d) BuiltIn FragDepth
+                              Decorate 55(normal) Location 2
+                              MemberDecorate 58(T) 0 Offset 68
+                              MemberDecorate 58(T) 1 Offset 72
+                              MemberDecorate 58(T) 2 Offset 76
+                              MemberDecorate 58(T) 3 Offset 80
+                              MemberDecorate 59($Global) 0 Offset 0
+                              Decorate 59($Global) Block
+                              Decorate 61 DescriptorSet 0
+                              MemberDecorate 62(T) 0 Offset 0
+                              MemberDecorate 62(T) 1 Offset 4
+                              MemberDecorate 62(T) 2 Offset 8
+                              MemberDecorate 62(T) 3 Offset 16
+                              MemberDecorate 63(buff) 0 Offset 96
+                              Decorate 63(buff) Block
+                              Decorate 65 DescriptorSet 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -187,64 +238,66 @@ using depth_greater
             8(T):             TypeStruct 6(float) 6(float) 6(float) 7(fvec4)
                9:             TypePointer Function 8(T)
               10:             TypeFunction 8(T) 9(ptr)
-           19(T):             TypeStruct 6(float) 6(float) 6(float) 7(fvec4)
-              20:             TypePointer Input 19(T)
-           21(t):     20(ptr) Variable Input
-              24:             TypeInt 32 1
-              25:     24(int) Constant 0
-              26:             TypePointer Function 6(float)
-              29:     24(int) Constant 1
-              32:     24(int) Constant 2
-              35:     24(int) Constant 3
-              36:             TypePointer Function 7(fvec4)
-              42:             TypePointer Output 6(float)
-           43(f):     42(ptr) Variable Output
-           46(g):     42(ptr) Variable Output
-           49(d):     42(ptr) Variable Output
-              52:             TypePointer Output 7(fvec4)
-      53(normal):     52(ptr) Variable Output
-           56(T):             TypeStruct 6(float) 6(float) 6(float) 7(fvec4)
-     57($Global):             TypeStruct 56(T)
-              58:             TypePointer Uniform 57($Global)
-              59:     58(ptr) Variable Uniform
-           60(T):             TypeStruct 6(float) 6(float) 6(float) 7(fvec4)
-        61(buff):             TypeStruct 60(T)
-              62:             TypePointer Uniform 61(buff)
-              63:     62(ptr) Variable Uniform
+              19:             TypeInt 32 1
+              20:     19(int) Constant 0
+              21:             TypePointer Input 6(float)
+           22(f):     21(ptr) Variable Input
+              24:             TypePointer Function 6(float)
+              26:     19(int) Constant 1
+           27(g):     21(ptr) Variable Input
+              30:     19(int) Constant 2
+           31(d):     21(ptr) Variable Input
+              34:     19(int) Constant 3
+              35:             TypePointer Input 7(fvec4)
+      36(normal):     35(ptr) Variable Input
+              38:             TypePointer Function 7(fvec4)
+              44:             TypePointer Output 6(float)
+           45(f):     44(ptr) Variable Output
+           48(g):     44(ptr) Variable Output
+           51(d):     44(ptr) Variable Output
+              54:             TypePointer Output 7(fvec4)
+      55(normal):     54(ptr) Variable Output
+           58(T):             TypeStruct 6(float) 6(float) 6(float) 7(fvec4)
+     59($Global):             TypeStruct 58(T)
+              60:             TypePointer Uniform 59($Global)
+              61:     60(ptr) Variable Uniform
+           62(T):             TypeStruct 6(float) 6(float) 6(float) 7(fvec4)
+        63(buff):             TypeStruct 62(T)
+              64:             TypePointer Uniform 63(buff)
+              65:     64(ptr) Variable Uniform
          4(main):           2 Function None 3
                5:             Label
            18(t):      9(ptr) Variable Function
- 38(flattenTemp):      9(ptr) Variable Function
-       39(param):      9(ptr) Variable Function
-              22:       19(T) Load 21(t)
-              23:    6(float) CompositeExtract 22 0
-              27:     26(ptr) AccessChain 18(t) 25
-                              Store 27 23
-              28:    6(float) CompositeExtract 22 1
-              30:     26(ptr) AccessChain 18(t) 29
-                              Store 30 28
-              31:    6(float) CompositeExtract 22 2
-              33:     26(ptr) AccessChain 18(t) 32
-                              Store 33 31
-              34:    7(fvec4) CompositeExtract 22 3
-              37:     36(ptr) AccessChain 18(t) 35
-                              Store 37 34
-              40:        8(T) Load 18(t)
-                              Store 39(param) 40
-              41:        8(T) FunctionCall 12(@main(struct-T-f1-f1-f1-vf41;) 39(param)
-                              Store 38(flattenTemp) 41
-              44:     26(ptr) AccessChain 38(flattenTemp) 25
-              45:    6(float) Load 44
-                              Store 43(f) 45
-              47:     26(ptr) AccessChain 38(flattenTemp) 29
-              48:    6(float) Load 47
-                              Store 46(g) 48
-              50:     26(ptr) AccessChain 38(flattenTemp) 32
-              51:    6(float) Load 50
-                              Store 49(d) 51
-              54:     36(ptr) AccessChain 38(flattenTemp) 35
-              55:    7(fvec4) Load 54
-                              Store 53(normal) 55
+ 40(flattenTemp):      9(ptr) Variable Function
+       41(param):      9(ptr) Variable Function
+              23:    6(float) Load 22(f)
+              25:     24(ptr) AccessChain 18(t) 20
+                              Store 25 23
+              28:    6(float) Load 27(g)
+              29:     24(ptr) AccessChain 18(t) 26
+                              Store 29 28
+              32:    6(float) Load 31(d)
+              33:     24(ptr) AccessChain 18(t) 30
+                              Store 33 32
+              37:    7(fvec4) Load 36(normal)
+              39:     38(ptr) AccessChain 18(t) 34
+                              Store 39 37
+              42:        8(T) Load 18(t)
+                              Store 41(param) 42
+              43:        8(T) FunctionCall 12(@main(struct-T-f1-f1-f1-vf41;) 41(param)
+                              Store 40(flattenTemp) 43
+              46:     24(ptr) AccessChain 40(flattenTemp) 20
+              47:    6(float) Load 46
+                              Store 45(f) 47
+              49:     24(ptr) AccessChain 40(flattenTemp) 26
+              50:    6(float) Load 49
+                              Store 48(g) 50
+              52:     24(ptr) AccessChain 40(flattenTemp) 30
+              53:    6(float) Load 52
+                              Store 51(d) 53
+              56:     38(ptr) AccessChain 40(flattenTemp) 34
+              57:    7(fvec4) Load 56
+                              Store 55(normal) 57
                               Return
                               FunctionEnd
 12(@main(struct-T-f1-f1-f1-vf41;):        8(T) Function None 10
diff --git a/Test/baseResults/hlsl.synthesizeInput.frag.out b/Test/baseResults/hlsl.synthesizeInput.frag.out
index aa77e25a2a53ac913765a85fdb057b5d127dd944..d83db2eacc17ffeaaaf1d1f76cddd4bc7838bcb9 100755
--- a/Test/baseResults/hlsl.synthesizeInput.frag.out
+++ b/Test/baseResults/hlsl.synthesizeInput.frag.out
@@ -24,16 +24,27 @@ gl_FragCoord origin is upper left
 0:7  Function Definition: main( ( temp void)
 0:7    Function Parameters: 
 0:?     Sequence
-0:7      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:7      Sequence
+0:7        move second child to first child ( temp float)
+0:7          interp: direct index for structure ( temp float)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:7            Constant:
+0:7              0 (const int)
+0:?           'interp' (layout( location=0) in float)
+0:7        move second child to first child ( temp uint)
+0:7          no_interp: direct index for structure ( temp uint)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:7            Constant:
+0:7              1 (const int)
+0:?           'no_interp' (layout( location=1) flat in uint)
 0:7      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:7        Function Call: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float)
 0:?           'input' ( temp structure{ temp float interp,  temp uint no_interp})
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'interp' (layout( location=0) in float)
+0:?     'no_interp' (layout( location=1) flat in uint)
 
 
 Linked fragment stage:
@@ -64,16 +75,27 @@ gl_FragCoord origin is upper left
 0:7  Function Definition: main( ( temp void)
 0:7    Function Parameters: 
 0:?     Sequence
-0:7      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:7      Sequence
+0:7        move second child to first child ( temp float)
+0:7          interp: direct index for structure ( temp float)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:7            Constant:
+0:7              0 (const int)
+0:?           'interp' (layout( location=0) in float)
+0:7        move second child to first child ( temp uint)
+0:7          no_interp: direct index for structure ( temp uint)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:7            Constant:
+0:7              1 (const int)
+0:?           'no_interp' (layout( location=1) flat in uint)
 0:7      move second child to first child ( temp 4-component vector of float)
 0:?         '@entryPointOutput' (layout( location=0) out 4-component vector of float)
 0:7        Function Call: @main(struct-PSInput-f1-u11; ( temp 4-component vector of float)
 0:?           'input' ( temp structure{ temp float interp,  temp uint no_interp})
 0:?   Linker Objects
 0:?     '@entryPointOutput' (layout( location=0) out 4-component vector of float)
-0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'interp' (layout( location=0) in float)
+0:?     'no_interp' (layout( location=1) flat in uint)
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -82,7 +104,7 @@ gl_FragCoord origin is upper left
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 33 40
+                              EntryPoint Fragment 4  "main" 32 36 40
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "main"
@@ -92,14 +114,13 @@ gl_FragCoord origin is upper left
                               Name 13  "@main(struct-PSInput-f1-u11;"
                               Name 12  "input"
                               Name 30  "input"
-                              Name 31  "PSInput"
-                              MemberName 31(PSInput) 0  "interp"
-                              MemberName 31(PSInput) 1  "no_interp"
-                              Name 33  "input"
+                              Name 32  "interp"
+                              Name 36  "no_interp"
                               Name 40  "@entryPointOutput"
                               Name 41  "param"
-                              MemberDecorate 31(PSInput) 1 Flat
-                              Decorate 33(input) Location 0
+                              Decorate 32(interp) Location 0
+                              Decorate 36(no_interp) Flat
+                              Decorate 36(no_interp) Location 1
                               Decorate 40(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
@@ -116,20 +137,20 @@ gl_FragCoord origin is upper left
               22:             TypePointer Function 6(float)
               25:    6(float) Constant 0
               26:    6(float) Constant 1065353216
-     31(PSInput):             TypeStruct 6(float) 7(int)
-              32:             TypePointer Input 31(PSInput)
-       33(input):     32(ptr) Variable Input
+              31:             TypePointer Input 6(float)
+      32(interp):     31(ptr) Variable Input
+              35:             TypePointer Input 7(int)
+   36(no_interp):     35(ptr) Variable Input
               39:             TypePointer Output 10(fvec4)
 40(@entryPointOutput):     39(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
        30(input):      9(ptr) Variable Function
        41(param):      9(ptr) Variable Function
-              34: 31(PSInput) Load 33(input)
-              35:    6(float) CompositeExtract 34 0
-              36:     22(ptr) AccessChain 30(input) 21
-                              Store 36 35
-              37:      7(int) CompositeExtract 34 1
+              33:    6(float) Load 32(interp)
+              34:     22(ptr) AccessChain 30(input) 21
+                              Store 34 33
+              37:      7(int) Load 36(no_interp)
               38:     17(ptr) AccessChain 30(input) 16
                               Store 38 37
               42:  8(PSInput) Load 30(input)
diff --git a/Test/baseResults/hlsl.target.frag.out b/Test/baseResults/hlsl.target.frag.out
index a44931f1615576bce32f804dbf106b4d88365a4e..649f6558c58b268b3382135be1d8e663d216648b 100755
--- a/Test/baseResults/hlsl.target.frag.out
+++ b/Test/baseResults/hlsl.target.frag.out
@@ -25,9 +25,19 @@ gl_FragCoord origin is upper left
 0:7  Function Definition: main( ( temp void)
 0:7    Function Parameters: 
 0:?     Sequence
-0:7      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:7      Sequence
+0:7        move second child to first child ( temp float)
+0:7          interp: direct index for structure ( temp float)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:7            Constant:
+0:7              0 (const int)
+0:?           'interp' (layout( location=0) in float)
+0:7        move second child to first child ( temp uint)
+0:7          no_interp: direct index for structure ( temp uint)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:7            Constant:
+0:7              1 (const int)
+0:?           'no_interp' (layout( location=1) flat in uint)
 0:7      Function Call: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void)
 0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
 0:?         'out1' ( temp 4-component vector of float)
@@ -39,7 +49,8 @@ gl_FragCoord origin is upper left
 0:?         'out2' (layout( location=3) out 4-component vector of float)
 0:?         'out2' ( temp 4-component vector of float)
 0:?   Linker Objects
-0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'interp' (layout( location=0) in float)
+0:?     'no_interp' (layout( location=1) flat in uint)
 0:?     'out1' (layout( location=1) out 4-component vector of float)
 0:?     'out2' (layout( location=3) out 4-component vector of float)
 
@@ -73,9 +84,19 @@ gl_FragCoord origin is upper left
 0:7  Function Definition: main( ( temp void)
 0:7    Function Parameters: 
 0:?     Sequence
-0:7      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:7      Sequence
+0:7        move second child to first child ( temp float)
+0:7          interp: direct index for structure ( temp float)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:7            Constant:
+0:7              0 (const int)
+0:?           'interp' (layout( location=0) in float)
+0:7        move second child to first child ( temp uint)
+0:7          no_interp: direct index for structure ( temp uint)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:7            Constant:
+0:7              1 (const int)
+0:?           'no_interp' (layout( location=1) flat in uint)
 0:7      Function Call: @main(struct-PSInput-f1-u11;vf4;vf4; ( temp void)
 0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
 0:?         'out1' ( temp 4-component vector of float)
@@ -87,7 +108,8 @@ gl_FragCoord origin is upper left
 0:?         'out2' (layout( location=3) out 4-component vector of float)
 0:?         'out2' ( temp 4-component vector of float)
 0:?   Linker Objects
-0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'interp' (layout( location=0) in float)
+0:?     'no_interp' (layout( location=1) flat in uint)
 0:?     'out1' (layout( location=1) out 4-component vector of float)
 0:?     'out2' (layout( location=3) out 4-component vector of float)
 
@@ -98,7 +120,7 @@ gl_FragCoord origin is upper left
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 25 46 48
+                              EntryPoint Fragment 4  "main" 26 32 46 48
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "main"
@@ -110,10 +132,8 @@ gl_FragCoord origin is upper left
                               Name 14  "out1"
                               Name 15  "out2"
                               Name 22  "input"
-                              Name 23  "PSInput"
-                              MemberName 23(PSInput) 0  "interp"
-                              MemberName 23(PSInput) 1  "no_interp"
-                              Name 25  "input"
+                              Name 26  "interp"
+                              Name 32  "no_interp"
                               Name 36  "out1"
                               Name 37  "out2"
                               Name 38  "param"
@@ -121,8 +141,9 @@ gl_FragCoord origin is upper left
                               Name 41  "param"
                               Name 46  "out1"
                               Name 48  "out2"
-                              MemberDecorate 23(PSInput) 1 Flat
-                              Decorate 25(input) Location 0
+                              Decorate 26(interp) Location 0
+                              Decorate 32(no_interp) Flat
+                              Decorate 32(no_interp) Location 1
                               Decorate 46(out1) Location 1
                               Decorate 48(out2) Location 3
                2:             TypeVoid
@@ -138,13 +159,14 @@ gl_FragCoord origin is upper left
               19:   10(fvec4) ConstantComposite 18 18 18 18
               20:    6(float) Constant 0
               21:   10(fvec4) ConstantComposite 20 20 20 20
-     23(PSInput):             TypeStruct 6(float) 7(int)
-              24:             TypePointer Input 23(PSInput)
-       25(input):     24(ptr) Variable Input
-              28:             TypeInt 32 1
-              29:     28(int) Constant 0
-              30:             TypePointer Function 6(float)
-              33:     28(int) Constant 1
+              23:             TypeInt 32 1
+              24:     23(int) Constant 0
+              25:             TypePointer Input 6(float)
+      26(interp):     25(ptr) Variable Input
+              28:             TypePointer Function 6(float)
+              30:     23(int) Constant 1
+              31:             TypePointer Input 7(int)
+   32(no_interp):     31(ptr) Variable Input
               34:             TypePointer Function 7(int)
               45:             TypePointer Output 10(fvec4)
         46(out1):     45(ptr) Variable Output
@@ -157,13 +179,12 @@ gl_FragCoord origin is upper left
        38(param):      9(ptr) Variable Function
        40(param):     11(ptr) Variable Function
        41(param):     11(ptr) Variable Function
-              26: 23(PSInput) Load 25(input)
-              27:    6(float) CompositeExtract 26 0
-              31:     30(ptr) AccessChain 22(input) 29
-                              Store 31 27
-              32:      7(int) CompositeExtract 26 1
-              35:     34(ptr) AccessChain 22(input) 33
-                              Store 35 32
+              27:    6(float) Load 26(interp)
+              29:     28(ptr) AccessChain 22(input) 24
+                              Store 29 27
+              33:      7(int) Load 32(no_interp)
+              35:     34(ptr) AccessChain 22(input) 30
+                              Store 35 33
               39:  8(PSInput) Load 22(input)
                               Store 38(param) 39
               42:           2 FunctionCall 16(@main(struct-PSInput-f1-u11;vf4;vf4;) 38(param) 40(param) 41(param)
diff --git a/Test/baseResults/hlsl.targetStruct1.frag.out b/Test/baseResults/hlsl.targetStruct1.frag.out
index 48fee1289fb49437200d0fe4d15cb00b754f5c80..d38d9b0ceeb354d57267ce21ec1ae2b2879fb112 100755
--- a/Test/baseResults/hlsl.targetStruct1.frag.out
+++ b/Test/baseResults/hlsl.targetStruct1.frag.out
@@ -48,9 +48,19 @@ gl_FragCoord origin is upper left
 0:12  Function Definition: main( ( temp void)
 0:12    Function Parameters: 
 0:?     Sequence
-0:12      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:12      Sequence
+0:12        move second child to first child ( temp float)
+0:12          interp: direct index for structure ( temp float)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:12            Constant:
+0:12              0 (const int)
+0:?           'interp' (layout( location=0) in float)
+0:12        move second child to first child ( temp uint)
+0:12          no_interp: direct index for structure ( temp uint)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:12            Constant:
+0:12              1 (const int)
+0:?           'no_interp' (layout( location=1) flat in uint)
 0:12      Sequence
 0:12        move second child to first child ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
 0:12          'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
@@ -75,7 +85,8 @@ gl_FragCoord origin is upper left
 0:?   Linker Objects
 0:?     'o1' (layout( location=2) out 4-component vector of float)
 0:?     'o2' (layout( location=1) out 4-component vector of float)
-0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'interp' (layout( location=0) in float)
+0:?     'no_interp' (layout( location=1) flat in uint)
 0:?     'po' (layout( location=0) out 4-component vector of float)
 
 
@@ -131,9 +142,19 @@ gl_FragCoord origin is upper left
 0:12  Function Definition: main( ( temp void)
 0:12    Function Parameters: 
 0:?     Sequence
-0:12      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:12      Sequence
+0:12        move second child to first child ( temp float)
+0:12          interp: direct index for structure ( temp float)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:12            Constant:
+0:12              0 (const int)
+0:?           'interp' (layout( location=0) in float)
+0:12        move second child to first child ( temp uint)
+0:12          no_interp: direct index for structure ( temp uint)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:12            Constant:
+0:12              1 (const int)
+0:?           'no_interp' (layout( location=1) flat in uint)
 0:12      Sequence
 0:12        move second child to first child ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
 0:12          'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
@@ -158,7 +179,8 @@ gl_FragCoord origin is upper left
 0:?   Linker Objects
 0:?     'o1' (layout( location=2) out 4-component vector of float)
 0:?     'o2' (layout( location=1) out 4-component vector of float)
-0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'interp' (layout( location=0) in float)
+0:?     'no_interp' (layout( location=1) flat in uint)
 0:?     'po' (layout( location=0) out 4-component vector of float)
 
 // Module Version 10000
@@ -168,7 +190,7 @@ gl_FragCoord origin is upper left
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 43 57 60 63
+                              EntryPoint Fragment 4  "main" 42 46 57 60 63
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "main"
@@ -183,10 +205,8 @@ gl_FragCoord origin is upper left
                               Name 15  "po"
                               Name 19  "pso"
                               Name 40  "input"
-                              Name 41  "PSInput"
-                              MemberName 41(PSInput) 0  "interp"
-                              MemberName 41(PSInput) 1  "no_interp"
-                              Name 43  "input"
+                              Name 42  "interp"
+                              Name 46  "no_interp"
                               Name 49  "flattenTemp"
                               Name 50  "po"
                               Name 51  "param"
@@ -194,8 +214,9 @@ gl_FragCoord origin is upper left
                               Name 57  "o1"
                               Name 60  "o2"
                               Name 63  "po"
-                              MemberDecorate 41(PSInput) 1 Flat
-                              Decorate 43(input) Location 0
+                              Decorate 42(interp) Location 0
+                              Decorate 46(no_interp) Flat
+                              Decorate 46(no_interp) Location 1
                               Decorate 57(o1) Location 2
                               Decorate 60(o2) Location 1
                               Decorate 63(po) Location 0
@@ -219,9 +240,10 @@ gl_FragCoord origin is upper left
               31:    6(float) Constant 1065353216
               34:   10(fvec4) ConstantComposite 31 31 31 31
               36:   10(fvec4) ConstantComposite 30 30 30 30
-     41(PSInput):             TypeStruct 6(float) 7(int)
-              42:             TypePointer Input 41(PSInput)
-       43(input):     42(ptr) Variable Input
+              41:             TypePointer Input 6(float)
+      42(interp):     41(ptr) Variable Input
+              45:             TypePointer Input 7(int)
+   46(no_interp):     45(ptr) Variable Input
               56:             TypePointer Output 10(fvec4)
           57(o1):     56(ptr) Variable Output
           60(o2):     56(ptr) Variable Output
@@ -233,11 +255,10 @@ gl_FragCoord origin is upper left
           50(po):     11(ptr) Variable Function
        51(param):      9(ptr) Variable Function
        53(param):     11(ptr) Variable Function
-              44: 41(PSInput) Load 43(input)
-              45:    6(float) CompositeExtract 44 0
-              46:     27(ptr) AccessChain 40(input) 21
-                              Store 46 45
-              47:      7(int) CompositeExtract 44 1
+              43:    6(float) Load 42(interp)
+              44:     27(ptr) AccessChain 40(input) 21
+                              Store 44 43
+              47:      7(int) Load 46(no_interp)
               48:     23(ptr) AccessChain 40(input) 22
                               Store 48 47
               52:  8(PSInput) Load 40(input)
diff --git a/Test/baseResults/hlsl.targetStruct2.frag.out b/Test/baseResults/hlsl.targetStruct2.frag.out
index 0c2ac50a17a0ef20f30d13735651046fb89e1892..1e52055c950bf792704bb8ad84205818a6aec082 100755
--- a/Test/baseResults/hlsl.targetStruct2.frag.out
+++ b/Test/baseResults/hlsl.targetStruct2.frag.out
@@ -48,9 +48,19 @@ gl_FragCoord origin is upper left
 0:12  Function Definition: main( ( temp void)
 0:12    Function Parameters: 
 0:?     Sequence
-0:12      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:12      Sequence
+0:12        move second child to first child ( temp float)
+0:12          interp: direct index for structure ( temp float)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:12            Constant:
+0:12              0 (const int)
+0:?           'interp' (layout( location=0) in float)
+0:12        move second child to first child ( temp uint)
+0:12          no_interp: direct index for structure ( temp uint)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:12            Constant:
+0:12              1 (const int)
+0:?           'no_interp' (layout( location=1) flat in uint)
 0:12      Sequence
 0:12        move second child to first child ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
 0:12          'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
@@ -75,7 +85,8 @@ gl_FragCoord origin is upper left
 0:?   Linker Objects
 0:?     'o1' (layout( location=2) out 4-component vector of float)
 0:?     'o2' (layout( location=3) out 4-component vector of float)
-0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'interp' (layout( location=0) in float)
+0:?     'no_interp' (layout( location=1) flat in uint)
 0:?     'po' (layout( location=0) out 4-component vector of float)
 
 
@@ -131,9 +142,19 @@ gl_FragCoord origin is upper left
 0:12  Function Definition: main( ( temp void)
 0:12    Function Parameters: 
 0:?     Sequence
-0:12      move second child to first child ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' ( temp structure{ temp float interp,  temp uint no_interp})
-0:?         'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:12      Sequence
+0:12        move second child to first child ( temp float)
+0:12          interp: direct index for structure ( temp float)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:12            Constant:
+0:12              0 (const int)
+0:?           'interp' (layout( location=0) in float)
+0:12        move second child to first child ( temp uint)
+0:12          no_interp: direct index for structure ( temp uint)
+0:?             'input' ( temp structure{ temp float interp,  temp uint no_interp})
+0:12            Constant:
+0:12              1 (const int)
+0:?           'no_interp' (layout( location=1) flat in uint)
 0:12      Sequence
 0:12        move second child to first child ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
 0:12          'flattenTemp' ( temp structure{ temp 4-component vector of float o1,  temp 4-component vector of float o2})
@@ -158,7 +179,8 @@ gl_FragCoord origin is upper left
 0:?   Linker Objects
 0:?     'o1' (layout( location=2) out 4-component vector of float)
 0:?     'o2' (layout( location=3) out 4-component vector of float)
-0:?     'input' (layout( location=0) in structure{ temp float interp,  flat temp uint no_interp})
+0:?     'interp' (layout( location=0) in float)
+0:?     'no_interp' (layout( location=1) flat in uint)
 0:?     'po' (layout( location=0) out 4-component vector of float)
 
 // Module Version 10000
@@ -168,7 +190,7 @@ gl_FragCoord origin is upper left
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Fragment 4  "main" 43 57 60 63
+                              EntryPoint Fragment 4  "main" 42 46 57 60 63
                               ExecutionMode 4 OriginUpperLeft
                               Source HLSL 500
                               Name 4  "main"
@@ -183,10 +205,8 @@ gl_FragCoord origin is upper left
                               Name 15  "po"
                               Name 19  "pso"
                               Name 40  "input"
-                              Name 41  "PSInput"
-                              MemberName 41(PSInput) 0  "interp"
-                              MemberName 41(PSInput) 1  "no_interp"
-                              Name 43  "input"
+                              Name 42  "interp"
+                              Name 46  "no_interp"
                               Name 49  "flattenTemp"
                               Name 50  "po"
                               Name 51  "param"
@@ -194,8 +214,9 @@ gl_FragCoord origin is upper left
                               Name 57  "o1"
                               Name 60  "o2"
                               Name 63  "po"
-                              MemberDecorate 41(PSInput) 1 Flat
-                              Decorate 43(input) Location 0
+                              Decorate 42(interp) Location 0
+                              Decorate 46(no_interp) Flat
+                              Decorate 46(no_interp) Location 1
                               Decorate 57(o1) Location 2
                               Decorate 60(o2) Location 3
                               Decorate 63(po) Location 0
@@ -219,9 +240,10 @@ gl_FragCoord origin is upper left
               31:    6(float) Constant 1065353216
               34:   10(fvec4) ConstantComposite 31 31 31 31
               36:   10(fvec4) ConstantComposite 30 30 30 30
-     41(PSInput):             TypeStruct 6(float) 7(int)
-              42:             TypePointer Input 41(PSInput)
-       43(input):     42(ptr) Variable Input
+              41:             TypePointer Input 6(float)
+      42(interp):     41(ptr) Variable Input
+              45:             TypePointer Input 7(int)
+   46(no_interp):     45(ptr) Variable Input
               56:             TypePointer Output 10(fvec4)
           57(o1):     56(ptr) Variable Output
           60(o2):     56(ptr) Variable Output
@@ -233,11 +255,10 @@ gl_FragCoord origin is upper left
           50(po):     11(ptr) Variable Function
        51(param):      9(ptr) Variable Function
        53(param):     11(ptr) Variable Function
-              44: 41(PSInput) Load 43(input)
-              45:    6(float) CompositeExtract 44 0
-              46:     27(ptr) AccessChain 40(input) 21
-                              Store 46 45
-              47:      7(int) CompositeExtract 44 1
+              43:    6(float) Load 42(interp)
+              44:     27(ptr) AccessChain 40(input) 21
+                              Store 44 43
+              47:      7(int) Load 46(no_interp)
               48:     23(ptr) AccessChain 40(input) 22
                               Store 48 47
               52:  8(PSInput) Load 40(input)
diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp
index e684fd11411f827f4f122b23bacd9d2463559a41..a1e783baaf014461cbaff003b48cb57a3c40465a 100755
--- a/hlsl/hlslParseHelper.cpp
+++ b/hlsl/hlslParseHelper.cpp
@@ -1904,6 +1904,10 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
             // Structs containing built-ins must be split
             else if (variable.getType().containsBuiltIn())
                 split(variable);
+            else if (!variable.getType().getQualifier().isArrayedIo(language))
+                flatten(variable);
+            //else
+                // TODO: unify split and flatten, so all paths can create flattened I/O
         }
 
         // For clip and cull distance, multiple output variables potentially get merged
@@ -1915,7 +1919,7 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
     if (entryPointOutput != nullptr)
         makeVariableInOut(*entryPointOutput);
     for (auto it = inputs.begin(); it != inputs.end(); ++it)
-        if (!isDsPcfInput((*it)->getType()))  // skip domain shader PCF input (see comment below)
+        if (!isDsPcfInput((*it)->getType()))  // wait until the end for PCF input (see comment below)
             makeVariableInOut(*(*it));
     for (auto it = outputs.begin(); it != outputs.end(); ++it)
         makeVariableInOut(*(*it));
@@ -1927,7 +1931,7 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
     // however, so this ensures the linkage is built in the correct order regardless of argument order.
     if (language == EShLangTessEvaluation) {
         for (auto it = inputs.begin(); it != inputs.end(); ++it)
-            if (isDsPcfInput((*it)->getType()))  // skip domain shader PCF input (see comment below)
+            if (isDsPcfInput((*it)->getType()))
                 makeVariableInOut(*(*it));
     }