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

@ -157,8 +157,11 @@ gl_FragCoord origin is upper left
0:46 1 (const int)
0:46 Constant:
0:46 1.000000
0:48 Branch: Return with expression
0:48 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:48 Sequence
0:48 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:48 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:48 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
@ -337,8 +340,11 @@ gl_FragCoord origin is upper left
0:46 1 (const int)
0:46 Constant:
0:46 1.000000
0:48 Branch: Return with expression
0:48 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:48 Sequence
0:48 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:48 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:48 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1D)
@ -357,13 +363,13 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 148
// Id's are bound by 150
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
EntryPoint Fragment 4 "main" 137
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval10"
@ -389,10 +395,11 @@ gl_FragCoord origin is upper left
MemberName 128(PS_OUTPUT) 0 "Color"
MemberName 128(PS_OUTPUT) 1 "Depth"
Name 130 "psout"
Name 138 "g_tTex1df4a"
Name 141 "g_tTexcdf4"
Name 144 "g_tTexcdi4"
Name 147 "g_tTexcdu4"
Name 137 "@entryPointOutput"
Name 140 "g_tTex1df4a"
Name 143 "g_tTexcdf4"
Name 146 "g_tTexcdi4"
Name 149 "g_tTexcdu4"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
Decorate 16(g_sSamp) DescriptorSet 0
@ -406,11 +413,11 @@ gl_FragCoord origin is upper left
Decorate 106(g_tTex3di4) DescriptorSet 0
Decorate 117(g_tTex3du4) DescriptorSet 0
MemberDecorate 128(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 138(g_tTex1df4a) DescriptorSet 0
Decorate 138(g_tTex1df4a) Binding 1
Decorate 141(g_tTexcdf4) DescriptorSet 0
Decorate 144(g_tTexcdi4) DescriptorSet 0
Decorate 147(g_tTexcdu4) DescriptorSet 0
Decorate 140(g_tTex1df4a) DescriptorSet 0
Decorate 140(g_tTex1df4a) Binding 1
Decorate 143(g_tTexcdf4) DescriptorSet 0
Decorate 146(g_tTexcdi4) DescriptorSet 0
Decorate 149(g_tTexcdu4) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -495,16 +502,18 @@ gl_FragCoord origin is upper left
131: 6(float) Constant 1065353216
132: 7(fvec4) ConstantComposite 131 131 131 131
134: TypePointer Function 6(float)
138(g_tTex1df4a): 11(ptr) Variable UniformConstant
139: TypeImage 6(float) Cube sampled format:Unknown
140: TypePointer UniformConstant 139
141(g_tTexcdf4): 140(ptr) Variable UniformConstant
142: TypeImage 22(int) Cube sampled format:Unknown
143: TypePointer UniformConstant 142
144(g_tTexcdi4): 143(ptr) Variable UniformConstant
145: TypeImage 37(int) Cube sampled format:Unknown
146: TypePointer UniformConstant 145
147(g_tTexcdu4): 146(ptr) Variable UniformConstant
136: TypePointer Output 128(PS_OUTPUT)
137(@entryPointOutput): 136(ptr) Variable Output
140(g_tTex1df4a): 11(ptr) Variable UniformConstant
141: TypeImage 6(float) Cube sampled format:Unknown
142: TypePointer UniformConstant 141
143(g_tTexcdf4): 142(ptr) Variable UniformConstant
144: TypeImage 22(int) Cube sampled format:Unknown
145: TypePointer UniformConstant 144
146(g_tTexcdi4): 145(ptr) Variable UniformConstant
147: TypeImage 37(int) Cube sampled format:Unknown
148: TypePointer UniformConstant 147
149(g_tTexcdu4): 148(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval10): 8(ptr) Variable Function
@ -566,6 +575,7 @@ gl_FragCoord origin is upper left
Store 133 132
135: 134(ptr) AccessChain 130(psout) 23
Store 135 131
136:128(PS_OUTPUT) Load 130(psout)
ReturnValue 136
138:128(PS_OUTPUT) Load 130(psout)
Store 137(@entryPointOutput) 138
Return
FunctionEnd