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

@ -110,13 +110,13 @@ gl_FragCoord origin is upper left
0:47 'e2_11' (temp float)
0:48 Sequence
0:48 move second child to first child (temp structure{temp 4-component vector of float Color})
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp 4-component vector of float Color})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color})
0:48 'psout' (temp structure{temp 4-component vector of float Color})
0:48 Branch: Return
0:? Linker Objects
0:? 'idx' (uniform int)
0:? 'um' (uniform 3X2 matrix of float)
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color})
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
Linked fragment stage:
@ -233,22 +233,22 @@ gl_FragCoord origin is upper left
0:47 'e2_11' (temp float)
0:48 Sequence
0:48 move second child to first child (temp structure{temp 4-component vector of float Color})
0:? '@entryPointOutput' (layout(location=0 ) out structure{temp 4-component vector of float Color})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color})
0:48 'psout' (temp structure{temp 4-component vector of float Color})
0:48 Branch: Return
0:? Linker Objects
0:? 'idx' (uniform int)
0:? 'um' (uniform 3X2 matrix of float)
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color})
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 74
// Id's are bound by 76
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 71
EntryPoint Fragment 4 "main" 71 75
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "e1_00"
@ -275,7 +275,8 @@ gl_FragCoord origin is upper left
MemberName 62(PS_OUTPUT) 0 "Color"
Name 64 "psout"
Name 71 "@entryPointOutput"
Decorate 71(@entryPointOutput) Location 0
Name 75 "Color"
Decorate 75(Color) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -316,6 +317,8 @@ gl_FragCoord origin is upper left
68: TypePointer Function 61(fvec4)
70: TypePointer Output 62(PS_OUTPUT)
71(@entryPointOutput): 70(ptr) Variable Output
74: TypePointer Output 61(fvec4)
75(Color): 74(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(e1_00): 7(ptr) Variable Function