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

@@ -124,10 +124,20 @@ gl_FragCoord origin is upper left
0:63 1 (const int)
0:63 Constant:
0:63 1.000000
0:65 Sequence
0:65 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:65 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:65 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:65 Color: direct index for structure (temp 4-component vector of float)
0:65 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:65 Constant:
0:65 0 (const int)
0:65 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:65 Depth: direct index for structure (temp float FragDepth)
0:65 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:65 Constant:
0:65 1 (const int)
0:65 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -284,10 +294,20 @@ gl_FragCoord origin is upper left
0:63 1 (const int)
0:63 Constant:
0:63 1.000000
0:65 Sequence
0:65 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:65 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:65 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:65 Color: direct index for structure (temp 4-component vector of float)
0:65 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:65 Constant:
0:65 0 (const int)
0:65 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:65 Depth: direct index for structure (temp float FragDepth)
0:65 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:65 Constant:
0:65 1 (const int)
0:65 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -317,14 +337,14 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 156
// Id's are bound by 157
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 104 153 155
EntryPoint Fragment 4 "main" 104 108
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "r01"
@@ -344,24 +364,23 @@ gl_FragCoord origin is upper left
MemberName 93(PS_OUTPUT) 0 "Color"
MemberName 93(PS_OUTPUT) 1 "Depth"
Name 95 "psout"
Name 104 "@entryPointOutput"
Name 109 "g_tTex3df4"
Name 112 "g_tTex3di4"
Name 115 "g_tTex3du4"
Name 118 "g_tTexcdf4"
Name 121 "g_tTexcdi4"
Name 124 "g_tTexcdu4"
Name 127 "g_tTex1df4a"
Name 130 "g_tTex1di4a"
Name 133 "g_tTex1du4a"
Name 136 "g_tTex2df4a"
Name 139 "g_tTex2di4a"
Name 142 "g_tTex2du4a"
Name 145 "g_tTexcdf4a"
Name 148 "g_tTexcdi4a"
Name 151 "g_tTexcdu4a"
Name 153 "Color"
Name 155 "Depth"
Name 104 "Color"
Name 108 "Depth"
Name 114 "g_tTex3df4"
Name 117 "g_tTex3di4"
Name 120 "g_tTex3du4"
Name 123 "g_tTexcdf4"
Name 126 "g_tTexcdi4"
Name 129 "g_tTexcdu4"
Name 132 "g_tTex1df4a"
Name 135 "g_tTex1di4a"
Name 138 "g_tTex1du4a"
Name 141 "g_tTex2df4a"
Name 144 "g_tTex2di4a"
Name 147 "g_tTex2du4a"
Name 150 "g_tTexcdf4a"
Name 153 "g_tTexcdi4a"
Name 156 "g_tTexcdu4a"
Decorate 11(g_tTex1df4) DescriptorSet 0
Decorate 11(g_tTex1df4) Binding 0
Decorate 15(g_sSamp) DescriptorSet 0
@@ -372,23 +391,23 @@ gl_FragCoord origin is upper left
Decorate 71(g_tTex2di4) DescriptorSet 0
Decorate 83(g_tTex2du4) DescriptorSet 0
MemberDecorate 93(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 109(g_tTex3df4) DescriptorSet 0
Decorate 112(g_tTex3di4) DescriptorSet 0
Decorate 115(g_tTex3du4) DescriptorSet 0
Decorate 118(g_tTexcdf4) DescriptorSet 0
Decorate 121(g_tTexcdi4) DescriptorSet 0
Decorate 124(g_tTexcdu4) DescriptorSet 0
Decorate 127(g_tTex1df4a) DescriptorSet 0
Decorate 130(g_tTex1di4a) DescriptorSet 0
Decorate 133(g_tTex1du4a) DescriptorSet 0
Decorate 136(g_tTex2df4a) DescriptorSet 0
Decorate 139(g_tTex2di4a) DescriptorSet 0
Decorate 142(g_tTex2du4a) DescriptorSet 0
Decorate 145(g_tTexcdf4a) DescriptorSet 0
Decorate 148(g_tTexcdi4a) DescriptorSet 0
Decorate 151(g_tTexcdu4a) DescriptorSet 0
Decorate 153(Color) Location 0
Decorate 155(Depth) BuiltIn FragDepth
Decorate 104(Color) Location 0
Decorate 108(Depth) BuiltIn FragDepth
Decorate 114(g_tTex3df4) DescriptorSet 0
Decorate 117(g_tTex3di4) DescriptorSet 0
Decorate 120(g_tTex3du4) DescriptorSet 0
Decorate 123(g_tTexcdf4) DescriptorSet 0
Decorate 126(g_tTexcdi4) DescriptorSet 0
Decorate 129(g_tTexcdu4) DescriptorSet 0
Decorate 132(g_tTex1df4a) DescriptorSet 0
Decorate 135(g_tTex1di4a) DescriptorSet 0
Decorate 138(g_tTex1du4a) DescriptorSet 0
Decorate 141(g_tTex2df4a) DescriptorSet 0
Decorate 144(g_tTex2di4a) DescriptorSet 0
Decorate 147(g_tTex2du4a) DescriptorSet 0
Decorate 150(g_tTexcdf4a) DescriptorSet 0
Decorate 153(g_tTexcdi4a) DescriptorSet 0
Decorate 156(g_tTexcdu4a) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -446,57 +465,55 @@ gl_FragCoord origin is upper left
98: 92(fvec4) ConstantComposite 97 97 97 97
99: TypePointer Function 92(fvec4)
101: 23(int) Constant 1
103: TypePointer Output 93(PS_OUTPUT)
104(@entryPointOutput): 103(ptr) Variable Output
107: TypeImage 6(float) 3D sampled format:Unknown
108: TypePointer UniformConstant 107
109(g_tTex3df4): 108(ptr) Variable UniformConstant
110: TypeImage 23(int) 3D sampled format:Unknown
111: TypePointer UniformConstant 110
112(g_tTex3di4): 111(ptr) Variable UniformConstant
113: TypeImage 39(int) 3D sampled format:Unknown
114: TypePointer UniformConstant 113
115(g_tTex3du4): 114(ptr) Variable UniformConstant
116: TypeImage 6(float) Cube sampled format:Unknown
117: TypePointer UniformConstant 116
118(g_tTexcdf4): 117(ptr) Variable UniformConstant
119: TypeImage 23(int) Cube sampled format:Unknown
120: TypePointer UniformConstant 119
121(g_tTexcdi4): 120(ptr) Variable UniformConstant
122: TypeImage 39(int) Cube sampled format:Unknown
123: TypePointer UniformConstant 122
124(g_tTexcdu4): 123(ptr) Variable UniformConstant
125: TypeImage 6(float) 1D array sampled format:Unknown
126: TypePointer UniformConstant 125
127(g_tTex1df4a): 126(ptr) Variable UniformConstant
128: TypeImage 23(int) 1D array sampled format:Unknown
129: TypePointer UniformConstant 128
130(g_tTex1di4a): 129(ptr) Variable UniformConstant
131: TypeImage 39(int) 1D array sampled format:Unknown
132: TypePointer UniformConstant 131
133(g_tTex1du4a): 132(ptr) Variable UniformConstant
134: TypeImage 6(float) 2D array sampled format:Unknown
135: TypePointer UniformConstant 134
136(g_tTex2df4a): 135(ptr) Variable UniformConstant
137: TypeImage 23(int) 2D array sampled format:Unknown
138: TypePointer UniformConstant 137
139(g_tTex2di4a): 138(ptr) Variable UniformConstant
140: TypeImage 39(int) 2D array sampled format:Unknown
141: TypePointer UniformConstant 140
142(g_tTex2du4a): 141(ptr) Variable UniformConstant
143: TypeImage 6(float) Cube array sampled format:Unknown
144: TypePointer UniformConstant 143
145(g_tTexcdf4a): 144(ptr) Variable UniformConstant
146: TypeImage 23(int) Cube array sampled format:Unknown
147: TypePointer UniformConstant 146
148(g_tTexcdi4a): 147(ptr) Variable UniformConstant
149: TypeImage 39(int) Cube array sampled format:Unknown
150: TypePointer UniformConstant 149
151(g_tTexcdu4a): 150(ptr) Variable UniformConstant
152: TypePointer Output 92(fvec4)
153(Color): 152(ptr) Variable Output
154: TypePointer Output 6(float)
155(Depth): 154(ptr) Variable Output
103: TypePointer Output 92(fvec4)
104(Color): 103(ptr) Variable Output
107: TypePointer Output 6(float)
108(Depth): 107(ptr) Variable Output
112: TypeImage 6(float) 3D sampled format:Unknown
113: TypePointer UniformConstant 112
114(g_tTex3df4): 113(ptr) Variable UniformConstant
115: TypeImage 23(int) 3D sampled format:Unknown
116: TypePointer UniformConstant 115
117(g_tTex3di4): 116(ptr) Variable UniformConstant
118: TypeImage 39(int) 3D sampled format:Unknown
119: TypePointer UniformConstant 118
120(g_tTex3du4): 119(ptr) Variable UniformConstant
121: TypeImage 6(float) Cube sampled format:Unknown
122: TypePointer UniformConstant 121
123(g_tTexcdf4): 122(ptr) Variable UniformConstant
124: TypeImage 23(int) Cube sampled format:Unknown
125: TypePointer UniformConstant 124
126(g_tTexcdi4): 125(ptr) Variable UniformConstant
127: TypeImage 39(int) Cube sampled format:Unknown
128: TypePointer UniformConstant 127
129(g_tTexcdu4): 128(ptr) Variable UniformConstant
130: TypeImage 6(float) 1D array sampled format:Unknown
131: TypePointer UniformConstant 130
132(g_tTex1df4a): 131(ptr) Variable UniformConstant
133: TypeImage 23(int) 1D array sampled format:Unknown
134: TypePointer UniformConstant 133
135(g_tTex1di4a): 134(ptr) Variable UniformConstant
136: TypeImage 39(int) 1D array sampled format:Unknown
137: TypePointer UniformConstant 136
138(g_tTex1du4a): 137(ptr) Variable UniformConstant
139: TypeImage 6(float) 2D array sampled format:Unknown
140: TypePointer UniformConstant 139
141(g_tTex2df4a): 140(ptr) Variable UniformConstant
142: TypeImage 23(int) 2D array sampled format:Unknown
143: TypePointer UniformConstant 142
144(g_tTex2di4a): 143(ptr) Variable UniformConstant
145: TypeImage 39(int) 2D array sampled format:Unknown
146: TypePointer UniformConstant 145
147(g_tTex2du4a): 146(ptr) Variable UniformConstant
148: TypeImage 6(float) Cube array sampled format:Unknown
149: TypePointer UniformConstant 148
150(g_tTexcdf4a): 149(ptr) Variable UniformConstant
151: TypeImage 23(int) Cube array sampled format:Unknown
152: TypePointer UniformConstant 151
153(g_tTexcdi4a): 152(ptr) Variable UniformConstant
154: TypeImage 39(int) Cube array sampled format:Unknown
155: TypePointer UniformConstant 154
156(g_tTexcdu4a): 155(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
8(r01): 7(ptr) Variable Function
@@ -549,7 +566,11 @@ gl_FragCoord origin is upper left
Store 100 98
102: 7(ptr) AccessChain 95(psout) 101
Store 102 97
105:93(PS_OUTPUT) Load 95(psout)
Store 104(@entryPointOutput) 105
105: 99(ptr) AccessChain 95(psout) 96
106: 92(fvec4) Load 105
Store 104(Color) 106
109: 7(ptr) AccessChain 95(psout) 101
110: 6(float) Load 109
Store 108(Depth) 110
Return
FunctionEnd