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

@@ -139,10 +139,20 @@ gl_FragCoord origin is upper left
0:73 1 (const int)
0:73 Constant:
0:73 1.000000
0:75 Sequence
0:75 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:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:75 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:75 Color: direct index for structure (temp 4-component vector of float)
0:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Constant:
0:75 0 (const int)
0:75 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:75 Depth: direct index for structure (temp float FragDepth)
0:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Constant:
0:75 1 (const int)
0:75 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -322,10 +332,20 @@ gl_FragCoord origin is upper left
0:73 1 (const int)
0:73 Constant:
0:73 1.000000
0:75 Sequence
0:75 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:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:75 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:75 Color: direct index for structure (temp 4-component vector of float)
0:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Constant:
0:75 0 (const int)
0:75 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:75 Depth: direct index for structure (temp float FragDepth)
0:75 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:75 Constant:
0:75 1 (const int)
0:75 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -363,14 +383,14 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 169
// Id's are bound by 170
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 118 166 168
EntryPoint Fragment 4 "main" 118 122
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "g_tTex1df4"
@@ -389,27 +409,26 @@ gl_FragCoord origin is upper left
MemberName 106(PS_OUTPUT) 0 "Color"
MemberName 106(PS_OUTPUT) 1 "Depth"
Name 108 "psout"
Name 118 "@entryPointOutput"
Name 123 "g_sSamp"
Name 126 "g_tTexcdf4"
Name 129 "g_tTexcdi4"
Name 132 "g_tTexcdu4"
Name 135 "g_tTex1df4a"
Name 138 "g_tTex1di4a"
Name 141 "g_tTex1du4a"
Name 144 "g_tTex2df4a"
Name 147 "g_tTex2di4a"
Name 150 "g_tTex2du4a"
Name 153 "g_tTexcdf4a"
Name 156 "g_tTexcdi4a"
Name 159 "g_tTexcdu4a"
Name 160 "c1"
Name 161 "o1"
Name 162 "o2"
Name 163 "o3"
Name 164 "o4"
Name 166 "Color"
Name 168 "Depth"
Name 118 "Color"
Name 122 "Depth"
Name 128 "g_sSamp"
Name 131 "g_tTexcdf4"
Name 134 "g_tTexcdi4"
Name 137 "g_tTexcdu4"
Name 140 "g_tTex1df4a"
Name 143 "g_tTex1di4a"
Name 146 "g_tTex1du4a"
Name 149 "g_tTex2df4a"
Name 152 "g_tTex2di4a"
Name 155 "g_tTex2du4a"
Name 158 "g_tTexcdf4a"
Name 161 "g_tTexcdi4a"
Name 164 "g_tTexcdu4a"
Name 165 "c1"
Name 166 "o1"
Name 167 "o2"
Name 168 "o3"
Name 169 "o4"
Decorate 9(g_tTex1df4) DescriptorSet 0
Decorate 9(g_tTex1df4) Binding 0
Decorate 27(g_tTex1di4) DescriptorSet 0
@@ -421,22 +440,22 @@ gl_FragCoord origin is upper left
Decorate 90(g_tTex3di4) DescriptorSet 0
Decorate 99(g_tTex3du4) DescriptorSet 0
MemberDecorate 106(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 123(g_sSamp) DescriptorSet 0
Decorate 123(g_sSamp) Binding 0
Decorate 126(g_tTexcdf4) DescriptorSet 0
Decorate 129(g_tTexcdi4) DescriptorSet 0
Decorate 132(g_tTexcdu4) DescriptorSet 0
Decorate 135(g_tTex1df4a) DescriptorSet 0
Decorate 138(g_tTex1di4a) DescriptorSet 0
Decorate 141(g_tTex1du4a) DescriptorSet 0
Decorate 144(g_tTex2df4a) DescriptorSet 0
Decorate 147(g_tTex2di4a) DescriptorSet 0
Decorate 150(g_tTex2du4a) DescriptorSet 0
Decorate 153(g_tTexcdf4a) DescriptorSet 0
Decorate 156(g_tTexcdi4a) DescriptorSet 0
Decorate 159(g_tTexcdu4a) DescriptorSet 0
Decorate 166(Color) Location 0
Decorate 168(Depth) BuiltIn FragDepth
Decorate 118(Color) Location 0
Decorate 122(Depth) BuiltIn FragDepth
Decorate 128(g_sSamp) DescriptorSet 0
Decorate 128(g_sSamp) Binding 0
Decorate 131(g_tTexcdf4) DescriptorSet 0
Decorate 134(g_tTexcdi4) DescriptorSet 0
Decorate 137(g_tTexcdu4) DescriptorSet 0
Decorate 140(g_tTex1df4a) DescriptorSet 0
Decorate 143(g_tTex1di4a) DescriptorSet 0
Decorate 146(g_tTex1du4a) DescriptorSet 0
Decorate 149(g_tTex2df4a) DescriptorSet 0
Decorate 152(g_tTex2di4a) DescriptorSet 0
Decorate 155(g_tTex2du4a) DescriptorSet 0
Decorate 158(g_tTexcdf4a) DescriptorSet 0
Decorate 161(g_tTexcdi4a) DescriptorSet 0
Decorate 164(g_tTexcdu4a) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -493,56 +512,54 @@ gl_FragCoord origin is upper left
112: TypePointer Function 23(fvec4)
114: 11(int) Constant 1
115: TypePointer Function 6(float)
117: TypePointer Output 106(PS_OUTPUT)
118(@entryPointOutput): 117(ptr) Variable Output
121: TypeSampler
122: TypePointer UniformConstant 121
123(g_sSamp): 122(ptr) Variable UniformConstant
124: TypeImage 6(float) Cube sampled format:Unknown
125: TypePointer UniformConstant 124
126(g_tTexcdf4): 125(ptr) Variable UniformConstant
127: TypeImage 11(int) Cube sampled format:Unknown
128: TypePointer UniformConstant 127
129(g_tTexcdi4): 128(ptr) Variable UniformConstant
130: TypeImage 15(int) Cube sampled format:Unknown
131: TypePointer UniformConstant 130
132(g_tTexcdu4): 131(ptr) Variable UniformConstant
133: TypeImage 6(float) 1D array sampled format:Unknown
134: TypePointer UniformConstant 133
135(g_tTex1df4a): 134(ptr) Variable UniformConstant
136: TypeImage 11(int) 1D array sampled format:Unknown
137: TypePointer UniformConstant 136
138(g_tTex1di4a): 137(ptr) Variable UniformConstant
139: TypeImage 15(int) 1D array sampled format:Unknown
140: TypePointer UniformConstant 139
141(g_tTex1du4a): 140(ptr) Variable UniformConstant
142: TypeImage 6(float) 2D array sampled format:Unknown
143: TypePointer UniformConstant 142
144(g_tTex2df4a): 143(ptr) Variable UniformConstant
145: TypeImage 11(int) 2D array sampled format:Unknown
146: TypePointer UniformConstant 145
147(g_tTex2di4a): 146(ptr) Variable UniformConstant
148: TypeImage 15(int) 2D array sampled format:Unknown
149: TypePointer UniformConstant 148
150(g_tTex2du4a): 149(ptr) Variable UniformConstant
151: TypeImage 6(float) Cube array sampled format:Unknown
152: TypePointer UniformConstant 151
153(g_tTexcdf4a): 152(ptr) Variable UniformConstant
154: TypeImage 11(int) Cube array sampled format:Unknown
155: TypePointer UniformConstant 154
156(g_tTexcdi4a): 155(ptr) Variable UniformConstant
157: TypeImage 15(int) Cube array sampled format:Unknown
158: TypePointer UniformConstant 157
159(g_tTexcdu4a): 158(ptr) Variable UniformConstant
160(c1): 17(ptr) Variable UniformConstant
161(o1): 17(ptr) Variable UniformConstant
162(o2): 13(ptr) Variable UniformConstant
163(o3): 50(ptr) Variable UniformConstant
164(o4): 80(ptr) Variable UniformConstant
165: TypePointer Output 23(fvec4)
166(Color): 165(ptr) Variable Output
167: TypePointer Output 6(float)
168(Depth): 167(ptr) Variable Output
117: TypePointer Output 23(fvec4)
118(Color): 117(ptr) Variable Output
121: TypePointer Output 6(float)
122(Depth): 121(ptr) Variable Output
126: TypeSampler
127: TypePointer UniformConstant 126
128(g_sSamp): 127(ptr) Variable UniformConstant
129: TypeImage 6(float) Cube sampled format:Unknown
130: TypePointer UniformConstant 129
131(g_tTexcdf4): 130(ptr) Variable UniformConstant
132: TypeImage 11(int) Cube sampled format:Unknown
133: TypePointer UniformConstant 132
134(g_tTexcdi4): 133(ptr) Variable UniformConstant
135: TypeImage 15(int) Cube sampled format:Unknown
136: TypePointer UniformConstant 135
137(g_tTexcdu4): 136(ptr) Variable UniformConstant
138: TypeImage 6(float) 1D array sampled format:Unknown
139: TypePointer UniformConstant 138
140(g_tTex1df4a): 139(ptr) Variable UniformConstant
141: TypeImage 11(int) 1D array sampled format:Unknown
142: TypePointer UniformConstant 141
143(g_tTex1di4a): 142(ptr) Variable UniformConstant
144: TypeImage 15(int) 1D array sampled format:Unknown
145: TypePointer UniformConstant 144
146(g_tTex1du4a): 145(ptr) Variable UniformConstant
147: TypeImage 6(float) 2D array sampled format:Unknown
148: TypePointer UniformConstant 147
149(g_tTex2df4a): 148(ptr) Variable UniformConstant
150: TypeImage 11(int) 2D array sampled format:Unknown
151: TypePointer UniformConstant 150
152(g_tTex2di4a): 151(ptr) Variable UniformConstant
153: TypeImage 15(int) 2D array sampled format:Unknown
154: TypePointer UniformConstant 153
155(g_tTex2du4a): 154(ptr) Variable UniformConstant
156: TypeImage 6(float) Cube array sampled format:Unknown
157: TypePointer UniformConstant 156
158(g_tTexcdf4a): 157(ptr) Variable UniformConstant
159: TypeImage 11(int) Cube array sampled format:Unknown
160: TypePointer UniformConstant 159
161(g_tTexcdi4a): 160(ptr) Variable UniformConstant
162: TypeImage 15(int) Cube array sampled format:Unknown
163: TypePointer UniformConstant 162
164(g_tTexcdu4a): 163(ptr) Variable UniformConstant
165(c1): 17(ptr) Variable UniformConstant
166(o1): 17(ptr) Variable UniformConstant
167(o2): 13(ptr) Variable UniformConstant
168(o3): 50(ptr) Variable UniformConstant
169(o4): 80(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
108(psout): 107(ptr) Variable Function
@@ -604,7 +621,11 @@ gl_FragCoord origin is upper left
Store 113 111
116: 115(ptr) AccessChain 108(psout) 114
Store 116 110
119:106(PS_OUTPUT) Load 108(psout)
Store 118(@entryPointOutput) 119
119: 112(ptr) AccessChain 108(psout) 109
120: 23(fvec4) Load 119
Store 118(Color) 120
123: 115(ptr) AccessChain 108(psout) 114
124: 6(float) Load 123
Store 122(Depth) 124
Return
FunctionEnd