HLSL: Flatten structs for all non-arrayed I/O interfaces.

This commit is contained in:
John Kessenich
2017-08-11 00:17:26 -06:00
parent 01109546d8
commit e29ff3cd65
15 changed files with 749 additions and 862 deletions

View File

@@ -73,7 +73,7 @@ output primitive = triangle_strip
0:33 Sequence
0:33 Sequence
0:33 move second child to first child ( temp 4-component vector of float)
0:? 'ts.psIn.pos' ( out 4-component vector of float Position)
0:? 'ts.pos' ( out 4-component vector of float Position)
0:33 pos: direct index for structure ( temp 4-component vector of float)
0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
@@ -82,13 +82,7 @@ output primitive = triangle_strip
0:33 Constant:
0:33 0 (const int)
0:33 move second child to first child ( temp 2-component vector of float)
0:33 tc: direct index for structure ( temp 2-component vector of float)
0:33 psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc})
0:33 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 Constant:
0:33 0 (const int)
0:33 Constant:
0:33 0 (const int)
0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float)
0:33 tc: direct index for structure ( temp 2-component vector of float)
0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
@@ -96,13 +90,37 @@ output primitive = triangle_strip
0:33 0 (const int)
0:33 Constant:
0:33 1 (const int)
0:33 move second child to first child ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 move second child to first child ( temp float)
0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float)
0:33 direct index ( temp float)
0:33 m0_array: direct index for structure ( temp 2-element array of float)
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 0 (const int)
0:33 Constant:
0:33 0 (const int)
0:33 move second child to first child ( temp float)
0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float)
0:33 direct index ( temp float)
0:33 m0_array: direct index for structure ( temp 2-element array of float)
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 0 (const int)
0:33 Constant:
0:33 1 (const int)
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 move second child to first child ( temp int)
0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int)
0:33 m1: direct index for structure ( temp int)
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 1 (const int)
0:33 EmitVertex ( temp void)
@@ -197,8 +215,11 @@ output primitive = triangle_strip
0:? Linker Objects
0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position)
0:? 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc})
0:? 'ts.psIn.pos' ( out 4-component vector of float Position)
0:? 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:? 'ts.pos' ( out 4-component vector of float Position)
0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float)
0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float)
0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float)
0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int)
Linked geometry stage:
@@ -278,7 +299,7 @@ output primitive = triangle_strip
0:33 Sequence
0:33 Sequence
0:33 move second child to first child ( temp 4-component vector of float)
0:? 'ts.psIn.pos' ( out 4-component vector of float Position)
0:? 'ts.pos' ( out 4-component vector of float Position)
0:33 pos: direct index for structure ( temp 4-component vector of float)
0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
@@ -287,13 +308,7 @@ output primitive = triangle_strip
0:33 Constant:
0:33 0 (const int)
0:33 move second child to first child ( temp 2-component vector of float)
0:33 tc: direct index for structure ( temp 2-component vector of float)
0:33 psIn: direct index for structure ( temp structure{ temp 2-component vector of float tc})
0:33 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 Constant:
0:33 0 (const int)
0:33 Constant:
0:33 0 (const int)
0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float)
0:33 tc: direct index for structure ( temp 2-component vector of float)
0:33 psIn: direct index for structure ( temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
@@ -301,13 +316,37 @@ output primitive = triangle_strip
0:33 0 (const int)
0:33 Constant:
0:33 1 (const int)
0:33 move second child to first child ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 move second child to first child ( temp float)
0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float)
0:33 direct index ( temp float)
0:33 m0_array: direct index for structure ( temp 2-element array of float)
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 0 (const int)
0:33 Constant:
0:33 0 (const int)
0:33 move second child to first child ( temp float)
0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float)
0:33 direct index ( temp float)
0:33 m0_array: direct index for structure ( temp 2-element array of float)
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 0 (const int)
0:33 Constant:
0:33 1 (const int)
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 move second child to first child ( temp int)
0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int)
0:33 m1: direct index for structure ( temp int)
0:33 contains_no_builtin_io: direct index for structure ( temp structure{ temp 2-element array of float m0_array, temp int m1})
0:33 'o' ( temp structure{ temp structure{ temp 4-component vector of float pos, temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 1 (const int)
0:33 EmitVertex ( temp void)
@@ -402,17 +441,20 @@ output primitive = triangle_strip
0:? Linker Objects
0:? 'tin.pos' ( in 3-element array of 4-component vector of float Position)
0:? 'tin' (layout( location=0) in 3-element array of structure{ temp 2-component vector of float tc})
0:? 'ts.psIn.pos' ( out 4-component vector of float Position)
0:? 'ts' (layout( location=0) out structure{ temp structure{ temp 2-component vector of float tc} psIn, temp structure{ temp 2-element array of float m0_array, temp int m1} contains_no_builtin_io})
0:? 'ts.pos' ( out 4-component vector of float Position)
0:? 'ts.psIn.tc' (layout( location=0) out 2-component vector of float)
0:? 'ts.contains_no_builtin_io.m0_array[0]' (layout( location=1) out float)
0:? 'ts.contains_no_builtin_io.m0_array[1]' (layout( location=2) out float)
0:? 'ts.contains_no_builtin_io.m1' (layout( location=3) out int)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 105
// Id's are bound by 100
Capability Geometry
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Geometry 4 "main" 48 55 74 82
EntryPoint Geometry 4 "main" 48 52 56 59 63 69 77
ExecutionMode 4 Triangles
ExecutionMode 4 Invocations 1
ExecutionMode 4 OutputTriangleStrip
@@ -432,28 +474,26 @@ output primitive = triangle_strip
Name 21 "tin"
Name 22 "ts"
Name 25 "o"
Name 48 "ts.psIn.pos"
Name 51 "PS_IN"
MemberName 51(PS_IN) 0 "tc"
Name 52 "STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO"
MemberName 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 0 "m0_array"
MemberName 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) 1 "m1"
Name 53 "GS_OUT"
MemberName 53(GS_OUT) 0 "psIn"
MemberName 53(GS_OUT) 1 "contains_no_builtin_io"
Name 55 "ts"
Name 71 "tin"
Name 74 "tin.pos"
Name 79 "PS_IN"
MemberName 79(PS_IN) 0 "tc"
Name 82 "tin"
Name 99 "ts"
Name 100 "param"
Name 102 "param"
Decorate 48(ts.psIn.pos) BuiltIn Position
Decorate 55(ts) Location 0
Decorate 74(tin.pos) BuiltIn Position
Decorate 82(tin) Location 0
Name 48 "ts.pos"
Name 52 "ts.psIn.tc"
Name 56 "ts.contains_no_builtin_io.m0_array[0]"
Name 59 "ts.contains_no_builtin_io.m0_array[1]"
Name 63 "ts.contains_no_builtin_io.m1"
Name 66 "tin"
Name 69 "tin.pos"
Name 74 "PS_IN"
MemberName 74(PS_IN) 0 "tc"
Name 77 "tin"
Name 94 "ts"
Name 95 "param"
Name 97 "param"
Decorate 48(ts.pos) BuiltIn Position
Decorate 52(ts.psIn.tc) Location 0
Decorate 56(ts.contains_no_builtin_io.m0_array[0]) Location 1
Decorate 59(ts.contains_no_builtin_io.m0_array[1]) Location 2
Decorate 63(ts.contains_no_builtin_io.m1) Location 3
Decorate 69(tin.pos) BuiltIn Position
Decorate 77(tin) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -488,61 +528,58 @@ output primitive = triangle_strip
44: 16(int) Constant 2
45: TypePointer Function 16(int)
47: TypePointer Output 7(fvec4)
48(ts.psIn.pos): 47(ptr) Variable Output
51(PS_IN): TypeStruct 8(fvec2)
52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO): TypeStruct 15 16(int)
53(GS_OUT): TypeStruct 51(PS_IN) 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
54: TypePointer Output 53(GS_OUT)
55(ts): 54(ptr) Variable Output
58: TypePointer Output 8(fvec2)
60: TypePointer Function 17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
63: TypePointer Output 52(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO)
66: TypePointer Output 15
69: TypePointer Output 16(int)
72: TypeArray 7(fvec4) 11
73: TypePointer Input 72
74(tin.pos): 73(ptr) Variable Input
75: TypePointer Input 7(fvec4)
79(PS_IN): TypeStruct 8(fvec2)
80: TypeArray 79(PS_IN) 11
81: TypePointer Input 80
82(tin): 81(ptr) Variable Input
83: TypePointer Input 8(fvec2)
48(ts.pos): 47(ptr) Variable Output
51: TypePointer Output 8(fvec2)
52(ts.psIn.tc): 51(ptr) Variable Output
55: TypePointer Output 6(float)
56(ts.contains_no_builtin_io.m0_array[0]): 55(ptr) Variable Output
59(ts.contains_no_builtin_io.m0_array[1]): 55(ptr) Variable Output
62: TypePointer Output 16(int)
63(ts.contains_no_builtin_io.m1): 62(ptr) Variable Output
67: TypeArray 7(fvec4) 11
68: TypePointer Input 67
69(tin.pos): 68(ptr) Variable Input
70: TypePointer Input 7(fvec4)
74(PS_IN): TypeStruct 8(fvec2)
75: TypeArray 74(PS_IN) 11
76: TypePointer Input 75
77(tin): 76(ptr) Variable Input
78: TypePointer Input 8(fvec2)
4(main): 2 Function None 3
5: Label
71(tin): 13(ptr) Variable Function
99(ts): 19(ptr) Variable Function
100(param): 13(ptr) Variable Function
102(param): 19(ptr) Variable Function
76: 75(ptr) AccessChain 74(tin.pos) 26
77: 7(fvec4) Load 76
78: 32(ptr) AccessChain 71(tin) 26 26
Store 78 77
84: 83(ptr) AccessChain 82(tin) 26 26
85: 8(fvec2) Load 84
86: 38(ptr) AccessChain 71(tin) 26 34
Store 86 85
87: 75(ptr) AccessChain 74(tin.pos) 34
88: 7(fvec4) Load 87
89: 32(ptr) AccessChain 71(tin) 34 26
Store 89 88
90: 83(ptr) AccessChain 82(tin) 34 26
91: 8(fvec2) Load 90
92: 38(ptr) AccessChain 71(tin) 34 34
Store 92 91
93: 75(ptr) AccessChain 74(tin.pos) 44
94: 7(fvec4) Load 93
95: 32(ptr) AccessChain 71(tin) 44 26
Store 95 94
96: 83(ptr) AccessChain 82(tin) 44 26
97: 8(fvec2) Load 96
98: 38(ptr) AccessChain 71(tin) 44 34
Store 98 97
101: 12 Load 71(tin)
Store 100(param) 101
103: 2 FunctionCall 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;) 100(param) 102(param)
104: 18(GS_OUT) Load 102(param)
Store 99(ts) 104
66(tin): 13(ptr) Variable Function
94(ts): 19(ptr) Variable Function
95(param): 13(ptr) Variable Function
97(param): 19(ptr) Variable Function
71: 70(ptr) AccessChain 69(tin.pos) 26
72: 7(fvec4) Load 71
73: 32(ptr) AccessChain 66(tin) 26 26
Store 73 72
79: 78(ptr) AccessChain 77(tin) 26 26
80: 8(fvec2) Load 79
81: 38(ptr) AccessChain 66(tin) 26 34
Store 81 80
82: 70(ptr) AccessChain 69(tin.pos) 34
83: 7(fvec4) Load 82
84: 32(ptr) AccessChain 66(tin) 34 26
Store 84 83
85: 78(ptr) AccessChain 77(tin) 34 26
86: 8(fvec2) Load 85
87: 38(ptr) AccessChain 66(tin) 34 34
Store 87 86
88: 70(ptr) AccessChain 69(tin.pos) 44
89: 7(fvec4) Load 88
90: 32(ptr) AccessChain 66(tin) 44 26
Store 90 89
91: 78(ptr) AccessChain 77(tin) 44 26
92: 8(fvec2) Load 91
93: 38(ptr) AccessChain 66(tin) 44 34
Store 93 92
96: 12 Load 66(tin)
Store 95(param) 96
98: 2 FunctionCall 23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;) 95(param) 97(param)
99: 18(GS_OUT) Load 97(param)
Store 94(ts) 99
Return
FunctionEnd
23(@main(struct-PS_IN-vf4-vf21[3];struct-GS_OUT-struct-PS_IN-vf4-vf21-struct-STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO-f1[2]-i111;): 2 Function None 20
@@ -562,20 +599,19 @@ output primitive = triangle_strip
Store 46 44
49: 32(ptr) AccessChain 25(o) 26 26
50: 7(fvec4) Load 49
Store 48(ts.psIn.pos) 50
56: 38(ptr) AccessChain 25(o) 26 34
57: 8(fvec2) Load 56
59: 58(ptr) AccessChain 55(ts) 26 26
Store 59 57
61: 60(ptr) AccessChain 25(o) 34
62:17(STRUCT_WITH_NO_BUILTIN_INTERSTAGE_IO) Load 61
64: 63(ptr) AccessChain 55(ts) 34
65: 15 CompositeExtract 62 0
67: 66(ptr) AccessChain 64 26
Store 67 65
68: 16(int) CompositeExtract 62 1
70: 69(ptr) AccessChain 64 34
Store 70 68
Store 48(ts.pos) 50
53: 38(ptr) AccessChain 25(o) 26 34
54: 8(fvec2) Load 53
Store 52(ts.psIn.tc) 54
57: 41(ptr) AccessChain 25(o) 34 26 26
58: 6(float) Load 57
Store 56(ts.contains_no_builtin_io.m0_array[0]) 58
60: 41(ptr) AccessChain 25(o) 34 26 34
61: 6(float) Load 60
Store 59(ts.contains_no_builtin_io.m0_array[1]) 61
64: 45(ptr) AccessChain 25(o) 34 34
65: 16(int) Load 64
Store 63(ts.contains_no_builtin_io.m1) 65
EmitVertex
Return
FunctionEnd