HLSL: Emulate write-to-output on return-from-entry-point, for return value.

This fixes issue #487 and #480.
It also correctly handles output parameters from the entry point.
This commit is contained in:
John Kessenich 2016-08-28 15:00:23 -06:00
parent 81cd764b5f
commit 6a70eb7161
91 changed files with 5158 additions and 4130 deletions

View file

@ -34,8 +34,11 @@ gl_FragCoord origin is upper left
0:15 1.000000
0:15 1.000000
0:15 1.000000
0:16 Branch: Return with expression
0:16 'ps_output' (temp structure{temp 4-component vector of float color})
0:16 Sequence
0:16 move second child to first child (temp structure{temp 4-component vector of float color})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float color})
0:16 'ps_output' (temp structure{temp 4-component vector of float color})
0:16 Branch: Return
0:? Linker Objects
@ -77,23 +80,27 @@ gl_FragCoord origin is upper left
0:15 1.000000
0:15 1.000000
0:15 1.000000
0:16 Branch: Return with expression
0:16 'ps_output' (temp structure{temp 4-component vector of float color})
0:16 Sequence
0:16 move second child to first child (temp structure{temp 4-component vector of float color})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float color})
0:16 'ps_output' (temp structure{temp 4-component vector of float color})
0:16 Branch: Return
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 32
// Id's are bound by 34
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
EntryPoint Fragment 4 "main" 31
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 22 "PS_OUTPUT"
MemberName 22(PS_OUTPUT) 0 "color"
Name 24 "ps_output"
Name 31 "@entryPointOutput"
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@ -118,11 +125,14 @@ gl_FragCoord origin is upper left
26: 13(float) Constant 1065353216
27: 21(fvec4) ConstantComposite 26 26 26 26
28: TypePointer Function 21(fvec4)
30: TypePointer Output 22(PS_OUTPUT)
31(@entryPointOutput): 30(ptr) Variable Output
4(main): 2 Function None 3
5: Label
24(ps_output): 23(ptr) Variable Function
29: 28(ptr) AccessChain 24(ps_output) 25
Store 29 27
30:22(PS_OUTPUT) Load 24(ps_output)
ReturnValue 30
32:22(PS_OUTPUT) Load 24(ps_output)
Store 31(@entryPointOutput) 32
Return
FunctionEnd