HLSL: Wrap the entry-point; need to write 'in' args, and support 'inout' args.

This needs some render testing, but is destined to be part of master.

This also leads to a variety of other simplifications.
 - IO are global symbols, so only need one list of linkage nodes (deferred)
 - no longer need parse-context-wide 'inEntryPoint' state, entry-point is localized
 - several parts of splitting/flattening are now localized
This commit is contained in:
John Kessenich
2017-01-19 15:41:47 -07:00
parent 18adbdbbb8
commit 02467d8d94
171 changed files with 37604 additions and 32679 deletions

View File

@@ -99,7 +99,7 @@ gl_FragCoord origin is upper left
0:21 Construct vec4 (in 4-component vector of float)
0:21 'v01' (temp float)
0:21 'a' (in 4-component vector of float)
0:30 Function Definition: main( (temp structure{temp 4-component vector of float Color})
0:30 Function Definition: @main( (temp structure{temp 4-component vector of float Color})
0:30 Function Parameters:
0:? Sequence
0:32 move second child to first child (temp 4-component vector of float)
@@ -112,18 +112,21 @@ gl_FragCoord origin is upper left
0:32 0.000000
0:32 0.000000
0:32 0.000000
0:33 Sequence
0:33 Sequence
0:33 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:33 Color: direct index for structure (temp 4-component vector of float)
0:33 'psout' (temp structure{temp 4-component vector of float Color})
0:33 Constant:
0:33 0 (const int)
0:33 Branch: Return
0:33 Branch: Return with expression
0:33 'psout' (temp structure{temp 4-component vector of float Color})
0:30 Function Definition: main( (temp void)
0:30 Function Parameters:
0:? Sequence
0:30 Sequence
0:30 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:30 Color: direct index for structure (temp 4-component vector of float)
0:30 Function Call: @main( (temp structure{temp 4-component vector of float Color})
0:30 Constant:
0:30 0 (const int)
0:? Linker Objects
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float uf4})
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
Linked fragment stage:
@@ -229,7 +232,7 @@ gl_FragCoord origin is upper left
0:21 Construct vec4 (in 4-component vector of float)
0:21 'v01' (temp float)
0:21 'a' (in 4-component vector of float)
0:30 Function Definition: main( (temp structure{temp 4-component vector of float Color})
0:30 Function Definition: @main( (temp structure{temp 4-component vector of float Color})
0:30 Function Parameters:
0:? Sequence
0:32 move second child to first child (temp 4-component vector of float)
@@ -242,161 +245,171 @@ gl_FragCoord origin is upper left
0:32 0.000000
0:32 0.000000
0:32 0.000000
0:33 Sequence
0:33 Sequence
0:33 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:33 Color: direct index for structure (temp 4-component vector of float)
0:33 'psout' (temp structure{temp 4-component vector of float Color})
0:33 Constant:
0:33 0 (const int)
0:33 Branch: Return
0:33 Branch: Return with expression
0:33 'psout' (temp structure{temp 4-component vector of float Color})
0:30 Function Definition: main( (temp void)
0:30 Function Parameters:
0:? Sequence
0:30 Sequence
0:30 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:30 Color: direct index for structure (temp 4-component vector of float)
0:30 Function Call: @main( (temp structure{temp 4-component vector of float Color})
0:30 Constant:
0:30 0 (const int)
0:? Linker Objects
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float uf4})
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 91
// Id's are bound by 96
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 84
EntryPoint Fragment 4 "main" 90
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 11 "Bug1(vf4;"
Name 10 "a"
Name 13 "v04"
Name 17 "v01"
Name 21 "r00"
Name 25 "r01"
Name 29 "r02"
Name 33 "r03"
Name 37 "r10"
Name 42 "r11"
Name 47 "r12"
Name 52 "r13"
Name 57 "r20"
Name 62 "r21"
Name 67 "r22"
Name 72 "r23"
Name 77 "PS_OUTPUT"
MemberName 77(PS_OUTPUT) 0 "Color"
Name 79 "psout"
Name 84 "Color"
Name 88 "$Global"
MemberName 88($Global) 0 "uf4"
Name 90 ""
Decorate 84(Color) Location 0
MemberDecorate 88($Global) 0 Offset 0
Decorate 88($Global) Block
Decorate 90 DescriptorSet 0
Name 13 "PS_OUTPUT"
MemberName 13(PS_OUTPUT) 0 "Color"
Name 15 "@main("
Name 17 "v04"
Name 21 "v01"
Name 25 "r00"
Name 29 "r01"
Name 33 "r02"
Name 37 "r03"
Name 41 "r10"
Name 46 "r11"
Name 51 "r12"
Name 56 "r13"
Name 61 "r20"
Name 66 "r21"
Name 71 "r22"
Name 76 "r23"
Name 82 "psout"
Name 90 "Color"
Name 93 "$Global"
MemberName 93($Global) 0 "uf4"
Name 95 ""
Decorate 90(Color) Location 0
MemberDecorate 93($Global) 0 Offset 0
Decorate 93($Global) Block
Decorate 95 DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypeFunction 2 8(ptr)
14: 6(float) Constant 0
15: 7(fvec4) ConstantComposite 14 14 14 14
16: TypePointer Function 6(float)
18: TypeBool
19: TypeVector 18(bool) 4
20: TypePointer Function 19(bvec4)
77(PS_OUTPUT): TypeStruct 7(fvec4)
78: TypePointer Function 77(PS_OUTPUT)
80: TypeInt 32 1
81: 80(int) Constant 0
83: TypePointer Output 7(fvec4)
84(Color): 83(ptr) Variable Output
88($Global): TypeStruct 7(fvec4)
89: TypePointer Uniform 88($Global)
90: 89(ptr) Variable Uniform
13(PS_OUTPUT): TypeStruct 7(fvec4)
14: TypeFunction 13(PS_OUTPUT)
18: 6(float) Constant 0
19: 7(fvec4) ConstantComposite 18 18 18 18
20: TypePointer Function 6(float)
22: TypeBool
23: TypeVector 22(bool) 4
24: TypePointer Function 23(bvec4)
81: TypePointer Function 13(PS_OUTPUT)
83: TypeInt 32 1
84: 83(int) Constant 0
89: TypePointer Output 7(fvec4)
90(Color): 89(ptr) Variable Output
93($Global): TypeStruct 7(fvec4)
94: TypePointer Uniform 93($Global)
95: 94(ptr) Variable Uniform
4(main): 2 Function None 3
5: Label
79(psout): 78(ptr) Variable Function
82: 8(ptr) AccessChain 79(psout) 81
Store 82 15
85: 8(ptr) AccessChain 79(psout) 81
86: 7(fvec4) Load 85
Store 84(Color) 86
91:13(PS_OUTPUT) FunctionCall 15(@main()
92: 7(fvec4) CompositeExtract 91 0
Store 90(Color) 92
Return
FunctionEnd
11(Bug1(vf4;): 2 Function None 9
10(a): 8(ptr) FunctionParameter
12: Label
13(v04): 8(ptr) Variable Function
17(v01): 16(ptr) Variable Function
21(r00): 20(ptr) Variable Function
25(r01): 20(ptr) Variable Function
29(r02): 20(ptr) Variable Function
33(r03): 20(ptr) Variable Function
37(r10): 20(ptr) Variable Function
42(r11): 20(ptr) Variable Function
47(r12): 20(ptr) Variable Function
52(r13): 20(ptr) Variable Function
57(r20): 20(ptr) Variable Function
62(r21): 20(ptr) Variable Function
67(r22): 20(ptr) Variable Function
72(r23): 20(ptr) Variable Function
Store 13(v04) 15
Store 17(v01) 14
22: 7(fvec4) Load 10(a)
23: 7(fvec4) Load 13(v04)
24: 19(bvec4) FOrdEqual 22 23
Store 21(r00) 24
17(v04): 8(ptr) Variable Function
21(v01): 20(ptr) Variable Function
25(r00): 24(ptr) Variable Function
29(r01): 24(ptr) Variable Function
33(r02): 24(ptr) Variable Function
37(r03): 24(ptr) Variable Function
41(r10): 24(ptr) Variable Function
46(r11): 24(ptr) Variable Function
51(r12): 24(ptr) Variable Function
56(r13): 24(ptr) Variable Function
61(r20): 24(ptr) Variable Function
66(r21): 24(ptr) Variable Function
71(r22): 24(ptr) Variable Function
76(r23): 24(ptr) Variable Function
Store 17(v04) 19
Store 21(v01) 18
26: 7(fvec4) Load 10(a)
27: 7(fvec4) Load 13(v04)
28: 19(bvec4) FOrdNotEqual 26 27
Store 25(r01) 28
27: 7(fvec4) Load 17(v04)
28: 23(bvec4) FOrdEqual 26 27
Store 25(r00) 28
30: 7(fvec4) Load 10(a)
31: 7(fvec4) Load 13(v04)
32: 19(bvec4) FOrdLessThan 30 31
Store 29(r02) 32
31: 7(fvec4) Load 17(v04)
32: 23(bvec4) FOrdNotEqual 30 31
Store 29(r01) 32
34: 7(fvec4) Load 10(a)
35: 7(fvec4) Load 13(v04)
36: 19(bvec4) FOrdGreaterThan 34 35
Store 33(r03) 36
35: 7(fvec4) Load 17(v04)
36: 23(bvec4) FOrdLessThan 34 35
Store 33(r02) 36
38: 7(fvec4) Load 10(a)
39: 6(float) Load 17(v01)
40: 7(fvec4) CompositeConstruct 39 39 39 39
41: 19(bvec4) FOrdEqual 38 40
Store 37(r10) 41
43: 7(fvec4) Load 10(a)
44: 6(float) Load 17(v01)
45: 7(fvec4) CompositeConstruct 44 44 44 44
46: 19(bvec4) FOrdNotEqual 43 45
Store 42(r11) 46
48: 7(fvec4) Load 10(a)
49: 6(float) Load 17(v01)
50: 7(fvec4) CompositeConstruct 49 49 49 49
51: 19(bvec4) FOrdLessThan 48 50
Store 47(r12) 51
53: 7(fvec4) Load 10(a)
54: 6(float) Load 17(v01)
55: 7(fvec4) CompositeConstruct 54 54 54 54
56: 19(bvec4) FOrdGreaterThan 53 55
Store 52(r13) 56
58: 6(float) Load 17(v01)
39: 7(fvec4) Load 17(v04)
40: 23(bvec4) FOrdGreaterThan 38 39
Store 37(r03) 40
42: 7(fvec4) Load 10(a)
43: 6(float) Load 21(v01)
44: 7(fvec4) CompositeConstruct 43 43 43 43
45: 23(bvec4) FOrdEqual 42 44
Store 41(r10) 45
47: 7(fvec4) Load 10(a)
48: 6(float) Load 21(v01)
49: 7(fvec4) CompositeConstruct 48 48 48 48
50: 23(bvec4) FOrdNotEqual 47 49
Store 46(r11) 50
52: 7(fvec4) Load 10(a)
53: 6(float) Load 21(v01)
54: 7(fvec4) CompositeConstruct 53 53 53 53
55: 23(bvec4) FOrdLessThan 52 54
Store 51(r12) 55
57: 7(fvec4) Load 10(a)
58: 6(float) Load 21(v01)
59: 7(fvec4) CompositeConstruct 58 58 58 58
60: 7(fvec4) Load 10(a)
61: 19(bvec4) FOrdEqual 59 60
Store 57(r20) 61
63: 6(float) Load 17(v01)
64: 7(fvec4) CompositeConstruct 63 63 63 63
65: 7(fvec4) Load 10(a)
66: 19(bvec4) FOrdNotEqual 64 65
Store 62(r21) 66
68: 6(float) Load 17(v01)
69: 7(fvec4) CompositeConstruct 68 68 68 68
70: 7(fvec4) Load 10(a)
71: 19(bvec4) FOrdLessThan 69 70
Store 67(r22) 71
73: 6(float) Load 17(v01)
74: 7(fvec4) CompositeConstruct 73 73 73 73
75: 7(fvec4) Load 10(a)
76: 19(bvec4) FOrdGreaterThan 74 75
Store 72(r23) 76
60: 23(bvec4) FOrdGreaterThan 57 59
Store 56(r13) 60
62: 6(float) Load 21(v01)
63: 7(fvec4) CompositeConstruct 62 62 62 62
64: 7(fvec4) Load 10(a)
65: 23(bvec4) FOrdEqual 63 64
Store 61(r20) 65
67: 6(float) Load 21(v01)
68: 7(fvec4) CompositeConstruct 67 67 67 67
69: 7(fvec4) Load 10(a)
70: 23(bvec4) FOrdNotEqual 68 69
Store 66(r21) 70
72: 6(float) Load 21(v01)
73: 7(fvec4) CompositeConstruct 72 72 72 72
74: 7(fvec4) Load 10(a)
75: 23(bvec4) FOrdLessThan 73 74
Store 71(r22) 75
77: 6(float) Load 21(v01)
78: 7(fvec4) CompositeConstruct 77 77 77 77
79: 7(fvec4) Load 10(a)
80: 23(bvec4) FOrdGreaterThan 78 79
Store 76(r23) 80
Return
FunctionEnd
15(@main():13(PS_OUTPUT) Function None 14
16: Label
82(psout): 81(ptr) Variable Function
85: 8(ptr) AccessChain 82(psout) 84
Store 85 19
86:13(PS_OUTPUT) Load 82(psout)
ReturnValue 86
FunctionEnd