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,15 +2,22 @@ hlsl.string.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:10 Function Definition: main(f1; (temp float)
0:10 Function Definition: @main(f1; (temp float)
0:10 Function Parameters:
0:10 'f' (layout(location=0 ) in float)
0:10 'f' (in float)
0:? Sequence
0:11 Sequence
0:11 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:11 'f' (layout(location=0 ) in float)
0:11 Branch: Return
0:11 Branch: Return with expression
0:11 'f' (in float)
0:10 Function Definition: main( (temp void)
0:10 Function Parameters:
0:? Sequence
0:10 move second child to first child (temp float)
0:? 'f' (temp float)
0:? 'f' (layout(location=0 ) in float)
0:10 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:10 Function Call: @main(f1; (temp float)
0:? 'f' (temp float)
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:? 'f' (layout(location=0 ) in float)
@ -22,43 +29,68 @@ Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:10 Function Definition: main(f1; (temp float)
0:10 Function Definition: @main(f1; (temp float)
0:10 Function Parameters:
0:10 'f' (layout(location=0 ) in float)
0:10 'f' (in float)
0:? Sequence
0:11 Sequence
0:11 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:11 'f' (layout(location=0 ) in float)
0:11 Branch: Return
0:11 Branch: Return with expression
0:11 'f' (in float)
0:10 Function Definition: main( (temp void)
0:10 Function Parameters:
0:? Sequence
0:10 move second child to first child (temp float)
0:? 'f' (temp float)
0:? 'f' (layout(location=0 ) in float)
0:10 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:10 Function Call: @main(f1; (temp float)
0:? 'f' (temp float)
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:? 'f' (layout(location=0 ) in float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 13
// Id's are bound by 24
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 8 10
EntryPoint Fragment 4 "main" 17 20
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "@entryPointOutput"
Name 10 "f"
Decorate 8(@entryPointOutput) Location 0
Decorate 10(f) Location 0
Name 10 "@main(f1;"
Name 9 "f"
Name 15 "f"
Name 17 "f"
Name 20 "@entryPointOutput"
Name 21 "param"
Decorate 17(f) Location 0
Decorate 20(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Output 6(float)
8(@entryPointOutput): 7(ptr) Variable Output
9: TypePointer Input 6(float)
10(f): 9(ptr) Variable Input
7: TypePointer Function 6(float)
8: TypeFunction 6(float) 7(ptr)
16: TypePointer Input 6(float)
17(f): 16(ptr) Variable Input
19: TypePointer Output 6(float)
20(@entryPointOutput): 19(ptr) Variable Output
4(main): 2 Function None 3
5: Label
11: 6(float) Load 10(f)
Store 8(@entryPointOutput) 11
15(f): 7(ptr) Variable Function
21(param): 7(ptr) Variable Function
18: 6(float) Load 17(f)
Store 15(f) 18
22: 6(float) Load 15(f)
Store 21(param) 22
23: 6(float) FunctionCall 10(@main(f1;) 21(param)
Store 20(@entryPointOutput) 23
Return
FunctionEnd
10(@main(f1;): 6(float) Function None 8
9(f): 7(ptr) FunctionParameter
11: Label
12: 6(float) Load 9(f)
ReturnValue 12
FunctionEnd