HLSL: Flatten a return struct from an entry point and assign locations after flattening.

Locations now get assigned in order, but skipping built-ins, which can be
done post flattening.
This commit is contained in:
John Kessenich 2016-09-16 01:44:43 -06:00
parent 7f702124ec
commit 7dc630f3da
93 changed files with 951 additions and 495 deletions

View file

@ -264,7 +264,7 @@ gl_FragCoord origin is upper left
0:68 1.000000
0:70 Sequence
0:70 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (layout(location=0 ) out 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:70 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:70 Branch: Return
0:? Linker Objects
@ -283,7 +283,8 @@ gl_FragCoord origin is upper left
0:? 'c2' (uniform 2-component vector of float)
0:? 'c3' (uniform 3-component vector of float)
0:? 'c4' (uniform 4-component vector of float)
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
Linked fragment stage:
@ -554,7 +555,7 @@ gl_FragCoord origin is upper left
0:68 1.000000
0:70 Sequence
0:70 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (layout(location=0 ) out 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:70 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:70 Branch: Return
0:? Linker Objects
@ -573,18 +574,19 @@ gl_FragCoord origin is upper left
0:? 'c2' (uniform 2-component vector of float)
0:? 'c3' (uniform 3-component vector of float)
0:? 'c4' (uniform 4-component vector of float)
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:? 'Depth' (out float FragDepth)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 222
// Id's are bound by 226
Capability Shader
Capability Sampled1D
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 204
EntryPoint Fragment 4 "main" 204 223 225
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "txval00"
@ -631,6 +633,8 @@ gl_FragCoord origin is upper left
Name 216 "g_tTex1du4a"
Name 218 "c1"
Name 221 "c2"
Name 223 "Color"
Name 225 "Depth"
Decorate 12(g_tTex2df4a) DescriptorSet 0
Decorate 16(g_sSamp) DescriptorSet 0
Decorate 16(g_sSamp) Binding 0
@ -640,12 +644,13 @@ gl_FragCoord origin is upper left
Decorate 124(g_tTexcdi4a) DescriptorSet 0
Decorate 134(g_tTexcdu4a) DescriptorSet 0
MemberDecorate 195(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 204(@entryPointOutput) Location 0
Decorate 207(g_sSamp2d) DescriptorSet 0
Decorate 210(g_tTex1df4a) DescriptorSet 0
Decorate 210(g_tTex1df4a) Binding 0
Decorate 213(g_tTex1di4a) DescriptorSet 0
Decorate 216(g_tTex1du4a) DescriptorSet 0
Decorate 223(Color) Location 0
Decorate 225(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -715,6 +720,10 @@ gl_FragCoord origin is upper left
219: TypeVector 6(float) 2
220: TypePointer UniformConstant 219(fvec2)
221(c2): 220(ptr) Variable UniformConstant
222: TypePointer Output 7(fvec4)
223(Color): 222(ptr) Variable Output
224: TypePointer Output 6(float)
225(Depth): 224(ptr) Variable Output
4(main): 2 Function None 3
5: Label
9(txval00): 8(ptr) Variable Function