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

@ -124,10 +124,13 @@ gl_FragCoord origin is upper left
0:33 move second child to first child (temp float)
0:33 'a9' (temp float)
0:33 'a5' (global float)
0:35 Branch: Return with expression
0:35 component-wise multiply (temp 4-component vector of float)
0:35 'input' (in 4-component vector of float)
0:35 'a1' (global 4-component vector of float)
0:35 Sequence
0:35 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (out 4-component vector of float)
0:35 component-wise multiply (temp 4-component vector of float)
0:35 'input' (in 4-component vector of float)
0:35 'a1' (global 4-component vector of float)
0:35 Branch: Return
0:? Linker Objects
0:? 'a1' (global 4-component vector of float)
0:? 'b1' (global 4-component vector of float)
@ -277,10 +280,13 @@ gl_FragCoord origin is upper left
0:33 move second child to first child (temp float)
0:33 'a9' (temp float)
0:33 'a5' (global float)
0:35 Branch: Return with expression
0:35 component-wise multiply (temp 4-component vector of float)
0:35 'input' (in 4-component vector of float)
0:35 'a1' (global 4-component vector of float)
0:35 Sequence
0:35 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (out 4-component vector of float)
0:35 component-wise multiply (temp 4-component vector of float)
0:35 'input' (in 4-component vector of float)
0:35 'a1' (global 4-component vector of float)
0:35 Branch: Return
0:? Linker Objects
0:? 'a1' (global 4-component vector of float)
0:? 'b1' (global 4-component vector of float)
@ -303,12 +309,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 95
// Id's are bound by 97
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "ShaderFunction" 88
EntryPoint Fragment 4 "ShaderFunction" 88 90
ExecutionMode 4 OriginUpperLeft
Name 4 "ShaderFunction"
Name 9 "a1"
@ -347,9 +353,10 @@ gl_FragCoord origin is upper left
Name 82 "a8"
Name 83 "b2"
Name 85 "a9"
Name 88 "input"
Name 93 "c4"
Name 94 "b5"
Name 88 "@entryPointOutput"
Name 90 "input"
Name 95 "c4"
Name 96 "b5"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -418,10 +425,12 @@ gl_FragCoord origin is upper left
73: 32(int) Constant 12
81: TypePointer Function 6(float)
83(b2): 22(ptr) Variable Private
87: TypePointer Input 7(fvec4)
88(input): 87(ptr) Variable Input
93(c4): 22(ptr) Variable Private
94(b5): 22(ptr) Variable Private
87: TypePointer Output 7(fvec4)
88(@entryPointOutput): 87(ptr) Variable Output
89: TypePointer Input 7(fvec4)
90(input): 89(ptr) Variable Input
95(c4): 22(ptr) Variable Private
96(b5): 22(ptr) Variable Private
4(ShaderFunction): 2 Function None 3
5: Label
62(a2): 61(ptr) Variable Function
@ -457,8 +466,9 @@ gl_FragCoord origin is upper left
Store 82(a8) 84
86: 6(float) Load 29(a5)
Store 85(a9) 86
89: 7(fvec4) Load 88(input)
90: 7(fvec4) Load 9(a1)
91: 7(fvec4) FMul 89 90
ReturnValue 91
91: 7(fvec4) Load 90(input)
92: 7(fvec4) Load 9(a1)
93: 7(fvec4) FMul 91 92
Store 88(@entryPointOutput) 93
Return
FunctionEnd