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

@@ -2,7 +2,7 @@ hlsl.amend.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:5 Function Definition: f1( (temp void)
0:5 Function Definition: @f1( (temp void)
0:5 Function Parameters:
0:? Sequence
0:6 vector-scale (temp 4-component vector of float)
@@ -14,6 +14,10 @@ gl_FragCoord origin is upper left
0:6 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float a, layout(offset=16 ) uniform float b, layout(offset=32 ) uniform 3-component vector of float c, layout(offset=44 ) uniform int d, uniform int e})
0:6 Constant:
0:6 1 (const uint)
0:5 Function Definition: f1( (temp void)
0:5 Function Parameters:
0:? Sequence
0:5 Function Call: @f1( (temp void)
0:12 Function Definition: f2( (temp void)
0:12 Function Parameters:
0:? Sequence
@@ -67,7 +71,7 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:5 Function Definition: f1( (temp void)
0:5 Function Definition: @f1( (temp void)
0:5 Function Parameters:
0:? Sequence
0:6 vector-scale (temp 4-component vector of float)
@@ -79,6 +83,10 @@ gl_FragCoord origin is upper left
0:6 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float a, layout(offset=16 ) uniform float b, layout(offset=32 ) uniform 3-component vector of float c, layout(offset=44 ) uniform int d, uniform int e})
0:6 Constant:
0:6 1 (const uint)
0:5 Function Definition: f1( (temp void)
0:5 Function Parameters:
0:? Sequence
0:5 Function Call: @f1( (temp void)
0:12 Function Definition: f2( (temp void)
0:12 Function Parameters:
0:? Sequence
@@ -127,7 +135,7 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 47
// Id's are bound by 50
Capability Shader
1: ExtInstImport "GLSL.std.450"
@@ -135,73 +143,79 @@ gl_FragCoord origin is upper left
EntryPoint Fragment 4 "f1"
ExecutionMode 4 OriginUpperLeft
Name 4 "f1"
Name 6 "f2("
Name 8 "f3("
Name 10 "f4("
Name 16 "$Global"
MemberName 16($Global) 0 "a"
MemberName 16($Global) 1 "b"
MemberName 16($Global) 2 "c"
MemberName 16($Global) 3 "d"
MemberName 16($Global) 4 "e"
Name 18 ""
MemberDecorate 16($Global) 0 Offset 0
MemberDecorate 16($Global) 1 Offset 16
MemberDecorate 16($Global) 2 Offset 32
MemberDecorate 16($Global) 3 Offset 44
MemberDecorate 16($Global) 4 Offset 48
Decorate 16($Global) Block
Decorate 18 DescriptorSet 0
Name 6 "@f1("
Name 8 "f2("
Name 10 "f3("
Name 12 "f4("
Name 18 "$Global"
MemberName 18($Global) 0 "a"
MemberName 18($Global) 1 "b"
MemberName 18($Global) 2 "c"
MemberName 18($Global) 3 "d"
MemberName 18($Global) 4 "e"
Name 20 ""
MemberDecorate 18($Global) 0 Offset 0
MemberDecorate 18($Global) 1 Offset 16
MemberDecorate 18($Global) 2 Offset 32
MemberDecorate 18($Global) 3 Offset 44
MemberDecorate 18($Global) 4 Offset 48
Decorate 18($Global) Block
Decorate 20 DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
12: TypeFloat 32
13: TypeVector 12(float) 4
14: TypeVector 12(float) 3
15: TypeInt 32 1
16($Global): TypeStruct 13(fvec4) 12(float) 14(fvec3) 15(int) 15(int)
17: TypePointer Uniform 16($Global)
18: 17(ptr) Variable Uniform
19: 15(int) Constant 0
20: TypePointer Uniform 13(fvec4)
23: 15(int) Constant 1
24: TypePointer Uniform 12(float)
28: TypeInt 32 0
29: 28(int) Constant 0
35: 15(int) Constant 2
39: 15(int) Constant 3
40: TypePointer Uniform 15(int)
14: TypeFloat 32
15: TypeVector 14(float) 4
16: TypeVector 14(float) 3
17: TypeInt 32 1
18($Global): TypeStruct 15(fvec4) 14(float) 16(fvec3) 17(int) 17(int)
19: TypePointer Uniform 18($Global)
20: 19(ptr) Variable Uniform
21: 17(int) Constant 0
22: TypePointer Uniform 15(fvec4)
25: 17(int) Constant 1
26: TypePointer Uniform 14(float)
31: TypeInt 32 0
32: 31(int) Constant 0
38: 17(int) Constant 2
42: 17(int) Constant 3
43: TypePointer Uniform 17(int)
4(f1): 2 Function None 3
5: Label
21: 20(ptr) AccessChain 18 19
22: 13(fvec4) Load 21
25: 24(ptr) AccessChain 18 23
26: 12(float) Load 25
27: 13(fvec4) VectorTimesScalar 22 26
30: 2 FunctionCall 6(@f1()
Return
FunctionEnd
6(f2(): 2 Function None 3
6(@f1(): 2 Function None 3
7: Label
30: 24(ptr) AccessChain 18 19 29
31: 12(float) Load 30
32: 24(ptr) AccessChain 18 23
33: 12(float) Load 32
34: 12(float) FAdd 31 33
36: 24(ptr) AccessChain 18 35 29
37: 12(float) Load 36
38: 12(float) FAdd 34 37
23: 22(ptr) AccessChain 20 21
24: 15(fvec4) Load 23
27: 26(ptr) AccessChain 20 25
28: 14(float) Load 27
29: 15(fvec4) VectorTimesScalar 24 28
Return
FunctionEnd
8(f3(): 2 Function None 3
8(f2(): 2 Function None 3
9: Label
33: 26(ptr) AccessChain 20 21 32
34: 14(float) Load 33
35: 26(ptr) AccessChain 20 25
36: 14(float) Load 35
37: 14(float) FAdd 34 36
39: 26(ptr) AccessChain 20 38 32
40: 14(float) Load 39
41: 14(float) FAdd 37 40
Return
FunctionEnd
10(f4(): 2 Function None 3
10(f3(): 2 Function None 3
11: Label
41: 40(ptr) AccessChain 18 39
42: 15(int) Load 41
43: 12(float) ConvertSToF 42
44: 20(ptr) AccessChain 18 19
45: 13(fvec4) Load 44
46: 13(fvec4) VectorTimesScalar 45 43
Return
FunctionEnd
12(f4(): 2 Function None 3
13: Label
44: 43(ptr) AccessChain 20 42
45: 17(int) Load 44
46: 14(float) ConvertSToF 45
47: 22(ptr) AccessChain 20 21
48: 15(fvec4) Load 47
49: 15(fvec4) VectorTimesScalar 48 46
Return
FunctionEnd