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

@ -11,9 +11,12 @@ local_size = (1, 1, 1)
0:7 GroupMemoryBarrierWithGroupSync (global void)
0:8 WorkgroupMemoryBarrier (global void)
0:9 WorkgroupMemoryBarrierWithGroupSync (global void)
0:11 Branch: Return with expression
0:11 Constant:
0:11 0.000000
0:11 Sequence
0:11 move second child to first child (temp float)
0:? '@entryPointOutput' (out float)
0:11 Constant:
0:11 0.000000
0:11 Branch: Return
0:? Linker Objects
@ -32,21 +35,25 @@ local_size = (1, 1, 1)
0:7 GroupMemoryBarrierWithGroupSync (global void)
0:8 WorkgroupMemoryBarrier (global void)
0:9 WorkgroupMemoryBarrierWithGroupSync (global void)
0:11 Branch: Return with expression
0:11 Constant:
0:11 0.000000
0:11 Sequence
0:11 move second child to first child (temp float)
0:? '@entryPointOutput' (out float)
0:11 Constant:
0:11 0.000000
0:11 Branch: Return
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 15
// Id's are bound by 17
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "ComputeShaderFunction"
EntryPoint GLCompute 4 "ComputeShaderFunction" 14
ExecutionMode 4 LocalSize 1 1 1
Name 4 "ComputeShaderFunction"
Name 14 "@entryPointOutput"
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
@ -56,7 +63,9 @@ local_size = (1, 1, 1)
10: 6(int) Constant 2
11: 6(int) Constant 256
12: TypeFloat 32
13: 12(float) Constant 0
13: TypePointer Output 12(float)
14(@entryPointOutput): 13(ptr) Variable Output
15: 12(float) Constant 0
4(ComputeShaderFunction): 2 Function None 3
5: Label
MemoryBarrier 7 8
@ -65,5 +74,6 @@ local_size = (1, 1, 1)
ControlBarrier 7 7 9
MemoryBarrier 10 11
ControlBarrier 10 10 11
ReturnValue 13
Store 14(@entryPointOutput) 15
Return
FunctionEnd