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

@@ -64,8 +64,11 @@ gl_FragCoord origin is upper left
0:33 1 (const int)
0:33 Constant:
0:33 1.000000
0:35 Branch: Return with expression
0:35 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:35 Sequence
0:35 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:35 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:35 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -145,8 +148,11 @@ gl_FragCoord origin is upper left
0:33 1 (const int)
0:33 Constant:
0:33 1.000000
0:35 Branch: Return with expression
0:35 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:35 Sequence
0:35 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:35 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:35 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -159,13 +165,13 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 83
// Id's are bound by 85
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
EntryPoint Fragment 4 "main" 72
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval20"
@@ -179,22 +185,23 @@ gl_FragCoord origin is upper left
MemberName 63(PS_OUTPUT) 0 "Color"
MemberName 63(PS_OUTPUT) 1 "Depth"
Name 65 "psout"
Name 75 "g_tTex1df4a"
Name 76 "g_tTex1df4"
Name 79 "g_tTex1di4"
Name 82 "g_tTex1du4"
Name 72 "@entryPointOutput"
Name 77 "g_tTex1df4a"
Name 78 "g_tTex1df4"
Name 81 "g_tTex1di4"
Name 84 "g_tTex1du4"
Decorate 12(g_tTex2df4) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
Decorate 36(g_tTex2di4) DescriptorSet 0
Decorate 51(g_tTex2du4) DescriptorSet 0
MemberDecorate 63(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 75(g_tTex1df4a) DescriptorSet 0
Decorate 75(g_tTex1df4a) Binding 1
Decorate 76(g_tTex1df4) DescriptorSet 0
Decorate 76(g_tTex1df4) Binding 0
Decorate 79(g_tTex1di4) DescriptorSet 0
Decorate 82(g_tTex1du4) DescriptorSet 0
Decorate 77(g_tTex1df4a) DescriptorSet 0
Decorate 77(g_tTex1df4a) Binding 1
Decorate 78(g_tTex1df4) DescriptorSet 0
Decorate 78(g_tTex1df4) Binding 0
Decorate 81(g_tTex1di4) DescriptorSet 0
Decorate 84(g_tTex1du4) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -244,16 +251,18 @@ gl_FragCoord origin is upper left
66: 6(float) Constant 1065353216
67: 7(fvec4) ConstantComposite 66 66 66 66
69: TypePointer Function 6(float)
73: TypeImage 6(float) 1D array sampled format:Unknown
74: TypePointer UniformConstant 73
75(g_tTex1df4a): 74(ptr) Variable UniformConstant
76(g_tTex1df4): 74(ptr) Variable UniformConstant
77: TypeImage 25(int) 1D array sampled format:Unknown
78: TypePointer UniformConstant 77
79(g_tTex1di4): 78(ptr) Variable UniformConstant
80: TypeImage 45(int) 1D array sampled format:Unknown
81: TypePointer UniformConstant 80
82(g_tTex1du4): 81(ptr) Variable UniformConstant
71: TypePointer Output 63(PS_OUTPUT)
72(@entryPointOutput): 71(ptr) Variable Output
75: TypeImage 6(float) 1D array sampled format:Unknown
76: TypePointer UniformConstant 75
77(g_tTex1df4a): 76(ptr) Variable UniformConstant
78(g_tTex1df4): 76(ptr) Variable UniformConstant
79: TypeImage 25(int) 1D array sampled format:Unknown
80: TypePointer UniformConstant 79
81(g_tTex1di4): 80(ptr) Variable UniformConstant
82: TypeImage 45(int) 1D array sampled format:Unknown
83: TypePointer UniformConstant 82
84(g_tTex1du4): 83(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval20): 8(ptr) Variable Function
@@ -279,6 +288,7 @@ gl_FragCoord origin is upper left
Store 68 67
70: 69(ptr) AccessChain 65(psout) 27
Store 70 66
71:63(PS_OUTPUT) Load 65(psout)
ReturnValue 71
73:63(PS_OUTPUT) Load 65(psout)
Store 72(@entryPointOutput) 73
Return
FunctionEnd