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

@ -17,13 +17,13 @@ gl_FragCoord origin is upper left
0:? 1.000000
0:19 Sequence
0:19 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:19 'psout' (temp structure{temp 4-component vector of float Color})
0:19 Branch: Return
0:? Linker Objects
0:? 'TestTexture' (uniform texture2D)
0:? 'TestUF' (uniform 4-component vector 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:
@ -47,22 +47,22 @@ gl_FragCoord origin is upper left
0:? 1.000000
0:19 Sequence
0:19 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:19 'psout' (temp structure{temp 4-component vector of float Color})
0:19 Branch: Return
0:? Linker Objects
0:? 'TestTexture' (uniform texture2D)
0:? 'TestUF' (uniform 4-component vector 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 27
// Id's are bound by 29
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 19
EntryPoint Fragment 4 "main" 19 28
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "PS_OUTPUT"
@ -71,8 +71,9 @@ gl_FragCoord origin is upper left
Name 19 "@entryPointOutput"
Name 24 "TestTexture"
Name 26 "TestUF"
Decorate 19(@entryPointOutput) Location 0
Name 28 "Color"
Decorate 24(TestTexture) DescriptorSet 0
Decorate 28(Color) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -92,6 +93,8 @@ gl_FragCoord origin is upper left
24(TestTexture): 23(ptr) Variable UniformConstant
25: TypePointer UniformConstant 7(fvec4)
26(TestUF): 25(ptr) Variable UniformConstant
27: TypePointer Output 7(fvec4)
28(Color): 27(ptr) Variable Output
4(main): 2 Function None 3
5: Label
10(psout): 9(ptr) Variable Function