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

@@ -223,8 +223,11 @@ gl_FragCoord origin is upper left
0:48 1 (const int)
0:48 Constant:
0:48 1.000000
0:50 Branch: Return with expression
0:50 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:50 Sequence
0:50 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:50 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:50 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
@@ -469,8 +472,11 @@ gl_FragCoord origin is upper left
0:48 1 (const int)
0:48 Constant:
0:48 1.000000
0:50 Branch: Return with expression
0:50 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:50 Sequence
0:50 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:50 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:50 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
@@ -489,13 +495,13 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 161
// Id's are bound by 163
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
EntryPoint Fragment 4 "main" 159
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval10"
@@ -527,7 +533,8 @@ gl_FragCoord origin is upper left
MemberName 148(PS_OUTPUT) 0 "Color"
MemberName 148(PS_OUTPUT) 1 "Depth"
Name 150 "psout"
Name 160 "g_tTex1df4a"
Name 159 "@entryPointOutput"
Name 162 "g_tTex1df4a"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 16(g_sSamp) DescriptorSet 0
@@ -544,8 +551,8 @@ gl_FragCoord origin is upper left
Decorate 133(g_tTexcdi4) DescriptorSet 0
Decorate 142(g_tTexcdu4) DescriptorSet 0
MemberDecorate 148(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 160(g_tTex1df4a) DescriptorSet 0
Decorate 160(g_tTex1df4a) Binding 1
Decorate 162(g_tTex1df4a) DescriptorSet 0
Decorate 162(g_tTex1df4a) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -637,7 +644,9 @@ gl_FragCoord origin is upper left
153: 7(fvec4) ConstantComposite 152 152 152 152
155: 24(int) Constant 1
156: TypePointer Function 6(float)
160(g_tTex1df4a): 11(ptr) Variable UniformConstant
158: TypePointer Output 148(PS_OUTPUT)
159(@entryPointOutput): 158(ptr) Variable Output
162(g_tTex1df4a): 11(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval10): 8(ptr) Variable Function
@@ -717,6 +726,7 @@ gl_FragCoord origin is upper left
Store 154 153
157: 156(ptr) AccessChain 150(psout) 155
Store 157 152
158:148(PS_OUTPUT) Load 150(psout)
ReturnValue 158
160:148(PS_OUTPUT) Load 150(psout)
Store 159(@entryPointOutput) 160
Return
FunctionEnd