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

@@ -130,8 +130,11 @@ gl_FragCoord origin is upper left
0:36 1 (const int)
0:36 Constant:
0:36 1.000000
0:38 Branch: Return with expression
0:38 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:38 Sequence
0:38 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:38 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:38 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -280,8 +283,11 @@ gl_FragCoord origin is upper left
0:36 1 (const int)
0:36 Constant:
0:36 1.000000
0:38 Branch: Return with expression
0:38 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:38 Sequence
0:38 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:38 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:38 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -297,14 +303,14 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 106
// Id's are bound by 108
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
EntryPoint Fragment 4 "main" 95
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval10"
@@ -324,10 +330,11 @@ gl_FragCoord origin is upper left
MemberName 86(PS_OUTPUT) 0 "Color"
MemberName 86(PS_OUTPUT) 1 "Depth"
Name 88 "psout"
Name 96 "g_tTex1df4a"
Name 99 "g_tTexcdf4"
Name 102 "g_tTexcdi4"
Name 105 "g_tTexcdu4"
Name 95 "@entryPointOutput"
Name 98 "g_tTex1df4a"
Name 101 "g_tTexcdf4"
Name 104 "g_tTexcdi4"
Name 107 "g_tTexcdu4"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 16(g_sSamp) DescriptorSet 0
@@ -338,11 +345,11 @@ gl_FragCoord origin is upper left
Decorate 71(g_tTex2di4) DescriptorSet 0
Decorate 80(g_tTex2du4) DescriptorSet 0
MemberDecorate 86(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 96(g_tTex1df4a) DescriptorSet 0
Decorate 96(g_tTex1df4a) Binding 1
Decorate 99(g_tTexcdf4) DescriptorSet 0
Decorate 102(g_tTexcdi4) DescriptorSet 0
Decorate 105(g_tTexcdu4) DescriptorSet 0
Decorate 98(g_tTex1df4a) DescriptorSet 0
Decorate 98(g_tTex1df4a) Binding 1
Decorate 101(g_tTexcdf4) DescriptorSet 0
Decorate 104(g_tTexcdi4) DescriptorSet 0
Decorate 107(g_tTexcdu4) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -400,16 +407,18 @@ gl_FragCoord origin is upper left
89: 6(float) Constant 1065353216
90: 7(fvec4) ConstantComposite 89 89 89 89
92: TypePointer Function 6(float)
96(g_tTex1df4a): 11(ptr) Variable UniformConstant
97: TypeImage 6(float) Cube array sampled format:Unknown
98: TypePointer UniformConstant 97
99(g_tTexcdf4): 98(ptr) Variable UniformConstant
100: TypeImage 26(int) Cube array sampled format:Unknown
101: TypePointer UniformConstant 100
102(g_tTexcdi4): 101(ptr) Variable UniformConstant
103: TypeImage 40(int) Cube array sampled format:Unknown
104: TypePointer UniformConstant 103
105(g_tTexcdu4): 104(ptr) Variable UniformConstant
94: TypePointer Output 86(PS_OUTPUT)
95(@entryPointOutput): 94(ptr) Variable Output
98(g_tTex1df4a): 11(ptr) Variable UniformConstant
99: TypeImage 6(float) Cube array sampled format:Unknown
100: TypePointer UniformConstant 99
101(g_tTexcdf4): 100(ptr) Variable UniformConstant
102: TypeImage 26(int) Cube array sampled format:Unknown
103: TypePointer UniformConstant 102
104(g_tTexcdi4): 103(ptr) Variable UniformConstant
105: TypeImage 40(int) Cube array sampled format:Unknown
106: TypePointer UniformConstant 105
107(g_tTexcdu4): 106(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval10): 8(ptr) Variable Function
@@ -453,6 +462,7 @@ gl_FragCoord origin is upper left
Store 91 90
93: 92(ptr) AccessChain 88(psout) 27
Store 93 89
94:86(PS_OUTPUT) Load 88(psout)
ReturnValue 94
96:86(PS_OUTPUT) Load 88(psout)
Store 95(@entryPointOutput) 96
Return
FunctionEnd