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

@@ -21,12 +21,12 @@ gl_FragCoord origin is upper left
0:11 1.000000
0:12 Sequence
0:12 move second child to first child (temp structure{noContraction temp 4-component vector of float color})
0:? '@entryPointOutput' (layout(location=0 ) out structure{noContraction temp 4-component vector of float color})
0:? '@entryPointOutput' (out structure{noContraction temp 4-component vector of float color})
0:12 'ps_output' (temp structure{noContraction temp 4-component vector of float color})
0:12 Branch: Return
0:? Linker Objects
0:? 'precisefloat' (noContraction global float)
0:? '@entryPointOutput' (out structure{noContraction temp 4-component vector of float color})
0:? 'color' (layout(location=0 ) noContraction out 4-component vector of float)
Linked fragment stage:
@@ -54,21 +54,21 @@ gl_FragCoord origin is upper left
0:11 1.000000
0:12 Sequence
0:12 move second child to first child (temp structure{noContraction temp 4-component vector of float color})
0:? '@entryPointOutput' (layout(location=0 ) out structure{noContraction temp 4-component vector of float color})
0:? '@entryPointOutput' (out structure{noContraction temp 4-component vector of float color})
0:12 'ps_output' (temp structure{noContraction temp 4-component vector of float color})
0:12 Branch: Return
0:? Linker Objects
0:? 'precisefloat' (noContraction global float)
0:? '@entryPointOutput' (out structure{noContraction temp 4-component vector of float color})
0:? 'color' (layout(location=0 ) noContraction out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 31
// Id's are bound by 33
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 26
EntryPoint Fragment 4 "main" 26 32
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 13 "MyFunction(f1;vf3;"
@@ -79,7 +79,8 @@ gl_FragCoord origin is upper left
Name 18 "ps_output"
Name 26 "@entryPointOutput"
Name 30 "precisefloat"
Decorate 26(@entryPointOutput) Location 0
Name 32 "color"
Decorate 32(color) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -99,6 +100,8 @@ gl_FragCoord origin is upper left
26(@entryPointOutput): 25(ptr) Variable Output
29: TypePointer Private 6(float)
30(precisefloat): 29(ptr) Variable Private
31: TypePointer Output 15(fvec4)
32(color): 31(ptr) Variable Output
4(main): 2 Function None 3
5: Label
18(ps_output): 17(ptr) Variable Function