HLSL: Make the entry-point shadow function have non-IO params and return.

This also removes an no longer needed makeTemporary() and rationalizes
makeTypeNonIo()'s interface.
This commit is contained in:
John Kessenich
2017-02-01 18:09:17 -07:00
parent 5d3023af03
commit abd8dca86d
24 changed files with 1146 additions and 1346 deletions

View File

@@ -1,10 +1,10 @@
hlsl.struct.split-1.vert
Shader version: 450
0:? Sequence
0:17 Function Definition: @main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 Function Definition: @main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Function Parameters:
0:17 'vsin' (in structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:17 'Pos_loose' (in 4-component vector of float Position)
0:17 'Pos_loose' (in 4-component vector of float)
0:? Sequence
0:20 move second child to first child (temp int)
0:20 x0_out: direct index for structure (temp int)
@@ -25,7 +25,7 @@ Shader version: 450
0:21 'vsin' (in structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:21 Constant:
0:21 1 (const int)
0:21 'Pos_loose' (in 4-component vector of float Position)
0:21 'Pos_loose' (in 4-component vector of float)
0:22 move second child to first child (temp int)
0:22 x1_out: direct index for structure (temp int)
0:22 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
@@ -63,9 +63,9 @@ Shader version: 450
0:? 'Pos_loose' (temp 4-component vector of float)
0:? 'Pos_loose' (in 4-component vector of float Position)
0:17 Sequence
0:17 move second child to first child (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 Function Call: @main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 move second child to first child (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Function Call: @main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:? 'vsin' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:? 'Pos_loose' (temp 4-component vector of float)
0:17 move second child to first child (temp int)
@@ -74,13 +74,13 @@ Shader version: 450
0:17 Constant:
0:17 0 (const int)
0:17 x0_out: direct index for structure (temp int)
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Constant:
0:17 0 (const int)
0:17 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput_Pos_out' (out 4-component vector of float Position)
0:17 Pos_out: direct index for structure (temp 4-component vector of float Position)
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 Pos_out: direct index for structure (temp 4-component vector of float)
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Constant:
0:17 1 (const int)
0:17 move second child to first child (temp int)
@@ -89,7 +89,7 @@ Shader version: 450
0:17 Constant:
0:17 1 (const int)
0:17 x1_out: direct index for structure (temp int)
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Constant:
0:17 2 (const int)
0:? Linker Objects
@@ -106,10 +106,10 @@ Linked vertex stage:
Shader version: 450
0:? Sequence
0:17 Function Definition: @main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 Function Definition: @main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Function Parameters:
0:17 'vsin' (in structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:17 'Pos_loose' (in 4-component vector of float Position)
0:17 'Pos_loose' (in 4-component vector of float)
0:? Sequence
0:20 move second child to first child (temp int)
0:20 x0_out: direct index for structure (temp int)
@@ -130,7 +130,7 @@ Shader version: 450
0:21 'vsin' (in structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:21 Constant:
0:21 1 (const int)
0:21 'Pos_loose' (in 4-component vector of float Position)
0:21 'Pos_loose' (in 4-component vector of float)
0:22 move second child to first child (temp int)
0:22 x1_out: direct index for structure (temp int)
0:22 'vsout' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
@@ -168,9 +168,9 @@ Shader version: 450
0:? 'Pos_loose' (temp 4-component vector of float)
0:? 'Pos_loose' (in 4-component vector of float Position)
0:17 Sequence
0:17 move second child to first child (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 Function Call: @main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 move second child to first child (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Function Call: @main(struct-VS_INPUT-i1-vf4-i11;vf4; (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:? 'vsin' (temp structure{temp int x0_in, temp 4-component vector of float Pos_in, temp int x1_in})
0:? 'Pos_loose' (temp 4-component vector of float)
0:17 move second child to first child (temp int)
@@ -179,13 +179,13 @@ Shader version: 450
0:17 Constant:
0:17 0 (const int)
0:17 x0_out: direct index for structure (temp int)
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Constant:
0:17 0 (const int)
0:17 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput_Pos_out' (out 4-component vector of float Position)
0:17 Pos_out: direct index for structure (temp 4-component vector of float Position)
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 Pos_out: direct index for structure (temp 4-component vector of float)
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Constant:
0:17 1 (const int)
0:17 move second child to first child (temp int)
@@ -194,7 +194,7 @@ Shader version: 450
0:17 Constant:
0:17 1 (const int)
0:17 x1_out: direct index for structure (temp int)
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Position Pos_out, temp int x1_out})
0:17 'flattenTemp' (temp structure{temp int x0_out, temp 4-component vector of float Pos_out, temp int x1_out})
0:17 Constant:
0:17 2 (const int)
0:? Linker Objects
@@ -207,12 +207,12 @@ Shader version: 450
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 86
// Id's are bound by 76
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 50 54 57 61 71 77 85
EntryPoint Vertex 4 "main" 40 44 47 51 61 67 75
Name 4 "main"
Name 9 "VS_INPUT"
MemberName 9(VS_INPUT) 0 "x0_in"
@@ -225,37 +225,32 @@ Shader version: 450
Name 16 "@main(struct-VS_INPUT-i1-vf4-i11;vf4;"
Name 14 "vsin"
Name 15 "Pos_loose"
Name 18 "VS_OUTPUT"
MemberName 18(VS_OUTPUT) 0 "x0_out"
MemberName 18(VS_OUTPUT) 1 "Pos_out"
MemberName 18(VS_OUTPUT) 2 "x1_out"
Name 20 "vsout"
Name 48 "vsin"
Name 50 "x0_in"
Name 54 "Pos_in"
Name 57 "x1_in"
Name 60 "Pos_loose"
Name 61 "Pos_loose"
Name 63 "flattenTemp"
Name 64 "param"
Name 66 "param"
Name 69 "VS_OUTPUT"
MemberName 69(VS_OUTPUT) 0 "x0_out"
MemberName 69(VS_OUTPUT) 1 "x1_out"
Name 71 "@entryPointOutput"
Name 77 "@entryPointOutput_Pos_out"
Name 83 "PerVertex_out"
MemberName 83(PerVertex_out) 0 "@entryPointOutput_Pos_out"
Name 85 "PerVertex_out"
MemberDecorate 12(VS_OUTPUT) 1 BuiltIn Position
Decorate 50(x0_in) Location 0
Decorate 54(Pos_in) BuiltIn Position
Decorate 57(x1_in) Location 1
Decorate 61(Pos_loose) BuiltIn Position
Decorate 71(@entryPointOutput) Location 0
Decorate 77(@entryPointOutput_Pos_out) BuiltIn Position
MemberDecorate 83(PerVertex_out) 0 BuiltIn Position
Decorate 83(PerVertex_out) Block
Name 19 "vsout"
Name 38 "vsin"
Name 40 "x0_in"
Name 44 "Pos_in"
Name 47 "x1_in"
Name 50 "Pos_loose"
Name 51 "Pos_loose"
Name 53 "flattenTemp"
Name 54 "param"
Name 56 "param"
Name 59 "VS_OUTPUT"
MemberName 59(VS_OUTPUT) 0 "x0_out"
MemberName 59(VS_OUTPUT) 1 "x1_out"
Name 61 "@entryPointOutput"
Name 67 "@entryPointOutput_Pos_out"
Name 73 "PerVertex_out"
MemberName 73(PerVertex_out) 0 "@entryPointOutput_Pos_out"
Name 75 "PerVertex_out"
Decorate 40(x0_in) Location 0
Decorate 44(Pos_in) BuiltIn Position
Decorate 47(x1_in) Location 1
Decorate 51(Pos_loose) BuiltIn Position
Decorate 61(@entryPointOutput) Location 0
Decorate 67(@entryPointOutput_Pos_out) BuiltIn Position
MemberDecorate 73(PerVertex_out) 0 BuiltIn Position
Decorate 73(PerVertex_out) Block
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@@ -266,95 +261,82 @@ Shader version: 450
11: TypePointer Function 8(fvec4)
12(VS_OUTPUT): TypeStruct 6(int) 8(fvec4) 6(int)
13: TypeFunction 12(VS_OUTPUT) 10(ptr) 11(ptr)
18(VS_OUTPUT): TypeStruct 6(int) 8(fvec4) 6(int)
19: TypePointer Function 18(VS_OUTPUT)
21: 6(int) Constant 0
22: TypePointer Function 6(int)
26: 6(int) Constant 1
32: 6(int) Constant 2
37: TypePointer Function 12(VS_OUTPUT)
49: TypePointer Input 6(int)
50(x0_in): 49(ptr) Variable Input
53: TypePointer Input 8(fvec4)
54(Pos_in): 53(ptr) Variable Input
57(x1_in): 49(ptr) Variable Input
61(Pos_loose): 53(ptr) Variable Input
69(VS_OUTPUT): TypeStruct 6(int) 6(int)
70: TypePointer Output 69(VS_OUTPUT)
71(@entryPointOutput): 70(ptr) Variable Output
74: TypePointer Output 6(int)
76: TypePointer Output 8(fvec4)
77(@entryPointOutput_Pos_out): 76(ptr) Variable Output
83(PerVertex_out): TypeStruct 8(fvec4)
84: TypePointer Output 83(PerVertex_out)
85(PerVertex_out): 84(ptr) Variable Output
18: TypePointer Function 12(VS_OUTPUT)
20: 6(int) Constant 0
21: TypePointer Function 6(int)
25: 6(int) Constant 1
31: 6(int) Constant 2
39: TypePointer Input 6(int)
40(x0_in): 39(ptr) Variable Input
43: TypePointer Input 8(fvec4)
44(Pos_in): 43(ptr) Variable Input
47(x1_in): 39(ptr) Variable Input
51(Pos_loose): 43(ptr) Variable Input
59(VS_OUTPUT): TypeStruct 6(int) 6(int)
60: TypePointer Output 59(VS_OUTPUT)
61(@entryPointOutput): 60(ptr) Variable Output
64: TypePointer Output 6(int)
66: TypePointer Output 8(fvec4)
67(@entryPointOutput_Pos_out): 66(ptr) Variable Output
73(PerVertex_out): TypeStruct 8(fvec4)
74: TypePointer Output 73(PerVertex_out)
75(PerVertex_out): 74(ptr) Variable Output
4(main): 2 Function None 3
5: Label
48(vsin): 10(ptr) Variable Function
60(Pos_loose): 11(ptr) Variable Function
63(flattenTemp): 37(ptr) Variable Function
64(param): 10(ptr) Variable Function
66(param): 11(ptr) Variable Function
51: 6(int) Load 50(x0_in)
52: 22(ptr) AccessChain 48(vsin) 21
Store 52 51
55: 8(fvec4) Load 54(Pos_in)
56: 11(ptr) AccessChain 48(vsin) 26
Store 56 55
58: 6(int) Load 57(x1_in)
59: 22(ptr) AccessChain 48(vsin) 32
Store 59 58
62: 8(fvec4) Load 61(Pos_loose)
Store 60(Pos_loose) 62
65: 9(VS_INPUT) Load 48(vsin)
Store 64(param) 65
67: 8(fvec4) Load 60(Pos_loose)
Store 66(param) 67
68:12(VS_OUTPUT) FunctionCall 16(@main(struct-VS_INPUT-i1-vf4-i11;vf4;) 64(param) 66(param)
Store 63(flattenTemp) 68
72: 22(ptr) AccessChain 63(flattenTemp) 21
73: 6(int) Load 72
75: 74(ptr) AccessChain 71(@entryPointOutput) 21
Store 75 73
78: 11(ptr) AccessChain 63(flattenTemp) 26
79: 8(fvec4) Load 78
Store 77(@entryPointOutput_Pos_out) 79
80: 22(ptr) AccessChain 63(flattenTemp) 32
81: 6(int) Load 80
82: 74(ptr) AccessChain 71(@entryPointOutput) 26
Store 82 81
38(vsin): 10(ptr) Variable Function
50(Pos_loose): 11(ptr) Variable Function
53(flattenTemp): 18(ptr) Variable Function
54(param): 10(ptr) Variable Function
56(param): 11(ptr) Variable Function
41: 6(int) Load 40(x0_in)
42: 21(ptr) AccessChain 38(vsin) 20
Store 42 41
45: 8(fvec4) Load 44(Pos_in)
46: 11(ptr) AccessChain 38(vsin) 25
Store 46 45
48: 6(int) Load 47(x1_in)
49: 21(ptr) AccessChain 38(vsin) 31
Store 49 48
52: 8(fvec4) Load 51(Pos_loose)
Store 50(Pos_loose) 52
55: 9(VS_INPUT) Load 38(vsin)
Store 54(param) 55
57: 8(fvec4) Load 50(Pos_loose)
Store 56(param) 57
58:12(VS_OUTPUT) FunctionCall 16(@main(struct-VS_INPUT-i1-vf4-i11;vf4;) 54(param) 56(param)
Store 53(flattenTemp) 58
62: 21(ptr) AccessChain 53(flattenTemp) 20
63: 6(int) Load 62
65: 64(ptr) AccessChain 61(@entryPointOutput) 20
Store 65 63
68: 11(ptr) AccessChain 53(flattenTemp) 25
69: 8(fvec4) Load 68
Store 67(@entryPointOutput_Pos_out) 69
70: 21(ptr) AccessChain 53(flattenTemp) 31
71: 6(int) Load 70
72: 64(ptr) AccessChain 61(@entryPointOutput) 25
Store 72 71
Return
FunctionEnd
16(@main(struct-VS_INPUT-i1-vf4-i11;vf4;):12(VS_OUTPUT) Function None 13
14(vsin): 10(ptr) FunctionParameter
15(Pos_loose): 11(ptr) FunctionParameter
17: Label
20(vsout): 19(ptr) Variable Function
38: 37(ptr) Variable Function
23: 22(ptr) AccessChain 14(vsin) 21
24: 6(int) Load 23
25: 22(ptr) AccessChain 20(vsout) 21
Store 25 24
27: 11(ptr) AccessChain 14(vsin) 26
28: 8(fvec4) Load 27
29: 8(fvec4) Load 15(Pos_loose)
30: 8(fvec4) FAdd 28 29
31: 11(ptr) AccessChain 20(vsout) 26
Store 31 30
33: 22(ptr) AccessChain 14(vsin) 32
34: 6(int) Load 33
35: 22(ptr) AccessChain 20(vsout) 32
Store 35 34
36:18(VS_OUTPUT) Load 20(vsout)
39: 6(int) CompositeExtract 36 0
40: 22(ptr) AccessChain 38 21
Store 40 39
41: 8(fvec4) CompositeExtract 36 1
42: 11(ptr) AccessChain 38 26
Store 42 41
43: 6(int) CompositeExtract 36 2
44: 22(ptr) AccessChain 38 32
Store 44 43
45:12(VS_OUTPUT) Load 38
ReturnValue 45
19(vsout): 18(ptr) Variable Function
22: 21(ptr) AccessChain 14(vsin) 20
23: 6(int) Load 22
24: 21(ptr) AccessChain 19(vsout) 20
Store 24 23
26: 11(ptr) AccessChain 14(vsin) 25
27: 8(fvec4) Load 26
28: 8(fvec4) Load 15(Pos_loose)
29: 8(fvec4) FAdd 27 28
30: 11(ptr) AccessChain 19(vsout) 25
Store 30 29
32: 21(ptr) AccessChain 14(vsin) 31
33: 6(int) Load 32
34: 21(ptr) AccessChain 19(vsout) 31
Store 34 33
35:12(VS_OUTPUT) Load 19(vsout)
ReturnValue 35
FunctionEnd