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

@ -3,17 +3,20 @@ Shader version: 450
gl_FragCoord origin is upper left
using depth_less
0:? Sequence
0:2 Function Definition: PixelShaderFunction( (temp float FragDepth)
0:2 Function Definition: @PixelShaderFunction( (temp float unknown built-in variable)
0:2 Function Parameters:
0:? Sequence
0:3 Sequence
0:3 move second child to first child (temp float)
0:? '@entryPointOutput' (out float unknown built-in variable)
0:3 Constant:
0:3 0.200000
0:3 Branch: Return
0:3 Branch: Return with expression
0:3 Constant:
0:3 0.200000
0:2 Function Definition: PixelShaderFunction( (temp void)
0:2 Function Parameters:
0:? Sequence
0:2 move second child to first child (temp float)
0:? '@entryPointOutput' (out float FragDepth)
0:2 Function Call: @PixelShaderFunction( (temp float unknown built-in variable)
0:? Linker Objects
0:? '@entryPointOutput' (out float unknown built-in variable)
0:? '@entryPointOutput' (out float FragDepth)
Linked fragment stage:
@ -23,38 +26,49 @@ Shader version: 450
gl_FragCoord origin is upper left
using depth_less
0:? Sequence
0:2 Function Definition: PixelShaderFunction( (temp float FragDepth)
0:2 Function Definition: @PixelShaderFunction( (temp float unknown built-in variable)
0:2 Function Parameters:
0:? Sequence
0:3 Sequence
0:3 move second child to first child (temp float)
0:? '@entryPointOutput' (out float unknown built-in variable)
0:3 Constant:
0:3 0.200000
0:3 Branch: Return
0:3 Branch: Return with expression
0:3 Constant:
0:3 0.200000
0:2 Function Definition: PixelShaderFunction( (temp void)
0:2 Function Parameters:
0:? Sequence
0:2 move second child to first child (temp float)
0:? '@entryPointOutput' (out float FragDepth)
0:2 Function Call: @PixelShaderFunction( (temp float unknown built-in variable)
0:? Linker Objects
0:? '@entryPointOutput' (out float unknown built-in variable)
0:? '@entryPointOutput' (out float FragDepth)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 11
// Id's are bound by 16
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 8
EntryPoint Fragment 4 "PixelShaderFunction" 14
ExecutionMode 4 OriginUpperLeft
ExecutionMode 4 DepthLess
Name 4 "PixelShaderFunction"
Name 8 "@entryPointOutput"
Name 8 "@PixelShaderFunction("
Name 14 "@entryPointOutput"
Decorate 14(@entryPointOutput) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypePointer Output 6(float)
8(@entryPointOutput): 7(ptr) Variable Output
9: 6(float) Constant 1045220557
7: TypeFunction 6(float)
10: 6(float) Constant 1045220557
13: TypePointer Output 6(float)
14(@entryPointOutput): 13(ptr) Variable Output
4(PixelShaderFunction): 2 Function None 3
5: Label
Store 8(@entryPointOutput) 9
15: 6(float) FunctionCall 8(@PixelShaderFunction()
Store 14(@entryPointOutput) 15
Return
FunctionEnd
8(@PixelShaderFunction(): 6(float) Function None 7
9: Label
ReturnValue 10
FunctionEnd