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.trivial.vert
Shader version: 450
0:? Sequence
0:16 Function Definition: @main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
0:16 Function Definition: @main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Pos})
0:16 Function Parameters:
0:16 'vsin' (in structure{temp 4-component vector of float Pos_in})
0:16 'Pos_loose' (in 4-component vector of float Position)
0:16 'Pos_loose' (in 4-component vector of float)
0:? Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:19 Pos: direct index for structure (temp 4-component vector of float)
@@ -16,7 +16,7 @@ Shader version: 450
0:19 'vsin' (in structure{temp 4-component vector of float Pos_in})
0:19 Constant:
0:19 0 (const int)
0:19 'Pos_loose' (in 4-component vector of float Position)
0:19 'Pos_loose' (in 4-component vector of float)
0:21 Branch: Return with expression
0:21 'vsout' (temp structure{temp 4-component vector of float Pos})
0:16 Function Definition: main( (temp void)
@@ -35,8 +35,8 @@ Shader version: 450
0:16 Sequence
0:16 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput_Pos' (out 4-component vector of float Position)
0:16 Pos: direct index for structure (temp 4-component vector of float Position)
0:16 Function Call: @main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
0:16 Pos: direct index for structure (temp 4-component vector of float)
0:16 Function Call: @main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Pos})
0:? 'vsin' (temp structure{temp 4-component vector of float Pos_in})
0:? 'Pos_loose' (temp 4-component vector of float)
0:16 Constant:
@@ -52,10 +52,10 @@ Linked vertex stage:
Shader version: 450
0:? Sequence
0:16 Function Definition: @main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
0:16 Function Definition: @main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Pos})
0:16 Function Parameters:
0:16 'vsin' (in structure{temp 4-component vector of float Pos_in})
0:16 'Pos_loose' (in 4-component vector of float Position)
0:16 'Pos_loose' (in 4-component vector of float)
0:? Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:19 Pos: direct index for structure (temp 4-component vector of float)
@@ -67,7 +67,7 @@ Shader version: 450
0:19 'vsin' (in structure{temp 4-component vector of float Pos_in})
0:19 Constant:
0:19 0 (const int)
0:19 'Pos_loose' (in 4-component vector of float Position)
0:19 'Pos_loose' (in 4-component vector of float)
0:21 Branch: Return with expression
0:21 'vsout' (temp structure{temp 4-component vector of float Pos})
0:16 Function Definition: main( (temp void)
@@ -86,8 +86,8 @@ Shader version: 450
0:16 Sequence
0:16 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput_Pos' (out 4-component vector of float Position)
0:16 Pos: direct index for structure (temp 4-component vector of float Position)
0:16 Function Call: @main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
0:16 Pos: direct index for structure (temp 4-component vector of float)
0:16 Function Call: @main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Pos})
0:? 'vsin' (temp structure{temp 4-component vector of float Pos_in})
0:? 'Pos_loose' (temp 4-component vector of float)
0:16 Constant:
@@ -99,12 +99,12 @@ Shader version: 450
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 54
// Id's are bound by 48
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 37 41 44 53
EntryPoint Vertex 4 "main" 31 35 38 47
Name 4 "main"
Name 8 "VS_INPUT"
MemberName 8(VS_INPUT) 0 "Pos_in"
@@ -113,25 +113,22 @@ Shader version: 450
Name 15 "@main(struct-VS_INPUT-vf41;vf4;"
Name 13 "vsin"
Name 14 "Pos_loose"
Name 17 "VS_OUTPUT"
MemberName 17(VS_OUTPUT) 0 "Pos"
Name 19 "vsout"
Name 35 "vsin"
Name 37 "Pos_in"
Name 40 "Pos_loose"
Name 41 "Pos_loose"
Name 44 "@entryPointOutput_Pos"
Name 45 "param"
Name 47 "param"
Name 51 "PerVertex_out"
MemberName 51(PerVertex_out) 0 "@entryPointOutput_Pos"
Name 53 "PerVertex_out"
MemberDecorate 11(VS_OUTPUT) 0 BuiltIn Position
Decorate 37(Pos_in) BuiltIn Position
Decorate 41(Pos_loose) BuiltIn Position
Decorate 44(@entryPointOutput_Pos) BuiltIn Position
MemberDecorate 51(PerVertex_out) 0 BuiltIn Position
Decorate 51(PerVertex_out) Block
Name 18 "vsout"
Name 29 "vsin"
Name 31 "Pos_in"
Name 34 "Pos_loose"
Name 35 "Pos_loose"
Name 38 "@entryPointOutput_Pos"
Name 39 "param"
Name 41 "param"
Name 45 "PerVertex_out"
MemberName 45(PerVertex_out) 0 "@entryPointOutput_Pos"
Name 47 "PerVertex_out"
Decorate 31(Pos_in) BuiltIn Position
Decorate 35(Pos_loose) BuiltIn Position
Decorate 38(@entryPointOutput_Pos) BuiltIn Position
MemberDecorate 45(PerVertex_out) 0 BuiltIn Position
Decorate 45(PerVertex_out) Block
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -141,55 +138,48 @@ Shader version: 450
10: TypePointer Function 7(fvec4)
11(VS_OUTPUT): TypeStruct 7(fvec4)
12: TypeFunction 11(VS_OUTPUT) 9(ptr) 10(ptr)
17(VS_OUTPUT): TypeStruct 7(fvec4)
18: TypePointer Function 17(VS_OUTPUT)
20: TypeInt 32 1
21: 20(int) Constant 0
28: TypePointer Function 11(VS_OUTPUT)
36: TypePointer Input 7(fvec4)
37(Pos_in): 36(ptr) Variable Input
41(Pos_loose): 36(ptr) Variable Input
43: TypePointer Output 7(fvec4)
44(@entryPointOutput_Pos): 43(ptr) Variable Output
51(PerVertex_out): TypeStruct 7(fvec4)
52: TypePointer Output 51(PerVertex_out)
53(PerVertex_out): 52(ptr) Variable Output
17: TypePointer Function 11(VS_OUTPUT)
19: TypeInt 32 1
20: 19(int) Constant 0
30: TypePointer Input 7(fvec4)
31(Pos_in): 30(ptr) Variable Input
35(Pos_loose): 30(ptr) Variable Input
37: TypePointer Output 7(fvec4)
38(@entryPointOutput_Pos): 37(ptr) Variable Output
45(PerVertex_out): TypeStruct 7(fvec4)
46: TypePointer Output 45(PerVertex_out)
47(PerVertex_out): 46(ptr) Variable Output
4(main): 2 Function None 3
5: Label
35(vsin): 9(ptr) Variable Function
40(Pos_loose): 10(ptr) Variable Function
45(param): 9(ptr) Variable Function
47(param): 10(ptr) Variable Function
38: 7(fvec4) Load 37(Pos_in)
39: 10(ptr) AccessChain 35(vsin) 21
Store 39 38
42: 7(fvec4) Load 41(Pos_loose)
Store 40(Pos_loose) 42
46: 8(VS_INPUT) Load 35(vsin)
Store 45(param) 46
48: 7(fvec4) Load 40(Pos_loose)
Store 47(param) 48
49:11(VS_OUTPUT) FunctionCall 15(@main(struct-VS_INPUT-vf41;vf4;) 45(param) 47(param)
50: 7(fvec4) CompositeExtract 49 0
Store 44(@entryPointOutput_Pos) 50
29(vsin): 9(ptr) Variable Function
34(Pos_loose): 10(ptr) Variable Function
39(param): 9(ptr) Variable Function
41(param): 10(ptr) Variable Function
32: 7(fvec4) Load 31(Pos_in)
33: 10(ptr) AccessChain 29(vsin) 20
Store 33 32
36: 7(fvec4) Load 35(Pos_loose)
Store 34(Pos_loose) 36
40: 8(VS_INPUT) Load 29(vsin)
Store 39(param) 40
42: 7(fvec4) Load 34(Pos_loose)
Store 41(param) 42
43:11(VS_OUTPUT) FunctionCall 15(@main(struct-VS_INPUT-vf41;vf4;) 39(param) 41(param)
44: 7(fvec4) CompositeExtract 43 0
Store 38(@entryPointOutput_Pos) 44
Return
FunctionEnd
15(@main(struct-VS_INPUT-vf41;vf4;):11(VS_OUTPUT) Function None 12
13(vsin): 9(ptr) FunctionParameter
14(Pos_loose): 10(ptr) FunctionParameter
16: Label
19(vsout): 18(ptr) Variable Function
29: 28(ptr) Variable Function
22: 10(ptr) AccessChain 13(vsin) 21
23: 7(fvec4) Load 22
24: 7(fvec4) Load 14(Pos_loose)
25: 7(fvec4) FAdd 23 24
26: 10(ptr) AccessChain 19(vsout) 21
Store 26 25
27:17(VS_OUTPUT) Load 19(vsout)
30: 7(fvec4) CompositeExtract 27 0
31: 10(ptr) AccessChain 29 21
Store 31 30
32:11(VS_OUTPUT) Load 29
ReturnValue 32
18(vsout): 17(ptr) Variable Function
21: 10(ptr) AccessChain 13(vsin) 20
22: 7(fvec4) Load 21
23: 7(fvec4) Load 14(Pos_loose)
24: 7(fvec4) FAdd 22 23
25: 10(ptr) AccessChain 18(vsout) 20
Store 25 24
26:11(VS_OUTPUT) Load 18(vsout)
ReturnValue 26
FunctionEnd