From cca42a8ea6d5148dc9ad7f4a9eed1b1e45b2dc6a Mon Sep 17 00:00:00 2001
From: John Kessenich <cepheus@frii.com>
Date: Thu, 3 Aug 2017 18:41:48 -0600
Subject: [PATCH] HLSL: Stop including empty structures in the I/O interface.
 Fix #785.

---
 Test/baseResults/hlsl.clipdistance-4.vert.out | 12 +-----
 Test/baseResults/hlsl.clipdistance-5.vert.out | 12 +-----
 Test/baseResults/hlsl.clipdistance-6.vert.out | 12 +-----
 Test/baseResults/hlsl.clipdistance-7.vert.out | 12 +-----
 Test/baseResults/hlsl.clipdistance-8.vert.out | 12 +-----
 Test/baseResults/hlsl.clipdistance-9.vert.out | 12 +-----
 Test/baseResults/hlsl.domain.1.tese.out       | 13 +------
 Test/baseResults/hlsl.domain.3.tese.out       | 13 +------
 .../hlsl.emptystructreturn.frag.out           |  7 +---
 .../hlsl.emptystructreturn.vert.out           |  7 +---
 .../hlsl.gather.basic.dx10.vert.out           | 12 +-----
 .../hlsl.getdimensions.dx10.vert.out          | 12 +-----
 Test/baseResults/hlsl.hull.1.tesc.out         | 13 +------
 Test/baseResults/hlsl.hull.2.tesc.out         | 13 +------
 Test/baseResults/hlsl.hull.3.tesc.out         | 13 +------
 Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out  | 13 +------
 Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out  | 13 +------
 .../baseResults/hlsl.load.basic.dx10.vert.out | 12 +-----
 .../hlsl.samplegrad.basic.dx10.vert.out       | 12 +-----
 .../hlsl.samplelevel.basic.dx10.vert.out      | 12 +-----
 .../hlsl.struct.split.trivial.geom.out        | 21 +---------
 .../hlsl.struct.split.trivial.vert.out        | 12 +-----
 hlsl/hlslParseHelper.cpp                      | 38 ++++++++++---------
 23 files changed, 64 insertions(+), 244 deletions(-)

diff --git a/Test/baseResults/hlsl.clipdistance-4.vert.out b/Test/baseResults/hlsl.clipdistance-4.vert.out
index acb1100fe..916f8328f 100644
--- a/Test/baseResults/hlsl.clipdistance-4.vert.out
+++ b/Test/baseResults/hlsl.clipdistance-4.vert.out
@@ -128,7 +128,6 @@ Shader version: 500
 0:11              Constant:
 0:11                3 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     'Position' (layout( location=0) in 4-component vector of float)
 0:?     '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
 
@@ -265,19 +264,18 @@ Shader version: 500
 0:11              Constant:
 0:11                3 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     'Position' (layout( location=0) in 4-component vector of float)
 0:?     '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 75
+// Id's are bound by 72
 
                               Capability Shader
                               Capability ClipDistance
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 43 50 56 74
+                              EntryPoint Vertex 4  "main" 43 50 56
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_INPUT"
@@ -293,12 +291,9 @@ Shader version: 500
                               Name 46  "flattenTemp"
                               Name 50  "@entryPointOutput_Position"
                               Name 56  "@entryPointOutput_ClipRect"
-                              Name 72  "VS_OUTPUT"
-                              Name 74  "@entryPointOutput"
                               Decorate 43(Position) Location 0
                               Decorate 50(@entryPointOutput_Position) BuiltIn Position
                               Decorate 56(@entryPointOutput_ClipRect) BuiltIn ClipDistance
