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

@ -6,7 +6,7 @@ gl_FragCoord origin is upper left
0:2 Function Parameters:
0:8 Function Definition: MyFunc2( (temp void)
0:8 Function Parameters:
0:13 Function Definition: main( (temp structure{temp 4-component vector of float color})
0:13 Function Definition: @main( (temp structure{temp 4-component vector of float color})
0:13 Function Parameters:
0:? Sequence
0:16 move second child to first child (temp 4-component vector of float)
@ -19,15 +19,18 @@ gl_FragCoord origin is upper left
0:16 1.000000
0:16 1.000000
0:16 1.000000
0:17 Sequence
0:17 Sequence
0:17 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:17 color: direct index for structure (temp 4-component vector of float)
0:17 'ps_output' (temp structure{temp 4-component vector of float color})
0:17 Constant:
0:17 0 (const int)
0:17 Branch: Return
0:17 Branch: Return with expression
0:17 'ps_output' (temp structure{temp 4-component vector of float color})
0:13 Function Definition: main( (temp void)
0:13 Function Parameters:
0:? Sequence
0:13 Sequence
0:13 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:13 color: direct index for structure (temp 4-component vector of float)
0:13 Function Call: @main( (temp structure{temp 4-component vector of float color})
0:13 Constant:
0:13 0 (const int)
0:? Linker Objects
0:? 'color' (layout(location=0 ) out 4-component vector of float)
@ -42,7 +45,7 @@ gl_FragCoord origin is upper left
0:2 Function Parameters:
0:8 Function Definition: MyFunc2( (temp void)
0:8 Function Parameters:
0:13 Function Definition: main( (temp structure{temp 4-component vector of float color})
0:13 Function Definition: @main( (temp structure{temp 4-component vector of float color})
0:13 Function Parameters:
0:? Sequence
0:16 move second child to first child (temp 4-component vector of float)
@ -55,56 +58,58 @@ gl_FragCoord origin is upper left
0:16 1.000000
0:16 1.000000
0:16 1.000000
0:17 Sequence
0:17 Sequence
0:17 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:17 color: direct index for structure (temp 4-component vector of float)
0:17 'ps_output' (temp structure{temp 4-component vector of float color})
0:17 Constant:
0:17 0 (const int)
0:17 Branch: Return
0:17 Branch: Return with expression
0:17 'ps_output' (temp structure{temp 4-component vector of float color})
0:13 Function Definition: main( (temp void)
0:13 Function Parameters:
0:? Sequence
0:13 Sequence
0:13 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:13 color: direct index for structure (temp 4-component vector of float)
0:13 Function Call: @main( (temp structure{temp 4-component vector of float color})
0:13 Constant:
0:13 0 (const int)
0:? Linker Objects
0:? 'color' (layout(location=0 ) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 26
// Id's are bound by 31
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 22
EntryPoint Fragment 4 "main" 28
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 6 "MyFunc("
Name 8 "MyFunc2("
Name 12 "PS_OUTPUT"
MemberName 12(PS_OUTPUT) 0 "color"
Name 14 "ps_output"
Name 22 "color"
Decorate 22(color) Location 0
Name 14 "@main("
Name 17 "ps_output"
Name 28 "color"
Decorate 28(color) Location 0
2: TypeVoid
3: TypeFunction 2
10: TypeFloat 32
11: TypeVector 10(float) 4
12(PS_OUTPUT): TypeStruct 11(fvec4)
13: TypePointer Function 12(PS_OUTPUT)
15: TypeInt 32 1
16: 15(int) Constant 0
17: 10(float) Constant 1065353216
18: 11(fvec4) ConstantComposite 17 17 17 17
19: TypePointer Function 11(fvec4)
21: TypePointer Output 11(fvec4)
22(color): 21(ptr) Variable Output
13: TypeFunction 12(PS_OUTPUT)
16: TypePointer Function 12(PS_OUTPUT)
18: TypeInt 32 1
19: 18(int) Constant 0
20: 10(float) Constant 1065353216
21: 11(fvec4) ConstantComposite 20 20 20 20
22: TypePointer Function 11(fvec4)
27: TypePointer Output 11(fvec4)
28(color): 27(ptr) Variable Output
4(main): 2 Function None 3
5: Label
14(ps_output): 13(ptr) Variable Function
20: 19(ptr) AccessChain 14(ps_output) 16
Store 20 18
23: 19(ptr) AccessChain 14(ps_output) 16
24: 11(fvec4) Load 23
Store 22(color) 24
29:12(PS_OUTPUT) FunctionCall 14(@main()
30: 11(fvec4) CompositeExtract 29 0
Store 28(color) 30
Return
FunctionEnd
6(MyFunc(): 2 Function None 3
@ -115,3 +120,11 @@ gl_FragCoord origin is upper left
9: Label
Return
FunctionEnd
14(@main():12(PS_OUTPUT) Function None 13
15: Label
17(ps_output): 16(ptr) Variable Function
23: 22(ptr) AccessChain 17(ps_output) 19
Store 23 21
24:12(PS_OUTPUT) Load 17(ps_output)
ReturnValue 24
FunctionEnd