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.basic.comp
Shader version: 450
local_size = (1, 1, 1)
0:? Sequence
0:4 Function Definition: main(i1;i1; (temp void)
0:4 Function Definition: @main(i1;i1; (temp void)
0:4 Function Parameters:
0:4 'dti' (in int GlobalInvocationID)
0:4 'gti' (in int LocalInvocationID)
@@ -10,10 +10,22 @@ local_size = (1, 1, 1)
0:5 subtract (temp int)
0:5 'dti' (in int GlobalInvocationID)
0:5 'gti' (in int LocalInvocationID)
0:4 Function Definition: main( (temp void)
0:4 Function Parameters:
0:? Sequence
0:4 move second child to first child (temp int)
0:? 'dti' (temp int)
0:? 'dti' (in int GlobalInvocationID)
0:4 move second child to first child (temp int)
0:? 'gti' (temp int)
0:? 'gti' (in int LocalInvocationID)
0:4 Function Call: @main(i1;i1; (temp void)
0:? 'dti' (temp int)
0:? 'gti' (temp int)
0:? Linker Objects
0:? 'a' (shared 100-element array of 4-component vector of float)
0:? 'dti' (in int GlobalInvocationID)
0:? 'gti' (in int LocalInvocationID)
0:? 'a' (shared 100-element array of 4-component vector of float)
Linked compute stage:
@@ -22,7 +34,7 @@ Linked compute stage:
Shader version: 450
local_size = (1, 1, 1)
0:? Sequence
0:4 Function Definition: main(i1;i1; (temp void)
0:4 Function Definition: @main(i1;i1; (temp void)
0:4 Function Parameters:
0:4 'dti' (in int GlobalInvocationID)
0:4 'gti' (in int LocalInvocationID)
@@ -30,43 +42,83 @@ local_size = (1, 1, 1)
0:5 subtract (temp int)
0:5 'dti' (in int GlobalInvocationID)
0:5 'gti' (in int LocalInvocationID)
0:4 Function Definition: main( (temp void)
0:4 Function Parameters:
0:? Sequence
0:4 move second child to first child (temp int)
0:? 'dti' (temp int)
0:? 'dti' (in int GlobalInvocationID)
0:4 move second child to first child (temp int)
0:? 'gti' (temp int)
0:? 'gti' (in int LocalInvocationID)
0:4 Function Call: @main(i1;i1; (temp void)
0:? 'dti' (temp int)
0:? 'gti' (temp int)
0:? Linker Objects
0:? 'a' (shared 100-element array of 4-component vector of float)
0:? 'dti' (in int GlobalInvocationID)
0:? 'gti' (in int LocalInvocationID)
0:? 'a' (shared 100-element array of 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 20
// Id's are bound by 35
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 8 10
EntryPoint GLCompute 4 "main" 18 21
ExecutionMode 4 LocalSize 1 1 1
Name 4 "main"
Name 8 "dti"
Name 11 "@main(i1;i1;"
Name 9 "dti"
Name 10 "gti"
Name 19 "a"
Decorate 8(dti) BuiltIn GlobalInvocationId
Decorate 10(gti) BuiltIn LocalInvocationId
Name 16 "dti"
Name 18 "dti"
Name 20 "gti"
Name 21 "gti"
Name 23 "param"
Name 25 "param"
Name 34 "a"
Decorate 18(dti) BuiltIn GlobalInvocationId
Decorate 21(gti) BuiltIn LocalInvocationId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Input 6(int)
8(dti): 7(ptr) Variable Input
10(gti): 7(ptr) Variable Input
13: TypeFloat 32
14: TypeVector 13(float) 4
15: TypeInt 32 0
16: 15(int) Constant 100
17: TypeArray 14(fvec4) 16
18: TypePointer Workgroup 17
19(a): 18(ptr) Variable Workgroup
7: TypePointer Function 6(int)
8: TypeFunction 2 7(ptr) 7(ptr)
17: TypePointer Input 6(int)
18(dti): 17(ptr) Variable Input
21(gti): 17(ptr) Variable Input
28: TypeFloat 32
29: TypeVector 28(float) 4
30: TypeInt 32 0
31: 30(int) Constant 100
32: TypeArray 29(fvec4) 31
33: TypePointer Workgroup 32
34(a): 33(ptr) Variable Workgroup
4(main): 2 Function None 3
5: Label
9: 6(int) Load 8(dti)
11: 6(int) Load 10(gti)
12: 6(int) ISub 9 11
16(dti): 7(ptr) Variable Function
20(gti): 7(ptr) Variable Function
23(param): 7(ptr) Variable Function
25(param): 7(ptr) Variable Function
19: 6(int) Load 18(dti)
Store 16(dti) 19
22: 6(int) Load 21(gti)
Store 20(gti) 22
24: 6(int) Load 16(dti)
Store 23(param) 24
26: 6(int) Load 20(gti)
Store 25(param) 26
27: 2 FunctionCall 11(@main(i1;i1;) 23(param) 25(param)
Return
FunctionEnd
11(@main(i1;i1;): 2 Function None 8
9(dti): 7(ptr) FunctionParameter
10(gti): 7(ptr) FunctionParameter
12: Label
13: 6(int) Load 9(dti)
14: 6(int) Load 10(gti)
15: 6(int) ISub 13 14
Return
FunctionEnd