HLSL: Flatten whole-struct assigns and returns when targeting flattened I/O structs.

This commit is contained in:
John Kessenich
2016-09-16 03:05:12 -06:00
parent f8e494c18c
commit d21baed6bc
67 changed files with 4024 additions and 2886 deletions

View File

@@ -106,10 +106,20 @@ gl_FragCoord origin is upper left
0:68 1 (const int)
0:68 Constant:
0:68 1.000000
0:70 Sequence
0:70 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:70 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:70 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:70 Color: direct index for structure (temp 4-component vector of float)
0:70 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:70 Constant:
0:70 0 (const int)
0:70 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:70 Depth: direct index for structure (temp float FragDepth)
0:70 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:70 Constant:
0:70 1 (const int)
0:70 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -256,10 +266,20 @@ gl_FragCoord origin is upper left
0:68 1 (const int)
0:68 Constant:
0:68 1.000000
0:70 Sequence
0:70 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:70 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:70 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:70 Color: direct index for structure (temp 4-component vector of float)
0:70 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:70 Constant:
0:70 0 (const int)
0:70 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:70 Depth: direct index for structure (temp float FragDepth)
0:70 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:70 Constant:
0:70 1 (const int)
0:70 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -297,14 +317,14 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 149
// Id's are bound by 150
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 87 146 148
EntryPoint Fragment 4 "main" 87 91
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "g_tTex1df4a"
@@ -319,31 +339,30 @@ gl_FragCoord origin is upper left
MemberName 75(PS_OUTPUT) 0 "Color"
MemberName 75(PS_OUTPUT) 1 "Depth"
Name 77 "psout"
Name 87 "@entryPointOutput"
Name 92 "g_sSamp"
Name 95 "g_tTex1df4"
Name 98 "g_tTex1di4"
Name 101 "g_tTex1du4"
Name 104 "g_tTex2df4"
Name 107 "g_tTex2di4"
Name 110 "g_tTex2du4"
Name 113 "g_tTex3df4"
Name 116 "g_tTex3di4"
Name 119 "g_tTex3du4"
Name 122 "g_tTexcdf4"
Name 125 "g_tTexcdi4"
Name 128 "g_tTexcdu4"
Name 131 "g_tTexcdf4a"
Name 134 "g_tTexcdi4a"
Name 137 "g_tTexcdu4a"
Name 138 "c1"
Name 140 "c2"
Name 141 "o1"
Name 142 "o2"
Name 143 "o3"
Name 144 "o4"
Name 146 "Color"
Name 148 "Depth"
Name 87 "Color"
Name 91 "Depth"
Name 97 "g_sSamp"
Name 100 "g_tTex1df4"
Name 103 "g_tTex1di4"
Name 106 "g_tTex1du4"
Name 109 "g_tTex2df4"
Name 112 "g_tTex2di4"
Name 115 "g_tTex2du4"
Name 118 "g_tTex3df4"
Name 121 "g_tTex3di4"
Name 124 "g_tTex3du4"
Name 127 "g_tTexcdf4"
Name 130 "g_tTexcdi4"
Name 133 "g_tTexcdu4"
Name 136 "g_tTexcdf4a"
Name 139 "g_tTexcdi4a"
Name 142 "g_tTexcdu4a"
Name 143 "c1"
Name 145 "c2"
Name 146 "o1"
Name 147 "o2"
Name 148 "o3"
Name 149 "o4"
Decorate 9(g_tTex1df4a) DescriptorSet 0
Decorate 27(g_tTex1di4a) DescriptorSet 0
Decorate 37(g_tTex1du4a) DescriptorSet 0
@@ -351,26 +370,26 @@ gl_FragCoord origin is upper left
Decorate 59(g_tTex2di4a) DescriptorSet 0
Decorate 68(g_tTex2du4a) DescriptorSet 0
MemberDecorate 75(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 92(g_sSamp) DescriptorSet 0
Decorate 92(g_sSamp) Binding 0
Decorate 95(g_tTex1df4) DescriptorSet 0
Decorate 95(g_tTex1df4) Binding 0
Decorate 98(g_tTex1di4) DescriptorSet 0
Decorate 101(g_tTex1du4) DescriptorSet 0
Decorate 104(g_tTex2df4) DescriptorSet 0
Decorate 107(g_tTex2di4) DescriptorSet 0
Decorate 110(g_tTex2du4) DescriptorSet 0
Decorate 113(g_tTex3df4) DescriptorSet 0
Decorate 116(g_tTex3di4) DescriptorSet 0
Decorate 119(g_tTex3du4) DescriptorSet 0
Decorate 122(g_tTexcdf4) DescriptorSet 0
Decorate 125(g_tTexcdi4) DescriptorSet 0
Decorate 128(g_tTexcdu4) DescriptorSet 0
Decorate 131(g_tTexcdf4a) DescriptorSet 0
Decorate 134(g_tTexcdi4a) DescriptorSet 0
Decorate 137(g_tTexcdu4a) DescriptorSet 0
Decorate 146(Color) Location 0
Decorate 148(Depth) BuiltIn FragDepth
Decorate 87(Color) Location 0
Decorate 91(Depth) BuiltIn FragDepth
Decorate 97(g_sSamp) DescriptorSet 0
Decorate 97(g_sSamp) Binding 0
Decorate 100(g_tTex1df4) DescriptorSet 0
Decorate 100(g_tTex1df4) Binding 0
Decorate 103(g_tTex1di4) DescriptorSet 0
Decorate 106(g_tTex1du4) DescriptorSet 0
Decorate 109(g_tTex2df4) DescriptorSet 0
Decorate 112(g_tTex2di4) DescriptorSet 0
Decorate 115(g_tTex2du4) DescriptorSet 0
Decorate 118(g_tTex3df4) DescriptorSet 0
Decorate 121(g_tTex3di4) DescriptorSet 0
Decorate 124(g_tTex3du4) DescriptorSet 0
Decorate 127(g_tTexcdf4) DescriptorSet 0
Decorate 130(g_tTexcdi4) DescriptorSet 0
Decorate 133(g_tTexcdu4) DescriptorSet 0
Decorate 136(g_tTexcdf4a) DescriptorSet 0
Decorate 139(g_tTexcdi4a) DescriptorSet 0
Decorate 142(g_tTexcdu4a) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -414,67 +433,65 @@ gl_FragCoord origin is upper left
81: TypePointer Function 23(fvec4)
83: 11(int) Constant 1
84: TypePointer Function 6(float)
86: TypePointer Output 75(PS_OUTPUT)
87(@entryPointOutput): 86(ptr) Variable Output
90: TypeSampler
91: TypePointer UniformConstant 90
92(g_sSamp): 91(ptr) Variable UniformConstant
93: TypeImage 6(float) 1D sampled format:Unknown
94: TypePointer UniformConstant 93
95(g_tTex1df4): 94(ptr) Variable UniformConstant
96: TypeImage 11(int) 1D sampled format:Unknown
97: TypePointer UniformConstant 96
98(g_tTex1di4): 97(ptr) Variable UniformConstant
99: TypeImage 18(int) 1D sampled format:Unknown
100: TypePointer UniformConstant 99
101(g_tTex1du4): 100(ptr) Variable UniformConstant
102: TypeImage 6(float) 2D sampled format:Unknown
103: TypePointer UniformConstant 102
104(g_tTex2df4): 103(ptr) Variable UniformConstant
105: TypeImage 11(int) 2D sampled format:Unknown
106: TypePointer UniformConstant 105
107(g_tTex2di4): 106(ptr) Variable UniformConstant
108: TypeImage 18(int) 2D sampled format:Unknown
109: TypePointer UniformConstant 108
110(g_tTex2du4): 109(ptr) Variable UniformConstant
111: TypeImage 6(float) 3D sampled format:Unknown
112: TypePointer UniformConstant 111
113(g_tTex3df4): 112(ptr) Variable UniformConstant
114: TypeImage 11(int) 3D sampled format:Unknown
115: TypePointer UniformConstant 114
116(g_tTex3di4): 115(ptr) Variable UniformConstant
117: TypeImage 18(int) 3D sampled format:Unknown
118: TypePointer UniformConstant 117
119(g_tTex3du4): 118(ptr) Variable UniformConstant
120: TypeImage 6(float) Cube sampled format:Unknown
121: TypePointer UniformConstant 120
122(g_tTexcdf4): 121(ptr) Variable UniformConstant
123: TypeImage 11(int) Cube sampled format:Unknown
124: TypePointer UniformConstant 123
125(g_tTexcdi4): 124(ptr) Variable UniformConstant
126: TypeImage 18(int) Cube sampled format:Unknown
127: TypePointer UniformConstant 126
128(g_tTexcdu4): 127(ptr) Variable UniformConstant
129: TypeImage 6(float) Cube array sampled format:Unknown
130: TypePointer UniformConstant 129
131(g_tTexcdf4a): 130(ptr) Variable UniformConstant
132: TypeImage 11(int) Cube array sampled format:Unknown
133: TypePointer UniformConstant 132
134(g_tTexcdi4a): 133(ptr) Variable UniformConstant
135: TypeImage 18(int) Cube array sampled format:Unknown
136: TypePointer UniformConstant 135
137(g_tTexcdu4a): 136(ptr) Variable UniformConstant
138(c1): 20(ptr) Variable UniformConstant
139: TypePointer UniformConstant 15(ivec2)
140(c2): 139(ptr) Variable UniformConstant
141(o1): 20(ptr) Variable UniformConstant
142(o2): 139(ptr) Variable UniformConstant
143(o3): 13(ptr) Variable UniformConstant
144(o4): 49(ptr) Variable UniformConstant
145: TypePointer Output 23(fvec4)
146(Color): 145(ptr) Variable Output
147: TypePointer Output 6(float)
148(Depth): 147(ptr) Variable Output
86: TypePointer Output 23(fvec4)
87(Color): 86(ptr) Variable Output
90: TypePointer Output 6(float)
91(Depth): 90(ptr) Variable Output
95: TypeSampler
96: TypePointer UniformConstant 95
97(g_sSamp): 96(ptr) Variable UniformConstant
98: TypeImage 6(float) 1D sampled format:Unknown
99: TypePointer UniformConstant 98
100(g_tTex1df4): 99(ptr) Variable UniformConstant
101: TypeImage 11(int) 1D sampled format:Unknown
102: TypePointer UniformConstant 101
103(g_tTex1di4): 102(ptr) Variable UniformConstant
104: TypeImage 18(int) 1D sampled format:Unknown
105: TypePointer UniformConstant 104
106(g_tTex1du4): 105(ptr) Variable UniformConstant
107: TypeImage 6(float) 2D sampled format:Unknown
108: TypePointer UniformConstant 107
109(g_tTex2df4): 108(ptr) Variable UniformConstant
110: TypeImage 11(int) 2D sampled format:Unknown
111: TypePointer UniformConstant 110
112(g_tTex2di4): 111(ptr) Variable UniformConstant
113: TypeImage 18(int) 2D sampled format:Unknown
114: TypePointer UniformConstant 113
115(g_tTex2du4): 114(ptr) Variable UniformConstant
116: TypeImage 6(float) 3D sampled format:Unknown
117: TypePointer UniformConstant 116
118(g_tTex3df4): 117(ptr) Variable UniformConstant
119: TypeImage 11(int) 3D sampled format:Unknown
120: TypePointer UniformConstant 119
121(g_tTex3di4): 120(ptr) Variable UniformConstant
122: TypeImage 18(int) 3D sampled format:Unknown
123: TypePointer UniformConstant 122
124(g_tTex3du4): 123(ptr) Variable UniformConstant
125: TypeImage 6(float) Cube sampled format:Unknown
126: TypePointer UniformConstant 125
127(g_tTexcdf4): 126(ptr) Variable UniformConstant
128: TypeImage 11(int) Cube sampled format:Unknown
129: TypePointer UniformConstant 128
130(g_tTexcdi4): 129(ptr) Variable UniformConstant
131: TypeImage 18(int) Cube sampled format:Unknown
132: TypePointer UniformConstant 131
133(g_tTexcdu4): 132(ptr) Variable UniformConstant
134: TypeImage 6(float) Cube array sampled format:Unknown
135: TypePointer UniformConstant 134
136(g_tTexcdf4a): 135(ptr) Variable UniformConstant
137: TypeImage 11(int) Cube array sampled format:Unknown
138: TypePointer UniformConstant 137
139(g_tTexcdi4a): 138(ptr) Variable UniformConstant
140: TypeImage 18(int) Cube array sampled format:Unknown
141: TypePointer UniformConstant 140
142(g_tTexcdu4a): 141(ptr) Variable UniformConstant
143(c1): 20(ptr) Variable UniformConstant
144: TypePointer UniformConstant 15(ivec2)
145(c2): 144(ptr) Variable UniformConstant
146(o1): 20(ptr) Variable UniformConstant
147(o2): 144(ptr) Variable UniformConstant
148(o3): 13(ptr) Variable UniformConstant
149(o4): 49(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
77(psout): 76(ptr) Variable Function
@@ -518,7 +535,11 @@ gl_FragCoord origin is upper left
Store 82 80
85: 84(ptr) AccessChain 77(psout) 83
Store 85 79
88:75(PS_OUTPUT) Load 77(psout)
Store 87(@entryPointOutput) 88
88: 81(ptr) AccessChain 77(psout) 78
89: 23(fvec4) Load 88
Store 87(Color) 89
92: 84(ptr) AccessChain 77(psout) 83
93: 6(float) Load 92
Store 91(Depth) 93
Return
FunctionEnd