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

@ -496,8 +496,11 @@ gl_FragCoord origin is upper left
0:199 Constant:
0:199 0 (const int)
0:199 'outval' (temp 4-component vector of float)
0:200 Branch: Return with expression
0:200 'psout' (temp structure{temp 4-component vector of float Color})
0:200 Sequence
0:200 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:200 'psout' (temp structure{temp 4-component vector of float Color})
0:200 Branch: Return
0:? Linker Objects
0:? 'i3' (uniform 3-component vector of int)
0:? 'b3' (uniform 3-component vector of bool)
@ -1011,8 +1014,11 @@ gl_FragCoord origin is upper left
0:199 Constant:
0:199 0 (const int)
0:199 'outval' (temp 4-component vector of float)
0:200 Branch: Return with expression
0:200 'psout' (temp structure{temp 4-component vector of float Color})
0:200 Sequence
0:200 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:200 'psout' (temp structure{temp 4-component vector of float Color})
0:200 Branch: Return
0:? Linker Objects
0:? 'i3' (uniform 3-component vector of int)
0:? 'b3' (uniform 3-component vector of bool)
@ -1027,13 +1033,13 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 478
// Id's are bound by 480
Capability Shader
Capability Float64
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
EntryPoint Fragment 4 "main" 477
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 11 "Fn_F3(vf3;"
@ -1122,6 +1128,7 @@ gl_FragCoord origin is upper left
Name 471 "PS_OUTPUT"
MemberName 471(PS_OUTPUT) 0 "Color"
Name 473 "psout"
Name 477 "@entryPointOutput"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -1192,6 +1199,8 @@ gl_FragCoord origin is upper left
465: 6(float) Constant 1080452710
471(PS_OUTPUT): TypeStruct 462(fvec4)
472: TypePointer Function 471(PS_OUTPUT)
476: TypePointer Output 471(PS_OUTPUT)
477(@entryPointOutput): 476(ptr) Variable Output
4(main): 2 Function None 3
5: Label
252(r00): 8(ptr) Variable Function
@ -1457,8 +1466,9 @@ gl_FragCoord origin is upper left
474: 462(fvec4) Load 464(outval)
475: 463(ptr) AccessChain 473(psout) 149
Store 475 474
476:471(PS_OUTPUT) Load 473(psout)
ReturnValue 476
478:471(PS_OUTPUT) Load 473(psout)
Store 477(@entryPointOutput) 478
Return
FunctionEnd
11(Fn_F3(vf3;): 2 Function None 9
10(x): 8(ptr) FunctionParameter