-                              Decorate 74(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -335,9 +330,6 @@ Shader version: 500
               59:             TypePointer Output 6(float)
               64:     16(int) Constant 2
               68:     16(int) Constant 3
-   72(VS_OUTPUT):             TypeStruct
-              73:             TypePointer Output 72(VS_OUTPUT)
-74(@entryPointOutput):     73(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
            41(v):     40(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.clipdistance-5.vert.out b/Test/baseResults/hlsl.clipdistance-5.vert.out
index 643a67848..3fd39028d 100644
--- a/Test/baseResults/hlsl.clipdistance-5.vert.out
+++ b/Test/baseResults/hlsl.clipdistance-5.vert.out
@@ -152,7 +152,6 @@ Shader version: 500
 0:11              Constant:
 0:11                1 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     'Position' (layout( location=0) in 4-component vector of float)
 0:?     '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
 
@@ -313,19 +312,18 @@ Shader version: 500
 0:11              Constant:
 0:11                1 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     'Position' (layout( location=0) in 4-component vector of float)
 0:?     '@entryPointOutput_ClipRect' ( out 4-element array of float ClipDistance)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 76
+// Id's are bound by 73
 
                               Capability Shader
                               Capability ClipDistance
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 44 51 57 75
+                              EntryPoint Vertex 4  "main" 44 51 57
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_INPUT"
@@ -341,12 +339,9 @@ Shader version: 500
                               Name 47  "flattenTemp"
                               Name 51  "@entryPointOutput_Position"
                               Name 57  "@entryPointOutput_ClipRect"
-                              Name 73  "VS_OUTPUT"
-                              Name 75  "@entryPointOutput"
                               Decorate 44(Position) Location 0
                               Decorate 51(@entryPointOutput_Position) BuiltIn Position
                               Decorate 57(@entryPointOutput_ClipRect) BuiltIn ClipDistance
-                              Decorate 75(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -384,9 +379,6 @@ Shader version: 500
               60:             TypePointer Output 6(float)
               65:     20(int) Constant 2
               69:     20(int) Constant 3
-   73(VS_OUTPUT):             TypeStruct
-              74:             TypePointer Output 73(VS_OUTPUT)
-75(@entryPointOutput):     74(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
            42(v):     41(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.clipdistance-6.vert.out b/Test/baseResults/hlsl.clipdistance-6.vert.out
index efce79620..9d7375e0a 100644
--- a/Test/baseResults/hlsl.clipdistance-6.vert.out
+++ b/Test/baseResults/hlsl.clipdistance-6.vert.out
@@ -208,7 +208,6 @@ Shader version: 500
 0:8              Constant:
 0:8                3 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
 
 
@@ -424,18 +423,17 @@ Shader version: 500
 0:8              Constant:
 0:8                3 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 89
+// Id's are bound by 86
 
                               Capability Shader
                               Capability ClipDistance
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 49 55 88
+                              EntryPoint Vertex 4  "main" 49 55
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
@@ -447,11 +445,8 @@ Shader version: 500
                               Name 46  "flattenTemp"
                               Name 49  "@entryPointOutput_Position"
                               Name 55  "@entryPointOutput_clip1"
-                              Name 86  "VS_OUTPUT"
-                              Name 88  "@entryPointOutput"
                               Decorate 49(@entryPointOutput_Position) BuiltIn Position
                               Decorate 55(@entryPointOutput_clip1) BuiltIn ClipDistance
-                              Decorate 88(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -491,9 +486,6 @@ Shader version: 500
               74:     14(int) Constant 5
               78:     14(int) Constant 6
               82:     14(int) Constant 7
-   86(VS_OUTPUT):             TypeStruct
-              87:             TypePointer Output 86(VS_OUTPUT)
-88(@entryPointOutput):     87(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
  46(flattenTemp):     12(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.clipdistance-7.vert.out b/Test/baseResults/hlsl.clipdistance-7.vert.out
index 324320be6..01de52a73 100644
--- a/Test/baseResults/hlsl.clipdistance-7.vert.out
+++ b/Test/baseResults/hlsl.clipdistance-7.vert.out
@@ -186,7 +186,6 @@ Shader version: 500
 0:8              Constant:
 0:8                3 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
 
 
@@ -380,18 +379,17 @@ Shader version: 500
 0:8              Constant:
 0:8                3 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     '@entryPointOutput_clip1' ( out 8-element array of float ClipDistance)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 84
+// Id's are bound by 81
 
                               Capability Shader
                               Capability ClipDistance
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 48 54 83
+                              EntryPoint Vertex 4  "main" 48 54
                               Source HLSL 500
                               Name 4  "main"
                               Name 9  "VS_OUTPUT"
@@ -403,11 +401,8 @@ Shader version: 500
                               Name 45  "flattenTemp"
                               Name 48  "@entryPointOutput_Position"
                               Name 54  "@entryPointOutput_clip1"
-                              Name 81  "VS_OUTPUT"
-                              Name 83  "@entryPointOutput"
                               Decorate 48(@entryPointOutput_Position) BuiltIn Position
                               Decorate 54(@entryPointOutput_clip1) BuiltIn ClipDistance
-                              Decorate 83(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -446,9 +441,6 @@ Shader version: 500
               69:     15(int) Constant 5
               73:     15(int) Constant 6
               77:     15(int) Constant 7
-   81(VS_OUTPUT):             TypeStruct
-              82:             TypePointer Output 81(VS_OUTPUT)
-83(@entryPointOutput):     82(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
  45(flattenTemp):     13(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.clipdistance-8.vert.out b/Test/baseResults/hlsl.clipdistance-8.vert.out
index 94750b13b..20abcb4cb 100644
--- a/Test/baseResults/hlsl.clipdistance-8.vert.out
+++ b/Test/baseResults/hlsl.clipdistance-8.vert.out
@@ -114,7 +114,6 @@ Shader version: 500
 0:8              Constant:
 0:8                2 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
 
 
@@ -236,18 +235,17 @@ Shader version: 500
 0:8              Constant:
 0:8                2 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     '@entryPointOutput_clip1' ( out 4-element array of float ClipDistance)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 65
+// Id's are bound by 62
 
                               Capability Shader
                               Capability ClipDistance
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 41 47 64
+                              EntryPoint Vertex 4  "main" 41 47
                               Source HLSL 500
                               Name 4  "main"
                               Name 9  "VS_OUTPUT"
@@ -259,11 +257,8 @@ Shader version: 500
                               Name 38  "flattenTemp"
                               Name 41  "@entryPointOutput_Position"
                               Name 47  "@entryPointOutput_clip1"
-                              Name 62  "VS_OUTPUT"
-                              Name 64  "@entryPointOutput"
                               Decorate 41(@entryPointOutput_Position) BuiltIn Position
                               Decorate 47(@entryPointOutput_clip1) BuiltIn ClipDistance
-                              Decorate 64(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -295,9 +290,6 @@ Shader version: 500
 47(@entryPointOutput_clip1):     46(ptr) Variable Output
               50:             TypePointer Output 6(float)
               58:     15(int) Constant 3
-   62(VS_OUTPUT):             TypeStruct
-              63:             TypePointer Output 62(VS_OUTPUT)
-64(@entryPointOutput):     63(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
  38(flattenTemp):     13(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.clipdistance-9.vert.out b/Test/baseResults/hlsl.clipdistance-9.vert.out
index a3502b774..1ab0d0125 100644
--- a/Test/baseResults/hlsl.clipdistance-9.vert.out
+++ b/Test/baseResults/hlsl.clipdistance-9.vert.out
@@ -91,7 +91,6 @@ Shader version: 500
 0:7              3 (const int)
 0:?           'clip1' ( temp float)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     'clip0' ( out 4-element array of float ClipDistance)
 
 
@@ -190,18 +189,17 @@ Shader version: 500
 0:7              3 (const int)
 0:?           'clip1' ( temp float)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     'clip0' ( out 4-element array of float ClipDistance)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 70
+// Id's are bound by 67
 
                               Capability Shader
                               Capability ClipDistance
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 39 51 69
+                              EntryPoint Vertex 4  "main" 39 51
                               Source HLSL 500
                               Name 4  "main"
                               Name 11  "VS_OUTPUT"
@@ -216,11 +214,8 @@ Shader version: 500
                               Name 42  "param"
                               Name 43  "param"
                               Name 51  "clip0"
-                              Name 67  "VS_OUTPUT"
-                              Name 69  "@entryPointOutput"
                               Decorate 39(@entryPointOutput_Position) BuiltIn Position
                               Decorate 51(clip0) BuiltIn ClipDistance
-                              Decorate 69(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -253,9 +248,6 @@ Shader version: 500
               56:     19(int) Constant 1
               60:     19(int) Constant 2
               64:     19(int) Constant 3
-   67(VS_OUTPUT):             TypeStruct
-              68:             TypePointer Output 67(VS_OUTPUT)
-69(@entryPointOutput):     68(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
        40(clip0):      8(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.domain.1.tese.out b/Test/baseResults/hlsl.domain.1.tese.out
index e1a414d80..17094459c 100644
--- a/Test/baseResults/hlsl.domain.1.tese.out
+++ b/Test/baseResults/hlsl.domain.1.tese.out
@@ -115,7 +115,6 @@ triangle order = none
 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 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{})
 0:?     'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
 0:?     'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
 
@@ -239,18 +238,17 @@ triangle order = none
 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 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{})
 0:?     'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
 0:?     'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 91
+// Id's are bound by 88
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationEvaluation 4  "main" 51 55 61 76 81 90
+                              EntryPoint TessellationEvaluation 4  "main" 51 55 61 76 81
                               ExecutionMode 4 Triangles
                               Source HLSL 500
                               Name 4  "main"
@@ -278,8 +276,6 @@ triangle order = none
                               Name 81  "@entryPointOutput"
                               Name 83  "param"
                               Name 85  "param"
-                              Name 88  "pcf_in_t"
-                              Name 90  "pcf_data"
                               Decorate 51(i) Location 0
                               Decorate 55(tesscoord) Patch
                               Decorate 55(tesscoord) BuiltIn TessCoord
@@ -288,8 +284,6 @@ triangle order = none
                               Decorate 76(pcf_data_flInsideTessFactor) Patch
                               Decorate 76(pcf_data_flInsideTessFactor) BuiltIn TessLevelInner
                               Decorate 81(@entryPointOutput) Location 0
-                              Decorate 90(pcf_data) Patch
-                              Decorate 90(pcf_data) Location 2
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -330,9 +324,6 @@ triangle order = none
 76(pcf_data_flInsideTessFactor):     75(ptr) Variable Input
               80:             TypePointer Output 17(gs_in_t)
 81(@entryPointOutput):     80(ptr) Variable Output
-    88(pcf_in_t):             TypeStruct
-              89:             TypePointer Input 88(pcf_in_t)
-    90(pcf_data):     89(ptr) Variable Input
          4(main):           2 Function None 3
                5:             Label
            49(i):     48(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.domain.3.tese.out b/Test/baseResults/hlsl.domain.3.tese.out
index d473b9629..07282aaea 100644
--- a/Test/baseResults/hlsl.domain.3.tese.out
+++ b/Test/baseResults/hlsl.domain.3.tese.out
@@ -112,7 +112,6 @@ triangle order = none
 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 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' (layout( location=2) patch in structure{})
 0:?     'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
 0:?     'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
 
@@ -233,18 +232,17 @@ triangle order = none
 0:?     '@entryPointOutput' (layout( location=0) out structure{ temp 4-component vector of float pos,  temp 3-component vector of float norm})
 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' (layout( location=2) patch in structure{})
 0:?     'pcf_data_flTessFactor' ( patch in 4-element array of float TessLevelOuter)
 0:?     'pcf_data_flInsideTessFactor' ( patch in 2-element array of float TessLevelInner)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 96
+// Id's are bound by 93
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationEvaluation 4  "main" 54 58 67 81 86 95
+                              EntryPoint TessellationEvaluation 4  "main" 54 58 67 81 86
                               ExecutionMode 4 Isolines
                               Source HLSL 500
                               Name 4  "main"
@@ -272,8 +270,6 @@ triangle order = none
                               Name 86  "@entryPointOutput"
                               Name 88  "param"
                               Name 90  "param"
-                              Name 93  "pcf_in_t"
-                              Name 95  "pcf_data"
                               Decorate 54(i) Location 0
                               Decorate 58(tesscoord) Patch
                               Decorate 58(tesscoord) BuiltIn TessCoord
@@ -282,8 +278,6 @@ triangle order = none
                               Decorate 81(pcf_data_flInsideTessFactor) Patch
                               Decorate 81(pcf_data_flInsideTessFactor) BuiltIn TessLevelInner
                               Decorate 86(@entryPointOutput) Location 0
-                              Decorate 95(pcf_data) Patch
-                              Decorate 95(pcf_data) Location 2
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -326,9 +320,6 @@ triangle order = none
 81(pcf_data_flInsideTessFactor):     80(ptr) Variable Input
               85:             TypePointer Output 19(gs_in_t)
 86(@entryPointOutput):     85(ptr) Variable Output
-    93(pcf_in_t):             TypeStruct
-              94:             TypePointer Input 93(pcf_in_t)
-    95(pcf_data):     94(ptr) Variable Input
          4(main):           2 Function None 3
                5:             Label
            52(i):     51(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.emptystructreturn.frag.out b/Test/baseResults/hlsl.emptystructreturn.frag.out
index 7d113936c..bdcdb1f4c 100644
--- a/Test/baseResults/hlsl.emptystructreturn.frag.out
+++ b/Test/baseResults/hlsl.emptystructreturn.frag.out
@@ -13,14 +13,13 @@ gl_FragCoord origin is upper left
 0:?     Sequence
 0:10      move second child to first child ( temp structure{})
 0:?         'i' ( temp structure{})
-0:?         'i' (layout( location=0) in structure{})
+0:?         'i' ( in structure{})
 0:10      Sequence
 0:10        move second child to first child ( temp structure{})
 0:?           '@entryPointOutput' ( out structure{})
 0:10          Function Call: @main(struct-ps_in1; ( temp structure{})
 0:?             'i' ( temp structure{})
 0:?   Linker Objects
-0:?     'i' (layout( location=0) in structure{})
 
 
 Linked fragment stage:
@@ -40,14 +39,13 @@ gl_FragCoord origin is upper left
 0:?     Sequence
 0:10      move second child to first child ( temp structure{})
 0:?         'i' ( temp structure{})
-0:?         'i' (layout( location=0) in structure{})
+0:?         'i' ( in structure{})
 0:10      Sequence
 0:10        move second child to first child ( temp structure{})
 0:?           '@entryPointOutput' ( out structure{})
 0:10          Function Call: @main(struct-ps_in1; ( temp structure{})
 0:?             'i' ( temp structure{})
 0:?   Linker Objects
-0:?     'i' (layout( location=0) in structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -69,7 +67,6 @@ gl_FragCoord origin is upper left
                               Name 20  "i"
                               Name 23  "@entryPointOutput"
                               Name 24  "param"
-                              Decorate 20(i) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
         6(ps_in):             TypeStruct
diff --git a/Test/baseResults/hlsl.emptystructreturn.vert.out b/Test/baseResults/hlsl.emptystructreturn.vert.out
index 64446bd11..b1ea61eb0 100644
--- a/Test/baseResults/hlsl.emptystructreturn.vert.out
+++ b/Test/baseResults/hlsl.emptystructreturn.vert.out
@@ -15,11 +15,10 @@ Shader version: 500
 0:?           'i' ( temp structure{})
 0:?           'i' ( in structure{})
 0:10      move second child to first child ( temp structure{})
-0:?         '@entryPointOutput' (layout( location=0) out structure{})
+0:?         '@entryPointOutput' ( out structure{})
 0:10        Function Call: @main(struct-vs_in1; ( temp structure{})
 0:?           'i' ( temp structure{})
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 
 Linked vertex stage:
@@ -41,11 +40,10 @@ Shader version: 500
 0:?           'i' ( temp structure{})
 0:?           'i' ( in structure{})
 0:10      move second child to first child ( temp structure{})
-0:?         '@entryPointOutput' (layout( location=0) out structure{})
+0:?         '@entryPointOutput' ( out structure{})
 0:10        Function Call: @main(struct-vs_in1; ( temp structure{})
 0:?           'i' ( temp structure{})
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
@@ -66,7 +64,6 @@ Shader version: 500
                               Name 20  "i"
                               Name 23  "@entryPointOutput"
                               Name 24  "param"
-                              Decorate 23(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
         6(vs_in):             TypeStruct
diff --git a/Test/baseResults/hlsl.gather.basic.dx10.vert.out b/Test/baseResults/hlsl.gather.basic.dx10.vert.out
index 46fb13caf..f894cf93d 100644
--- a/Test/baseResults/hlsl.gather.basic.dx10.vert.out
+++ b/Test/baseResults/hlsl.gather.basic.dx10.vert.out
@@ -105,7 +105,6 @@ Shader version: 500
 0:?     'g_tTexcdf4' ( uniform textureCube)
 0:?     'g_tTexcdi4' ( uniform itextureCube)
 0:?     'g_tTexcdu4' ( uniform utextureCube)
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 
 Linked vertex stage:
@@ -217,17 +216,16 @@ Shader version: 500
 0:?     'g_tTexcdf4' ( uniform textureCube)
 0:?     'g_tTexcdi4' ( uniform itextureCube)
 0:?     'g_tTexcdu4' ( uniform utextureCube)
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 129
+// Id's are bound by 126
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 103 128
+                              EntryPoint Vertex 4  "main" 103
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
@@ -256,8 +254,6 @@ Shader version: 500
                               Name 119  "g_tTex3df4"
                               Name 122  "g_tTex3di4"
                               Name 125  "g_tTex3du4"
-                              Name 126  "VS_OUTPUT"
-                              Name 128  "@entryPointOutput"
                               Decorate 16(g_tTex2df4) DescriptorSet 0
                               Decorate 20(g_sSamp) DescriptorSet 0
                               Decorate 20(g_sSamp) Binding 0
@@ -277,7 +273,6 @@ Shader version: 500
                               Decorate 119(g_tTex3df4) DescriptorSet 0
                               Decorate 122(g_tTex3di4) DescriptorSet 0
                               Decorate 125(g_tTex3du4) DescriptorSet 0
-                              Decorate 128(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -361,9 +356,6 @@ Shader version: 500
              123:             TypeImage 45(int) 3D sampled format:Unknown
              124:             TypePointer UniformConstant 123
  125(g_tTex3du4):    124(ptr) Variable UniformConstant
-  126(VS_OUTPUT):             TypeStruct
-             127:             TypePointer Output 126(VS_OUTPUT)
-128(@entryPointOutput):    127(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
              104:8(VS_OUTPUT) FunctionCall 10(@main()
diff --git a/Test/baseResults/hlsl.getdimensions.dx10.vert.out b/Test/baseResults/hlsl.getdimensions.dx10.vert.out
index cb1eae60c..bd1e169f1 100644
--- a/Test/baseResults/hlsl.getdimensions.dx10.vert.out
+++ b/Test/baseResults/hlsl.getdimensions.dx10.vert.out
@@ -53,7 +53,6 @@ Shader version: 500
 0:?   Linker Objects
 0:?     'g_sSamp' (layout( binding=0) uniform sampler)
 0:?     'g_tTex1df4' (layout( binding=0) uniform texture1D)
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 
 Linked vertex stage:
@@ -113,18 +112,17 @@ Shader version: 500
 0:?   Linker Objects
 0:?     'g_sSamp' (layout( binding=0) uniform sampler)
 0:?     'g_tTex1df4' (layout( binding=0) uniform texture1D)
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 51
+// Id's are bound by 48
 
                               Capability Shader
                               Capability Sampled1D
                               Capability ImageQuery
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 42 50
+                              EntryPoint Vertex 4  "main" 42
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
@@ -138,14 +136,11 @@ Shader version: 500
                               Name 33  "vsout"
                               Name 42  "@entryPointOutput_Pos"
                               Name 47  "g_sSamp"
-                              Name 48  "VS_OUTPUT"
-                              Name 50  "@entryPointOutput"
                               Decorate 17(g_tTex1df4) DescriptorSet 0
                               Decorate 17(g_tTex1df4) Binding 0
                               Decorate 42(@entryPointOutput_Pos) BuiltIn Position
                               Decorate 47(g_sSamp) DescriptorSet 0
                               Decorate 47(g_sSamp) Binding 0
-                              Decorate 50(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -169,9 +164,6 @@ Shader version: 500
               45:             TypeSampler
               46:             TypePointer UniformConstant 45
      47(g_sSamp):     46(ptr) Variable UniformConstant
-   48(VS_OUTPUT):             TypeStruct
-              49:             TypePointer Output 48(VS_OUTPUT)
-50(@entryPointOutput):     49(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
               43:8(VS_OUTPUT) FunctionCall 10(@main()
diff --git a/Test/baseResults/hlsl.hull.1.tesc.out b/Test/baseResults/hlsl.hull.1.tesc.out
index 3e1ad58b4..6965ae645 100644
--- a/Test/baseResults/hlsl.hull.1.tesc.out
+++ b/Test/baseResults/hlsl.hull.1.tesc.out
@@ -107,7 +107,6 @@ vertex spacing = equal_spacing
 0:?     'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
 0:?     'm_cpid' ( in uint InvocationID)
 0:?     'pid' ( in uint PrimitiveID)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
 
 
@@ -222,17 +221,16 @@ vertex spacing = equal_spacing
 0:?     'ip' (layout( location=0) in 4-element array of structure{ temp 3-component vector of float cpoint})
 0:?     'm_cpid' ( in uint InvocationID)
 0:?     'pid' ( in uint PrimitiveID)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 93
+// Id's are bound by 90
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationControl 4  "main" 40 44 48 66 72 92
+                              EntryPoint TessellationControl 4  "main" 40 44 48 66 72
                               ExecutionMode 4 OutputVertices 4
                               ExecutionMode 4 Isolines
                               ExecutionMode 4 SpacingEqual
@@ -262,16 +260,12 @@ vertex spacing = equal_spacing
                               Name 67  "param"
                               Name 72  "@patchConstantOutput_edges"
                               Name 82  "output"
-                              Name 90  "HS_CONSTANT_OUT"
-                              Name 92  "@patchConstantOutput"
                               Decorate 40(ip) Location 0
                               Decorate 44(m_cpid) BuiltIn InvocationId
                               Decorate 48(@entryPointOutput) Location 0
                               Decorate 66(pid) BuiltIn PrimitiveId
                               Decorate 72(@patchConstantOutput_edges) Patch
                               Decorate 72(@patchConstantOutput_edges) BuiltIn TessLevelOuter
-                              Decorate 92(@patchConstantOutput) Patch
-                              Decorate 92(@patchConstantOutput) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -313,9 +307,6 @@ vertex spacing = equal_spacing
               78:     29(int) Constant 1
               83:    6(float) Constant 1073741824
               85:    6(float) Constant 1090519040
-90(HS_CONSTANT_OUT):             TypeStruct
-              91:             TypePointer Output 90(HS_CONSTANT_OUT)
-92(@patchConstantOutput):     91(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
           38(ip):     12(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.hull.2.tesc.out b/Test/baseResults/hlsl.hull.2.tesc.out
index d32da52ce..899d93ae3 100644
--- a/Test/baseResults/hlsl.hull.2.tesc.out
+++ b/Test/baseResults/hlsl.hull.2.tesc.out
@@ -105,7 +105,6 @@ vertex spacing = equal_spacing
 0:?     'InvocationId' ( in uint InvocationID)
 0:?     'pid' ( in uint PrimitiveID)
 0:?     'pos' ( in 4-component vector of float Position)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
 
 
@@ -218,17 +217,16 @@ vertex spacing = equal_spacing
 0:?     'InvocationId' ( in uint InvocationID)
 0:?     'pid' ( in uint PrimitiveID)
 0:?     'pos' ( in 4-component vector of float Position)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 95
+// Id's are bound by 92
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationControl 4  "main" 42 46 48 64 66 74 94
+                              EntryPoint TessellationControl 4  "main" 42 46 48 64 66 74
                               ExecutionMode 4 OutputVertices 4
                               ExecutionMode 4 Isolines
                               ExecutionMode 4 SpacingEqual
@@ -258,8 +256,6 @@ vertex spacing = equal_spacing
                               Name 69  "param"
                               Name 74  "@patchConstantOutput_edges"
                               Name 84  "output"
-                              Name 92  "HS_CONSTANT_OUT"
-                              Name 94  "@patchConstantOutput"
                               Decorate 42(ip) Location 0
                               Decorate 46(@entryPointOutput) Location 0
                               Decorate 48(InvocationId) BuiltIn InvocationId
@@ -267,8 +263,6 @@ vertex spacing = equal_spacing
                               Decorate 66(pos) BuiltIn Position
                               Decorate 74(@patchConstantOutput_edges) Patch
                               Decorate 74(@patchConstantOutput_edges) BuiltIn TessLevelOuter
-                              Decorate 94(@patchConstantOutput) Patch
-                              Decorate 94(@patchConstantOutput) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -314,9 +308,6 @@ vertex spacing = equal_spacing
               80:     31(int) Constant 1
               85:    6(float) Constant 1073741824
               87:    6(float) Constant 1090519040
-92(HS_CONSTANT_OUT):             TypeStruct
-              93:             TypePointer Output 92(HS_CONSTANT_OUT)
-94(@patchConstantOutput):     93(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
           40(ip):     12(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.hull.3.tesc.out b/Test/baseResults/hlsl.hull.3.tesc.out
index c8b7a73a0..c0f12d4fb 100755
--- a/Test/baseResults/hlsl.hull.3.tesc.out
+++ b/Test/baseResults/hlsl.hull.3.tesc.out
@@ -105,7 +105,6 @@ vertex spacing = equal_spacing
 0:?     'InvocationId' ( in uint InvocationID)
 0:?     'pid' ( in uint PrimitiveID)
 0:?     'pos' ( in 4-component vector of float Position)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
 
 
@@ -218,17 +217,16 @@ vertex spacing = equal_spacing
 0:?     'InvocationId' ( in uint InvocationID)
 0:?     'pid' ( in uint PrimitiveID)
 0:?     'pos' ( in 4-component vector of float Position)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_edges' ( patch out 4-element array of float TessLevelOuter)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 95
+// Id's are bound by 92
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationControl 4  "main" 42 46 48 64 66 74 94
+                              EntryPoint TessellationControl 4  "main" 42 46 48 64 66 74
                               ExecutionMode 4 OutputVertices 4
                               ExecutionMode 4 Triangles
                               ExecutionMode 4 SpacingEqual
@@ -259,8 +257,6 @@ vertex spacing = equal_spacing
                               Name 69  "param"
                               Name 74  "@patchConstantOutput_edges"
                               Name 84  "output"
-                              Name 92  "HS_CONSTANT_OUT"
-                              Name 94  "@patchConstantOutput"
                               Decorate 42(ip) Location 0
                               Decorate 46(@entryPointOutput) Location 0
                               Decorate 48(InvocationId) BuiltIn InvocationId
@@ -268,8 +264,6 @@ vertex spacing = equal_spacing
                               Decorate 66(pos) BuiltIn Position
                               Decorate 74(@patchConstantOutput_edges) Patch
                               Decorate 74(@patchConstantOutput_edges) BuiltIn TessLevelOuter
-                              Decorate 94(@patchConstantOutput) Patch
-                              Decorate 94(@patchConstantOutput) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -315,9 +309,6 @@ vertex spacing = equal_spacing
               80:     31(int) Constant 1
               85:    6(float) Constant 1073741824
               87:    6(float) Constant 1090519040
-92(HS_CONSTANT_OUT):             TypeStruct
-              93:             TypePointer Output 92(HS_CONSTANT_OUT)
-94(@patchConstantOutput):     93(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
           40(ip):     12(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out b/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out
index 3d2ff3db6..08329bcc2 100644
--- a/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out
+++ b/Test/baseResults/hlsl.hull.ctrlpt-1.tesc.out
@@ -192,7 +192,6 @@ triangle order = cw
 0:?     '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
 0:?     'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
 0:?     'cpid' ( in uint InvocationID)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_tfactor' ( patch out 4-element array of float TessLevelOuter)
 0:?     '@patchConstantOutput_flInFactor' ( patch out 2-element array of float TessLevelInner)
 
@@ -393,18 +392,17 @@ triangle order = cw
 0:?     '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
 0:?     'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
 0:?     'cpid' ( in uint InvocationID)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_tfactor' ( patch out 4-element array of float TessLevelOuter)
 0:?     '@patchConstantOutput_flInFactor' ( patch out 2-element array of float TessLevelInner)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 127
+// Id's are bound by 124
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationControl 4  "main" 41 45 48 94 108 126
+                              EntryPoint TessellationControl 4  "main" 41 45 48 94 108
                               ExecutionMode 4 OutputVertices 3
                               ExecutionMode 4 Triangles
                               ExecutionMode 4 SpacingFractionalOdd
@@ -445,8 +443,6 @@ triangle order = cw
                               Name 94  "@patchConstantOutput_tfactor"
                               Name 108  "@patchConstantOutput_flInFactor"
                               Name 112  "o"
-                              Name 124  "hs_pcf_t"
-                              Name 126  "@patchConstantOutput"
                               Decorate 41(i) Location 0
                               Decorate 45(cpid) BuiltIn InvocationId
                               Decorate 48(@entryPointOutput) Location 0
@@ -454,8 +450,6 @@ triangle order = cw
                               Decorate 94(@patchConstantOutput_tfactor) BuiltIn TessLevelOuter
                               Decorate 108(@patchConstantOutput_flInFactor) Patch
                               Decorate 108(@patchConstantOutput_flInFactor) BuiltIn TessLevelInner
-                              Decorate 126(@patchConstantOutput) Patch
-                              Decorate 126(@patchConstantOutput) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -501,9 +495,6 @@ triangle order = cw
              107:             TypePointer Output 106
 108(@patchConstantOutput_flInFactor):    107(ptr) Variable Output
              119:    6(float) Constant 1082130432
-   124(hs_pcf_t):             TypeStruct
-             125:             TypePointer Output 124(hs_pcf_t)
-126(@patchConstantOutput):    125(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
            39(i):     12(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out b/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out
index 29ab61dd8..b95d65f3e 100644
--- a/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out
+++ b/Test/baseResults/hlsl.hull.ctrlpt-2.tesc.out
@@ -201,7 +201,6 @@ triangle order = cw
 0:?     '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
 0:?     'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
 0:?     'cpid' ( in uint InvocationID)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_tfactor' ( patch out 4-element array of float TessLevelOuter)
 0:?     '@patchConstantOutput_flInFactor' ( patch out 2-element array of float TessLevelInner)
 
@@ -411,18 +410,17 @@ triangle order = cw
 0:?     '@entryPointOutput' (layout( location=0) out 3-element array of structure{ temp 3-component vector of float val})
 0:?     'i' (layout( location=0) in 3-element array of structure{ temp 3-component vector of float val})
 0:?     'cpid' ( in uint InvocationID)
-0:?     '@patchConstantOutput' (layout( location=1) patch out structure{})
 0:?     '@patchConstantOutput_tfactor' ( patch out 4-element array of float TessLevelOuter)
 0:?     '@patchConstantOutput_flInFactor' ( patch out 2-element array of float TessLevelInner)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 129
+// Id's are bound by 126
 
                               Capability Tessellation
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint TessellationControl 4  "main" 42 46 49 96 110 128
+                              EntryPoint TessellationControl 4  "main" 42 46 49 96 110
                               ExecutionMode 4 OutputVertices 3
                               ExecutionMode 4 Triangles
                               ExecutionMode 4 SpacingFractionalOdd
@@ -464,8 +462,6 @@ triangle order = cw
                               Name 96  "@patchConstantOutput_tfactor"
                               Name 110  "@patchConstantOutput_flInFactor"
                               Name 114  "o"
-                              Name 126  "hs_pcf_t"
-                              Name 128  "@patchConstantOutput"
                               Decorate 42(i) Location 0
                               Decorate 46(cpid) BuiltIn InvocationId
                               Decorate 49(@entryPointOutput) Location 0
@@ -473,8 +469,6 @@ triangle order = cw
                               Decorate 96(@patchConstantOutput_tfactor) BuiltIn TessLevelOuter
                               Decorate 110(@patchConstantOutput_flInFactor) Patch
                               Decorate 110(@patchConstantOutput_flInFactor) BuiltIn TessLevelInner
-                              Decorate 128(@patchConstantOutput) Patch
-                              Decorate 128(@patchConstantOutput) Location 1
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -520,9 +514,6 @@ triangle order = cw
              109:             TypePointer Output 108
 110(@patchConstantOutput_flInFactor):    109(ptr) Variable Output
              121:    6(float) Constant 1082130432
-   126(hs_pcf_t):             TypeStruct
-             127:             TypePointer Output 126(hs_pcf_t)
-128(@patchConstantOutput):    127(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
            40(i):     12(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.load.basic.dx10.vert.out b/Test/baseResults/hlsl.load.basic.dx10.vert.out
index c3b7dc218..99d0652b4 100644
--- a/Test/baseResults/hlsl.load.basic.dx10.vert.out
+++ b/Test/baseResults/hlsl.load.basic.dx10.vert.out
@@ -221,7 +221,6 @@ Shader version: 500
 0:?     'g_tTexcdi4a' ( uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' ( uniform utextureCubeArray)
 0:?     'anon@0' (layout( row_major std140) uniform block{ uniform int c1,  uniform 2-component vector of int c2,  uniform 3-component vector of int c3,  uniform 4-component vector of int c4,  uniform int o1,  uniform 2-component vector of int o2,  uniform 3-component vector of int o3,  uniform 4-component vector of int o4})
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 
 Linked vertex stage:
@@ -449,18 +448,17 @@ Shader version: 500
 0:?     'g_tTexcdi4a' ( uniform itextureCubeArray)
 0:?     'g_tTexcdu4a' ( uniform utextureCubeArray)
 0:?     'anon@0' (layout( row_major std140) uniform block{ uniform int c1,  uniform 2-component vector of int c2,  uniform 3-component vector of int c3,  uniform 4-component vector of int c4,  uniform int o1,  uniform 2-component vector of int o2,  uniform 3-component vector of int o3,  uniform 4-component vector of int o4})
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 174
+// Id's are bound by 171
 
                               Capability Shader
                               Capability Sampled1D
                               Capability SampledCubeArray
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 129 173
+                              EntryPoint Vertex 4  "main" 129
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
@@ -500,8 +498,6 @@ Shader version: 500
                               Name 164  "g_tTexcdf4a"
                               Name 167  "g_tTexcdi4a"
                               Name 170  "g_tTexcdu4a"
-                              Name 171  "VS_OUTPUT"
-                              Name 173  "@entryPointOutput"
                               Decorate 14(g_tTex1df4) DescriptorSet 0
                               Decorate 14(g_tTex1df4) Binding 0
                               MemberDecorate 20($Global) 0 Offset 0
@@ -537,7 +533,6 @@ Shader version: 500
                               Decorate 164(g_tTexcdf4a) DescriptorSet 0
                               Decorate 167(g_tTexcdi4a) DescriptorSet 0
                               Decorate 170(g_tTexcdu4a) DescriptorSet 0
-                              Decorate 173(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -636,9 +631,6 @@ Shader version: 500
              168:             TypeImage 24(int) Cube array sampled format:Unknown
              169:             TypePointer UniformConstant 168
 170(g_tTexcdu4a):    169(ptr) Variable UniformConstant
-  171(VS_OUTPUT):             TypeStruct
-             172:             TypePointer Output 171(VS_OUTPUT)
-173(@entryPointOutput):    172(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
              130:8(VS_OUTPUT) FunctionCall 10(@main()
diff --git a/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out b/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out
index a93cbdffd..4d8a3ca7f 100644
--- a/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out
+++ b/Test/baseResults/hlsl.samplegrad.basic.dx10.vert.out
@@ -242,7 +242,6 @@ Shader version: 500
 0:?     'g_tTexcdf4' ( uniform textureCube)
 0:?     'g_tTexcdi4' ( uniform itextureCube)
 0:?     'g_tTexcdu4' ( uniform utextureCube)
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 
 Linked vertex stage:
@@ -491,17 +490,16 @@ Shader version: 500
 0:?     'g_tTexcdf4' ( uniform textureCube)
 0:?     'g_tTexcdi4' ( uniform itextureCube)
 0:?     'g_tTexcdu4' ( uniform utextureCube)
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 169
+// Id's are bound by 166
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 162 168
+                              EntryPoint Vertex 4  "main" 162
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
@@ -535,8 +533,6 @@ Shader version: 500
                               Name 153  "vsout"
                               Name 162  "@entryPointOutput_Pos"
                               Name 165  "g_tTex1df4a"
-                              Name 166  "VS_OUTPUT"
-                              Name 168  "@entryPointOutput"
                               Decorate 16(g_tTex1df4) DescriptorSet 0
                               Decorate 16(g_tTex1df4) Binding 0
                               Decorate 20(g_sSamp) DescriptorSet 0
@@ -555,7 +551,6 @@ Shader version: 500
                               Decorate 162(@entryPointOutput_Pos) BuiltIn Position
                               Decorate 165(g_tTex1df4a) DescriptorSet 0
                               Decorate 165(g_tTex1df4a) Binding 1
-                              Decorate 168(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -649,9 +644,6 @@ Shader version: 500
              161:             TypePointer Output 7(fvec4)
 162(@entryPointOutput_Pos):    161(ptr) Variable Output
 165(g_tTex1df4a):     15(ptr) Variable UniformConstant
-  166(VS_OUTPUT):             TypeStruct
-             167:             TypePointer Output 166(VS_OUTPUT)
-168(@entryPointOutput):    167(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
              163:8(VS_OUTPUT) FunctionCall 10(@main()
diff --git a/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out b/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out
index 5b2f95029..0e430c0f8 100644
--- a/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out
+++ b/Test/baseResults/hlsl.samplelevel.basic.dx10.vert.out
@@ -188,7 +188,6 @@ Shader version: 500
 0:?     'g_tTexcdf4' ( uniform textureCube)
 0:?     'g_tTexcdi4' ( uniform itextureCube)
 0:?     'g_tTexcdu4' ( uniform utextureCube)
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 
 Linked vertex stage:
@@ -383,17 +382,16 @@ Shader version: 500
 0:?     'g_tTexcdf4' ( uniform textureCube)
 0:?     'g_tTexcdi4' ( uniform itextureCube)
 0:?     'g_tTexcdu4' ( uniform utextureCube)
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 165
+// Id's are bound by 162
 
                               Capability Shader
                               Capability Sampled1D
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 158 164
+                              EntryPoint Vertex 4  "main" 158
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_OUTPUT"
@@ -427,8 +425,6 @@ Shader version: 500
                               Name 149  "vsout"
                               Name 158  "@entryPointOutput_Pos"
                               Name 161  "g_tTex1df4a"
-                              Name 162  "VS_OUTPUT"
-                              Name 164  "@entryPointOutput"
                               Decorate 16(g_tTex1df4) DescriptorSet 0
                               Decorate 16(g_tTex1df4) Binding 0
                               Decorate 20(g_sSamp) DescriptorSet 0
@@ -447,7 +443,6 @@ Shader version: 500
                               Decorate 158(@entryPointOutput_Pos) BuiltIn Position
                               Decorate 161(g_tTex1df4a) DescriptorSet 0
                               Decorate 161(g_tTex1df4a) Binding 1
-                              Decorate 164(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -537,9 +532,6 @@ Shader version: 500
              157:             TypePointer Output 7(fvec4)
 158(@entryPointOutput_Pos):    157(ptr) Variable Output
 161(g_tTex1df4a):     15(ptr) Variable UniformConstant
-  162(VS_OUTPUT):             TypeStruct
-             163:             TypePointer Output 162(VS_OUTPUT)
-164(@entryPointOutput):    163(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
              159:8(VS_OUTPUT) FunctionCall 10(@main()
diff --git a/Test/baseResults/hlsl.struct.split.trivial.geom.out b/Test/baseResults/hlsl.struct.split.trivial.geom.out
index c552675b8..a8eb4465f 100644
--- a/Test/baseResults/hlsl.struct.split.trivial.geom.out
+++ b/Test/baseResults/hlsl.struct.split.trivial.geom.out
@@ -90,8 +90,6 @@ output primitive = triangle_strip
 0:?         'i' ( temp 3-element array of structure{ temp 4-component vector of float pos})
 0:?         'ts' ( temp structure{ temp 4-component vector of float pos})
 0:?   Linker Objects
-0:?     'i' (layout( location=0) in 3-element array of structure{})
-0:?     'ts' (layout( location=0) out structure{})
 
 
 Linked geometry stage:
@@ -188,17 +186,15 @@ output primitive = triangle_strip
 0:?         'i' ( temp 3-element array of structure{ temp 4-component vector of float pos})
 0:?         'ts' ( temp structure{ temp 4-component vector of float pos})
 0:?   Linker Objects
-0:?     'i' (layout( location=0) in 3-element array of structure{})
-0:?     'ts' (layout( location=0) out structure{})
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 74
+// Id's are bound by 67
 
                               Capability Geometry
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Geometry 4  "main" 40 49 70 73
+                              EntryPoint Geometry 4  "main" 40 49
                               ExecutionMode 4 Triangles
                               ExecutionMode 4 Invocations 1
                               ExecutionMode 4 OutputTriangleStrip
@@ -220,14 +216,8 @@ output primitive = triangle_strip
                               Name 61  "ts"
                               Name 62  "param"
                               Name 64  "param"
-                              Name 67  "PS_IN"
-                              Name 70  "i"
-                              Name 71  "GS_OUT"
-                              Name 73  "ts"
                               Decorate 40(ts_pos) BuiltIn Position
                               Decorate 49(i_pos) BuiltIn Position
-                              Decorate 70(i) Location 0
-                              Decorate 73(ts) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -254,13 +244,6 @@ output primitive = triangle_strip
        49(i_pos):     48(ptr) Variable Input
               50:             TypePointer Input 7(fvec4)
               57:     20(int) Constant 2
-       67(PS_IN):             TypeStruct
-              68:             TypeArray 67(PS_IN) 10
-              69:             TypePointer Input 68
-           70(i):     69(ptr) Variable Input
-      71(GS_OUT):             TypeStruct
-              72:             TypePointer Output 71(GS_OUT)
-          73(ts):     72(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
            46(i):     12(ptr) Variable Function
diff --git a/Test/baseResults/hlsl.struct.split.trivial.vert.out b/Test/baseResults/hlsl.struct.split.trivial.vert.out
index 05dcb2691..fbff6b901 100644
--- a/Test/baseResults/hlsl.struct.split.trivial.vert.out
+++ b/Test/baseResults/hlsl.struct.split.trivial.vert.out
@@ -42,7 +42,6 @@ Shader version: 500
 0:16            Constant:
 0:16              0 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     'Pos_in' (layout( location=0) in 4-component vector of float)
 0:?     'Pos_loose' (layout( location=1) in 4-component vector of float)
 
@@ -93,18 +92,17 @@ Shader version: 500
 0:16            Constant:
 0:16              0 (const int)
 0:?   Linker Objects
-0:?     '@entryPointOutput' (layout( location=0) out structure{})
 0:?     'Pos_in' (layout( location=0) in 4-component vector of float)
 0:?     'Pos_loose' (layout( location=1) in 4-component vector of float)
 
 // Module Version 10000
 // Generated by (magic number): 80001
-// Id's are bound by 48
+// Id's are bound by 45
 
                               Capability Shader
                1:             ExtInstImport  "GLSL.std.450"
                               MemoryModel Logical GLSL450
-                              EntryPoint Vertex 4  "main" 31 35 38 47
+                              EntryPoint Vertex 4  "main" 31 35 38
                               Source HLSL 500
                               Name 4  "main"
                               Name 8  "VS_INPUT"
@@ -122,12 +120,9 @@ Shader version: 500
                               Name 38  "@entryPointOutput_Pos"
                               Name 39  "param"
                               Name 41  "param"
-                              Name 45  "VS_OUTPUT"
-                              Name 47  "@entryPointOutput"
                               Decorate 31(Pos_in) Location 0
                               Decorate 35(Pos_loose) Location 1
                               Decorate 38(@entryPointOutput_Pos) BuiltIn Position
-                              Decorate 47(@entryPointOutput) Location 0
                2:             TypeVoid
                3:             TypeFunction 2
                6:             TypeFloat 32
@@ -145,9 +140,6 @@ Shader version: 500
    35(Pos_loose):     30(ptr) Variable Input
               37:             TypePointer Output 7(fvec4)
 38(@entryPointOutput_Pos):     37(ptr) Variable Output
-   45(VS_OUTPUT):             TypeStruct
-              46:             TypePointer Output 45(VS_OUTPUT)
-47(@entryPointOutput):     46(ptr) Variable Output
          4(main):           2 Function None 3
                5:             Label
         29(vsin):      9(ptr) Variable Function
diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp
index 968248edd..e684fd114 100755
--- a/hlsl/hlslParseHelper.cpp
+++ b/hlsl/hlslParseHelper.cpp
@@ -1459,26 +1459,28 @@ void HlslParseContext::assignToInterface(TVariable& variable)
 {
     const auto assignLocation = [&](TVariable& variable) {
         TType& type = variable.getWritableType();
-        TQualifier& qualifier = type.getQualifier();
-        if (qualifier.storage == EvqVaryingIn || qualifier.storage == EvqVaryingOut) {
-            if (qualifier.builtIn == EbvNone && !qualifier.hasLocation()) {
-                // Strip off the outer array dimension for those having an extra one.
-                int size;
-                if (type.isArray() && qualifier.isArrayedIo(language)) {
-                    TType elementType(type, 0);
-                    size = intermediate.computeTypeLocationSize(elementType);
-                } else
-                    size = intermediate.computeTypeLocationSize(type);
+        if (!type.isStruct() || type.getStruct()->size() > 0) {
+            TQualifier& qualifier = type.getQualifier();
+            if (qualifier.storage == EvqVaryingIn || qualifier.storage == EvqVaryingOut) {
+                if (qualifier.builtIn == EbvNone && !qualifier.hasLocation()) {
+                    // Strip off the outer array dimension for those having an extra one.
+                    int size;
+                    if (type.isArray() && qualifier.isArrayedIo(language)) {
+                        TType elementType(type, 0);
+                        size = intermediate.computeTypeLocationSize(elementType);
+                    } else
+                        size = intermediate.computeTypeLocationSize(type);
 
-                if (qualifier.storage == EvqVaryingIn) {
-                    variable.getWritableType().getQualifier().layoutLocation = nextInLocation;
-                    nextInLocation += size;
-                } else {
-                    variable.getWritableType().getQualifier().layoutLocation = nextOutLocation;
-                    nextOutLocation += size;
+                    if (qualifier.storage == EvqVaryingIn) {
+                        variable.getWritableType().getQualifier().layoutLocation = nextInLocation;
+                        nextInLocation += size;
+                    } else {
+                        variable.getWritableType().getQualifier().layoutLocation = nextOutLocation;
+                        nextOutLocation += size;
+                    }
                 }
+                trackLinkage(variable);
             }
-            trackLinkage(variable);
         }
     };
 
@@ -1868,7 +1870,7 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
         return language == EShLangTessEvaluation &&
         type.contains([](const TType* t) {
                 return t->getQualifier().builtIn == EbvTessLevelOuter ||
-                t->getQualifier().builtIn == EbvTessLevelInner;
+                       t->getQualifier().builtIn == EbvTessLevelInner;
             });
     };
 
-- 
GitLab