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

@@ -348,8 +348,11 @@ gl_FragCoord origin is upper left
0:139 Construct bool (in 1-component vector of bool)
0:139 Construct bvec3 (temp 3-component vector of bool)
0:139 'b' (temp bool)
0:141 Branch: Return with expression
0:141 'input' (in 4-component vector of float)
0:141 Sequence
0:141 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (out 4-component vector of float)
0:141 'input' (in 4-component vector of float)
0:141 Branch: Return
0:? Linker Objects
@@ -705,19 +708,22 @@ gl_FragCoord origin is upper left
0:139 Construct bool (in 1-component vector of bool)
0:139 Construct bvec3 (temp 3-component vector of bool)
0:139 'b' (temp bool)
0:141 Branch: Return with expression
0:141 'input' (in 4-component vector of float)
0:141 Sequence
0:141 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (out 4-component vector of float)
0:141 'input' (in 4-component vector of float)
0:141 Branch: Return
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 507
// Id's are bound by 509
Capability Shader
Capability Float64
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 504
EntryPoint Fragment 4 "PixelShaderFunction" 504 506
ExecutionMode 4 OriginUpperLeft
Name 4 "PixelShaderFunction"
Name 13 "foo1(d1;b1;"
@@ -901,7 +907,8 @@ gl_FragCoord origin is upper left
Name 491 "param"
Name 494 "param"
Name 500 "param"
Name 504 "input"
Name 504 "@entryPointOutput"
Name 506 "input"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 64
@@ -953,8 +960,10 @@ gl_FragCoord origin is upper left
488: TypeVector 22(int) 4
497: TypeVector 8(bool) 3
502: TypeVector 29(float) 4
503: TypePointer Input 502(fvec4)
504(input): 503(ptr) Variable Input
503: TypePointer Output 502(fvec4)
504(@entryPointOutput): 503(ptr) Variable Output
505: TypePointer Input 502(fvec4)
506(input): 505(ptr) Variable Input
4(PixelShaderFunction): 2 Function None 3
5: Label
149(d): 7(ptr) Variable Function
@@ -1401,8 +1410,9 @@ gl_FragCoord origin is upper left
499: 8(bool) CompositeExtract 498 0
Store 500(param) 499
501: 2 FunctionCall 147(foo15(vb1;) 500(param)
505: 502(fvec4) Load 504(input)
ReturnValue 505
507: 502(fvec4) Load 506(input)
Store 504(@entryPointOutput) 507
Return
FunctionEnd
13(foo1(d1;b1;): 2 Function None 10
11(a): 7(ptr) FunctionParameter