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

@@ -2774,7 +2774,7 @@ gl_FragCoord origin is upper left
0:491 1.000000
0:492 Sequence
0:492 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:492 'ps_output' (temp structure{temp 4-component vector of float color})
0:492 Branch: Return
0:? Linker Objects
@@ -2790,7 +2790,7 @@ gl_FragCoord origin is upper left
0:? 'gs_ua4' (global 4-component vector of uint)
0:? 'gs_ub4' (global 4-component vector of uint)
0:? 'gs_uc4' (global 4-component vector of uint)
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:
@@ -5571,7 +5571,7 @@ gl_FragCoord origin is upper left
0:491 1.000000
0:492 Sequence
0:492 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:492 'ps_output' (temp structure{temp 4-component vector of float color})
0:492 Branch: Return
0:? Linker Objects
@@ -5587,17 +5587,17 @@ gl_FragCoord origin is upper left
0:? 'gs_ua4' (global 4-component vector of uint)
0:? 'gs_ub4' (global 4-component vector of uint)
0:? 'gs_uc4' (global 4-component vector of uint)
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 1824
// Id's are bound by 1826
Capability Shader
Capability DerivativeControl
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 1805
EntryPoint Fragment 4 "main" 1805 1825
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 16 "PixelShaderFunctionS(f1;f1;f1;u1;u1;"
@@ -6124,7 +6124,8 @@ gl_FragCoord origin is upper left
Name 1821 "gs_ua4"
Name 1822 "gs_ub4"
Name 1823 "gs_uc4"
Decorate 1805(@entryPointOutput) Location 0
Name 1825 "color"
Decorate 1825(color) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -6258,6 +6259,8 @@ gl_FragCoord origin is upper left
1821(gs_ua4): 1820(ptr) Variable Private
1822(gs_ub4): 1820(ptr) Variable Private
1823(gs_uc4): 1820(ptr) Variable Private
1824: TypePointer Output 48(fvec4)
1825(color): 1824(ptr) Variable Output
4(main): 2 Function None 3
5: Label
1800(ps_output): 1799(ptr) Variable Function