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

@ -58,8 +58,11 @@ gl_FragCoord origin is upper left
0:18 Construct vec4 (temp 4-component vector of float)
0:18 Convert int to float (temp float)
0:18 'r07' (temp int)
0:19 Branch: Return with expression
0:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:19 Sequence
0:19 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:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:19 Branch: Return
0:? Linker Objects
@ -125,18 +128,21 @@ gl_FragCoord origin is upper left
0:18 Construct vec4 (temp 4-component vector of float)
0:18 Convert int to float (temp float)
0:18 'r07' (temp int)
0:19 Branch: Return with expression
0:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:19 Sequence
0:19 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:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:19 Branch: Return
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 41
// Id's are bound by 43
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
EntryPoint Fragment 4 "main" 40
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "r00"
@ -151,6 +157,7 @@ gl_FragCoord origin is upper left
Name 30 "PS_OUTPUT"
MemberName 30(PS_OUTPUT) 0 "color"
Name 32 "ps_output"
Name 40 "@entryPointOutput"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -172,6 +179,8 @@ gl_FragCoord origin is upper left
31: TypePointer Function 30(PS_OUTPUT)
33: 19(int) Constant 0
37: TypePointer Function 29(fvec4)
39: TypePointer Output 30(PS_OUTPUT)
40(@entryPointOutput): 39(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(r00): 7(ptr) Variable Function
@ -198,6 +207,7 @@ gl_FragCoord origin is upper left
36: 29(fvec4) CompositeConstruct 35 35 35 35
38: 37(ptr) AccessChain 32(ps_output) 33
Store 38 36
39:30(PS_OUTPUT) Load 32(ps_output)
ReturnValue 39
41:30(PS_OUTPUT) Load 32(ps_output)
Store 40(@entryPointOutput) 41
Return
FunctionEnd