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.intrinsics.barriers.comp
Shader version: 450
local_size = (1, 1, 1)
0:? Sequence
0:3 Function Definition: ComputeShaderFunction( (temp float)
0:3 Function Definition: @ComputeShaderFunction( (temp float)
0:3 Function Parameters:
0:? Sequence
0:4 MemoryBarrier (temp void)
@ -11,12 +11,15 @@ local_size = (1, 1, 1)
0:7 GroupMemoryBarrierWithGroupSync (temp void)
0:8 WorkgroupMemoryBarrier (temp void)
0:9 WorkgroupMemoryBarrierWithGroupSync (temp void)
0:11 Sequence
0:11 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:11 Constant:
0:11 0.000000
0:11 Branch: Return
0:11 Branch: Return with expression
0:11 Constant:
0:11 0.000000
0:3 Function Definition: ComputeShaderFunction( (temp void)
0:3 Function Parameters:
0:? Sequence
0:3 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:3 Function Call: @ComputeShaderFunction( (temp float)
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out float)
@ -27,7 +30,7 @@ Linked compute stage:
Shader version: 450
local_size = (1, 1, 1)
0:? Sequence
0:3 Function Definition: ComputeShaderFunction( (temp float)
0:3 Function Definition: @ComputeShaderFunction( (temp float)
0:3 Function Parameters:
0:? Sequence
0:4 MemoryBarrier (temp void)
@ -36,47 +39,57 @@ local_size = (1, 1, 1)
0:7 GroupMemoryBarrierWithGroupSync (temp void)
0:8 WorkgroupMemoryBarrier (temp void)
0:9 WorkgroupMemoryBarrierWithGroupSync (temp void)
0:11 Sequence
0:11 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:11 Constant:
0:11 0.000000
0:11 Branch: Return
0:11 Branch: Return with expression
0:11 Constant:
0:11 0.000000
0:3 Function Definition: ComputeShaderFunction( (temp void)
0:3 Function Parameters:
0:? Sequence
0:3 move second child to first child (temp float)
0:? '@entryPointOutput' (layout(location=0 ) out float)
0:3 Function Call: @ComputeShaderFunction( (temp float)
0:? Linker Objects
0:? '@entryPointOutput' (layout(location=0 ) out float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 17
// Id's are bound by 22
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "ComputeShaderFunction" 14
EntryPoint GLCompute 4 "ComputeShaderFunction" 20
ExecutionMode 4 LocalSize 1 1 1
Name 4 "ComputeShaderFunction"
Name 14 "@entryPointOutput"
Decorate 14(@entryPointOutput) Location 0
Name 8 "@ComputeShaderFunction("
Name 20 "@entryPointOutput"
Decorate 20(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: 6(int) Constant 1
8: 6(int) Constant 4048
9: 6(int) Constant 512
10: 6(int) Constant 2
11: 6(int) Constant 256
12: TypeFloat 32
13: TypePointer Output 12(float)
14(@entryPointOutput): 13(ptr) Variable Output
15: 12(float) Constant 0
6: TypeFloat 32
7: TypeFunction 6(float)
10: TypeInt 32 0
11: 10(int) Constant 1
12: 10(int) Constant 4048
13: 10(int) Constant 512
14: 10(int) Constant 2
15: 10(int) Constant 256
16: 6(float) Constant 0
19: TypePointer Output 6(float)
20(@entryPointOutput): 19(ptr) Variable Output
4(ComputeShaderFunction): 2 Function None 3
5: Label
MemoryBarrier 7 8
ControlBarrier 7 7 8
MemoryBarrier 7 9
ControlBarrier 7 7 9
MemoryBarrier 10 11
ControlBarrier 10 10 11
Store 14(@entryPointOutput) 15
21: 6(float) FunctionCall 8(@ComputeShaderFunction()
Store 20(@entryPointOutput) 21
Return
FunctionEnd
8(@ComputeShaderFunction(): 6(float) Function None 7
9: Label
MemoryBarrier 11 12
ControlBarrier 11 11 12
MemoryBarrier 11 13
ControlBarrier 11 11 13
MemoryBarrier 14 15
ControlBarrier 14 14 15
ReturnValue 16
FunctionEnd