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

@ -299,12 +299,15 @@ local_size = (1, 1, 1)
0:125 AtomicXor (temp 4-component vector of uint)
0:125 'gs_ua4' (global 4-component vector of uint)
0:125 'gs_ub4' (global 4-component vector of uint)
0:128 Branch: Return with expression
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:128 Sequence
0:128 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (out 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:128 Branch: Return
0:? Linker Objects
0:? 'gs_ua' (global uint)
0:? 'gs_ub' (global uint)
@ -623,12 +626,15 @@ local_size = (1, 1, 1)
0:125 AtomicXor (temp 4-component vector of uint)
0:125 'gs_ua4' (global 4-component vector of uint)
0:125 'gs_ub4' (global 4-component vector of uint)
0:128 Branch: Return with expression
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:128 Sequence
0:128 move second child to first child (temp 4-component vector of float)
0:? '@entryPointOutput' (out 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 2.000000
0:? 3.000000
0:? 4.000000
0:128 Branch: Return
0:? Linker Objects
0:? 'gs_ua' (global uint)
0:? 'gs_ub' (global uint)
@ -645,12 +651,12 @@ local_size = (1, 1, 1)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 217
// Id's are bound by 219
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "ComputeShaderFunction" 175
EntryPoint GLCompute 4 "ComputeShaderFunction" 175 215
ExecutionMode 4 LocalSize 1 1 1
Name 4 "ComputeShaderFunction"
Name 16 "ComputeShaderFunctionS(f1;f1;f1;u1;u1;"
@ -692,6 +698,7 @@ local_size = (1, 1, 1)
Name 181 "gs_ub4"
Name 185 "out_u4"
Name 193 "gs_uc4"
Name 215 "@entryPointOutput"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -740,8 +747,10 @@ local_size = (1, 1, 1)
181(gs_ub4): 179(ptr) Variable Private
184: TypePointer Function 178(ivec4)
193(gs_uc4): 179(ptr) Variable Private
214: 6(float) Constant 1082130432
215: 173(fvec4) ConstantComposite 128 129 169 214
214: TypePointer Output 173(fvec4)
215(@entryPointOutput): 214(ptr) Variable Output
216: 6(float) Constant 1082130432
217: 173(fvec4) ConstantComposite 128 129 169 216
4(ComputeShaderFunction): 2 Function None 3
5: Label
185(out_u4): 184(ptr) Variable Function
@ -784,7 +793,8 @@ local_size = (1, 1, 1)
212: 178(ivec4) Load 181(gs_ub4)
213: 178(ivec4) AtomicXor 180(gs_ua4) 55 56 212
Store 185(out_u4) 213
ReturnValue 215
Store 215(@entryPointOutput) 217
Return
FunctionEnd
16(ComputeShaderFunctionS(f1;f1;f1;u1;u1;): 6(float) Function None 10
11(inF0): 7(ptr) FunctionParameter