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

@ -33,11 +33,12 @@ gl_FragCoord origin is upper left
0:127 1.000000
0:129 Sequence
0:129 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:129 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:129 Branch: Return
0:? Linker Objects
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:
@ -77,20 +78,21 @@ gl_FragCoord origin is upper left
0:127 1.000000
0:129 Sequence
0:129 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:129 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:129 Branch: Return
0:? Linker Objects
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 30
// Id's are bound by 34
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 27
EntryPoint Fragment 4 "main" 27 31 33
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "thisLineIs"
@ -99,8 +101,11 @@ gl_FragCoord origin is upper left
MemberName 12(PS_OUTPUT) 1 "Depth"
Name 14 "psout"
Name 27 "@entryPointOutput"
Name 31 "Color"
Name 33 "Depth"
MemberDecorate 12(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 27(@entryPointOutput) Location 0
Decorate 31(Color) Location 0
Decorate 33(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@ -118,6 +123,10 @@ gl_FragCoord origin is upper left
24: TypePointer Function 10(float)
26: TypePointer Output 12(PS_OUTPUT)
27(@entryPointOutput): 26(ptr) Variable Output
30: TypePointer Output 11(fvec4)
31(Color): 30(ptr) Variable Output
32: TypePointer Output 10(float)
33(Depth): 32(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(thisLineIs): 7(ptr) Variable Function