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

@@ -61,10 +61,20 @@ gl_FragCoord origin is upper left
0:41 1 (const int)
0:41 Constant:
0:41 1.000000
0:43 Sequence
0:43 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:43 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:43 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:43 Color: direct index for structure (temp 4-component vector of float)
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:43 Constant:
0:43 0 (const int)
0:43 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:43 Depth: direct index for structure (temp float FragDepth)
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:43 Constant:
0:43 1 (const int)
0:43 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -150,10 +160,20 @@ gl_FragCoord origin is upper left
0:41 1 (const int)
0:41 Constant:
0:41 1.000000
0:43 Sequence
0:43 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:43 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:43 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:43 Color: direct index for structure (temp 4-component vector of float)
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:43 Constant:
0:43 0 (const int)
0:43 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:43 Depth: direct index for structure (temp float FragDepth)
0:43 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:43 Constant:
0:43 1 (const int)
0:43 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
@@ -175,13 +195,13 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 106
// Id's are bound by 107
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 71 103 105
EntryPoint Fragment 4 "main" 71 75
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval20"
@@ -195,39 +215,38 @@ gl_FragCoord origin is upper left
MemberName 62(PS_OUTPUT) 0 "Color"
MemberName 62(PS_OUTPUT) 1 "Depth"
Name 64 "psout"
Name 71 "@entryPointOutput"
Name 76 "g_tTex1df4a"
Name 77 "g_tTex1df4"
Name 80 "g_tTex1di4"
Name 83 "g_tTex1du4"
Name 86 "g_tTex3df4"
Name 89 "g_tTex3di4"
Name 92 "g_tTex3du4"
Name 95 "g_tTexcdf4"
Name 98 "g_tTexcdi4"
Name 101 "g_tTexcdu4"
Name 103 "Color"
Name 105 "Depth"
Name 71 "Color"
Name 75 "Depth"
Name 81 "g_tTex1df4a"
Name 82 "g_tTex1df4"
Name 85 "g_tTex1di4"
Name 88 "g_tTex1du4"
Name 91 "g_tTex3df4"
Name 94 "g_tTex3di4"
Name 97 "g_tTex3du4"
Name 100 "g_tTexcdf4"
Name 103 "g_tTexcdi4"
Name 106 "g_tTexcdu4"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 35(g_tTex2di4) DescriptorSet 0
Decorate 51(g_tTex2du4) DescriptorSet 0
MemberDecorate 62(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 76(g_tTex1df4a) DescriptorSet 0
Decorate 76(g_tTex1df4a) Binding 1
Decorate 77(g_tTex1df4) DescriptorSet 0
Decorate 77(g_tTex1df4) Binding 0
Decorate 80(g_tTex1di4) DescriptorSet 0
Decorate 83(g_tTex1du4) DescriptorSet 0
Decorate 86(g_tTex3df4) DescriptorSet 0
Decorate 89(g_tTex3di4) DescriptorSet 0
Decorate 92(g_tTex3du4) DescriptorSet 0
Decorate 95(g_tTexcdf4) DescriptorSet 0
Decorate 98(g_tTexcdi4) DescriptorSet 0
Decorate 101(g_tTexcdu4) DescriptorSet 0
Decorate 103(Color) Location 0
Decorate 105(Depth) BuiltIn FragDepth
Decorate 71(Color) Location 0
Decorate 75(Depth) BuiltIn FragDepth
Decorate 81(g_tTex1df4a) DescriptorSet 0
Decorate 81(g_tTex1df4a) Binding 1
Decorate 82(g_tTex1df4) DescriptorSet 0
Decorate 82(g_tTex1df4) Binding 0
Decorate 85(g_tTex1di4) DescriptorSet 0
Decorate 88(g_tTex1du4) DescriptorSet 0
Decorate 91(g_tTex3df4) DescriptorSet 0
Decorate 94(g_tTex3di4) DescriptorSet 0
Decorate 97(g_tTex3du4) DescriptorSet 0
Decorate 100(g_tTexcdf4) DescriptorSet 0
Decorate 103(g_tTexcdi4) DescriptorSet 0
Decorate 106(g_tTexcdu4) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -276,40 +295,38 @@ gl_FragCoord origin is upper left
65: 6(float) Constant 1065353216
66: 7(fvec4) ConstantComposite 65 65 65 65
68: TypePointer Function 6(float)
70: TypePointer Output 62(PS_OUTPUT)
71(@entryPointOutput): 70(ptr) Variable Output
74: TypeImage 6(float) 1D sampled format:Unknown
75: TypePointer UniformConstant 74
76(g_tTex1df4a): 75(ptr) Variable UniformConstant
77(g_tTex1df4): 75(ptr) Variable UniformConstant
78: TypeImage 24(int) 1D sampled format:Unknown
79: TypePointer UniformConstant 78
80(g_tTex1di4): 79(ptr) Variable UniformConstant
81: TypeImage 45(int) 1D sampled format:Unknown
82: TypePointer UniformConstant 81
83(g_tTex1du4): 82(ptr) Variable UniformConstant
84: TypeImage 6(float) 3D sampled format:Unknown
85: TypePointer UniformConstant 84
86(g_tTex3df4): 85(ptr) Variable UniformConstant
87: TypeImage 24(int) 3D sampled format:Unknown
88: TypePointer UniformConstant 87
89(g_tTex3di4): 88(ptr) Variable UniformConstant
90: TypeImage 45(int) 3D sampled format:Unknown
91: TypePointer UniformConstant 90
92(g_tTex3du4): 91(ptr) Variable UniformConstant
93: TypeImage 6(float) Cube sampled format:Unknown
94: TypePointer UniformConstant 93
95(g_tTexcdf4): 94(ptr) Variable UniformConstant
96: TypeImage 24(int) Cube sampled format:Unknown
97: TypePointer UniformConstant 96
98(g_tTexcdi4): 97(ptr) Variable UniformConstant
99: TypeImage 45(int) Cube sampled format:Unknown
100: TypePointer UniformConstant 99
101(g_tTexcdu4): 100(ptr) Variable UniformConstant
102: TypePointer Output 7(fvec4)
103(Color): 102(ptr) Variable Output
104: TypePointer Output 6(float)
105(Depth): 104(ptr) Variable Output
70: TypePointer Output 7(fvec4)
71(Color): 70(ptr) Variable Output
74: TypePointer Output 6(float)
75(Depth): 74(ptr) Variable Output
79: TypeImage 6(float) 1D sampled format:Unknown
80: TypePointer UniformConstant 79
81(g_tTex1df4a): 80(ptr) Variable UniformConstant
82(g_tTex1df4): 80(ptr) Variable UniformConstant
83: TypeImage 24(int) 1D sampled format:Unknown
84: TypePointer UniformConstant 83
85(g_tTex1di4): 84(ptr) Variable UniformConstant
86: TypeImage 45(int) 1D sampled format:Unknown
87: TypePointer UniformConstant 86
88(g_tTex1du4): 87(ptr) Variable UniformConstant
89: TypeImage 6(float) 3D sampled format:Unknown
90: TypePointer UniformConstant 89
91(g_tTex3df4): 90(ptr) Variable UniformConstant
92: TypeImage 24(int) 3D sampled format:Unknown
93: TypePointer UniformConstant 92
94(g_tTex3di4): 93(ptr) Variable UniformConstant
95: TypeImage 45(int) 3D sampled format:Unknown
96: TypePointer UniformConstant 95
97(g_tTex3du4): 96(ptr) Variable UniformConstant
98: TypeImage 6(float) Cube sampled format:Unknown
99: TypePointer UniformConstant 98
100(g_tTexcdf4): 99(ptr) Variable UniformConstant
101: TypeImage 24(int) Cube sampled format:Unknown
102: TypePointer UniformConstant 101
103(g_tTexcdi4): 102(ptr) Variable UniformConstant
104: TypeImage 45(int) Cube sampled format:Unknown
105: TypePointer UniformConstant 104
106(g_tTexcdu4): 105(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval20): 8(ptr) Variable Function
@@ -335,7 +352,11 @@ gl_FragCoord origin is upper left
Store 67 66
69: 68(ptr) AccessChain 64(psout) 26
Store 69 65
72:62(PS_OUTPUT) Load 64(psout)
Store 71(@entryPointOutput) 72
72: 8(ptr) AccessChain 64(psout) 27
73: 7(fvec4) Load 72
Store 71(Color) 73
76: 68(ptr) AccessChain 64(psout) 26
77: 6(float) Load 76
Store 75(Depth) 77
Return
FunctionEnd