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

@ -36,8 +36,11 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:26 Branch: Return with expression
0:26 'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
0:26 Sequence
0:26 move second child to first child (temp structure{temp 4-component vector of float FragCoord Pos})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float FragCoord Pos})
0:26 'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
0:26 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
@ -83,22 +86,25 @@ Shader version: 450
0:? 0.000000
0:? 0.000000
0:? 0.000000
0:26 Branch: Return with expression
0:26 'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
0:26 Sequence
0:26 move second child to first child (temp structure{temp 4-component vector of float FragCoord Pos})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float FragCoord Pos})
0:26 'vsout' (temp structure{temp 4-component vector of float FragCoord Pos})
0:26 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4' (layout(binding=0 ) uniform texture1D)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 40
// Id's are bound by 42
Capability Shader
Capability Sampled1D
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main"
EntryPoint Vertex 4 "main" 36
Name 4 "main"
Name 8 "sizeQueryTemp"
Name 12 "g_tTex1df4"
@ -108,12 +114,13 @@ Shader version: 450
Name 27 "VS_OUTPUT"
MemberName 27(VS_OUTPUT) 0 "Pos"
Name 29 "vsout"
Name 39 "g_sSamp"
Name 36 "@entryPointOutput"
Name 41 "g_sSamp"
Decorate 12(g_tTex1df4) DescriptorSet 0
Decorate 12(g_tTex1df4) Binding 0
MemberDecorate 27(VS_OUTPUT) 0 BuiltIn FragCoord
Decorate 39(g_sSamp) DescriptorSet 0
Decorate 39(g_sSamp) Binding 0
Decorate 41(g_sSamp) DescriptorSet 0
Decorate 41(g_sSamp) Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
@ -131,9 +138,11 @@ Shader version: 450
31: 9(float) Constant 0
32: 26(fvec4) ConstantComposite 31 31 31 31
33: TypePointer Function 26(fvec4)
37: TypeSampler
38: TypePointer UniformConstant 37
39(g_sSamp): 38(ptr) Variable UniformConstant
35: TypePointer Output 27(VS_OUTPUT)
36(@entryPointOutput): 35(ptr) Variable Output
39: TypeSampler
40: TypePointer UniformConstant 39
41(g_sSamp): 40(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
8(sizeQueryTemp): 7(ptr) Variable Function
@ -156,6 +165,7 @@ Shader version: 450
Store 23(NumberOfLevelsU) 25
34: 33(ptr) AccessChain 29(vsout) 30
Store 34 32
35:27(VS_OUTPUT) Load 29(vsout)
ReturnValue 35
37:27(VS_OUTPUT) Load 29(vsout)
Store 36(@entryPointOutput) 37
Return
FunctionEnd