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

@@ -91,8 +91,11 @@ gl_FragCoord origin is upper left
0:40 1 (const int)
0:40 Constant:
0:40 1.000000
0:42 Branch: Return with expression
0:42 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:42 Sequence
0:42 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:42 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:42 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -202,8 +205,11 @@ gl_FragCoord origin is upper left
0:40 1 (const int)
0:40 Constant:
0:40 1.000000
0:42 Branch: Return with expression
0:42 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:42 Sequence
0:42 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:42 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:42 Branch: Return
0:? Linker Objects
0:? 'g_sSamp' (layout(binding=0 ) uniform sampler)
0:? 'g_tTex1df4a' (layout(binding=1 ) uniform texture1DArray)
@@ -219,14 +225,14 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 110
// Id's are bound by 112
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
EntryPoint Fragment 4 "main" 99
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval20"
@@ -246,10 +252,11 @@ gl_FragCoord origin is upper left
MemberName 90(PS_OUTPUT) 0 "Color"
MemberName 90(PS_OUTPUT) 1 "Depth"
Name 92 "psout"
Name 102 "g_tTex1df4a"
Name 103 "g_tTex1df4"
Name 106 "g_tTex1di4a"
Name 109 "g_tTex1du4a"
Name 99 "@entryPointOutput"
Name 104 "g_tTex1df4a"
Name 105 "g_tTex1df4"
Name 108 "g_tTex1di4a"
Name 111 "g_tTex1du4a"
Decorate 12(g_tTex2df4a) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
@@ -259,12 +266,12 @@ gl_FragCoord origin is upper left
Decorate 70(g_tTexcdi4a) DescriptorSet 0
Decorate 80(g_tTexcdu4a) DescriptorSet 0
MemberDecorate 90(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 102(g_tTex1df4a) DescriptorSet 0
Decorate 102(g_tTex1df4a) Binding 1
Decorate 103(g_tTex1df4) DescriptorSet 0
Decorate 103(g_tTex1df4) Binding 0
Decorate 106(g_tTex1di4a) DescriptorSet 0
Decorate 109(g_tTex1du4a) DescriptorSet 0
Decorate 104(g_tTex1df4a) DescriptorSet 0
Decorate 104(g_tTex1df4a) Binding 1
Decorate 105(g_tTex1df4) DescriptorSet 0
Decorate 105(g_tTex1df4) Binding 0
Decorate 108(g_tTex1di4a) DescriptorSet 0
Decorate 111(g_tTex1du4a) DescriptorSet 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -326,16 +333,18 @@ gl_FragCoord origin is upper left
93: 7(fvec4) ConstantComposite 87 87 87 87
95: 25(int) Constant 1
96: TypePointer Function 6(float)
100: TypeImage 6(float) 1D array sampled format:Unknown
101: TypePointer UniformConstant 100
102(g_tTex1df4a): 101(ptr) Variable UniformConstant
103(g_tTex1df4): 101(ptr) Variable UniformConstant
104: TypeImage 25(int) 1D array sampled format:Unknown
105: TypePointer UniformConstant 104
106(g_tTex1di4a): 105(ptr) Variable UniformConstant
107: TypeImage 42(int) 1D array sampled format:Unknown
108: TypePointer UniformConstant 107
109(g_tTex1du4a): 108(ptr) Variable UniformConstant
98: TypePointer Output 90(PS_OUTPUT)
99(@entryPointOutput): 98(ptr) Variable Output
102: TypeImage 6(float) 1D array sampled format:Unknown
103: TypePointer UniformConstant 102
104(g_tTex1df4a): 103(ptr) Variable UniformConstant
105(g_tTex1df4): 103(ptr) Variable UniformConstant
106: TypeImage 25(int) 1D array sampled format:Unknown
107: TypePointer UniformConstant 106
108(g_tTex1di4a): 107(ptr) Variable UniformConstant
109: TypeImage 42(int) 1D array sampled format:Unknown
110: TypePointer UniformConstant 109
111(g_tTex1du4a): 110(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(txval20): 8(ptr) Variable Function
@@ -379,6 +388,7 @@ gl_FragCoord origin is upper left
Store 94 93
97: 96(ptr) AccessChain 92(psout) 95
Store 97 87
98:90(PS_OUTPUT) Load 92(psout)
ReturnValue 98
100:90(PS_OUTPUT) Load 92(psout)
Store 99(@entryPointOutput) 100
Return
FunctionEnd