HLSL: Flatten whole-struct assigns and returns when targeting flattened I/O structs.

This commit is contained in:
John Kessenich
2016-09-16 03:05:12 -06:00
parent f8e494c18c
commit d21baed6bc
67 changed files with 4024 additions and 2886 deletions

View File

@@ -19,10 +19,14 @@ gl_FragCoord origin is upper left
0:11 1.000000
0:11 1.000000
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' (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:? Sequence
0:? Sequence
0:12 move second child to first child (noContraction temp 4-component vector of float)
0:? 'color' (layout(location=0 ) noContraction out 4-component vector of float)
0:12 color: direct index for structure (noContraction temp 4-component vector of float)
0:12 'ps_output' (temp structure{noContraction temp 4-component vector of float color})
0:12 Constant:
0:12 0 (const int)
0:12 Branch: Return
0:? Linker Objects
0:? 'precisefloat' (noContraction global float)
@@ -52,10 +56,14 @@ gl_FragCoord origin is upper left
0:11 1.000000
0:11 1.000000
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' (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:? Sequence
0:? Sequence
0:12 move second child to first child (noContraction temp 4-component vector of float)
0:? 'color' (layout(location=0 ) noContraction out 4-component vector of float)
0:12 color: direct index for structure (noContraction temp 4-component vector of float)
0:12 'ps_output' (temp structure{noContraction temp 4-component vector of float color})
0:12 Constant:
0:12 0 (const int)
0:12 Branch: Return
0:? Linker Objects
0:? 'precisefloat' (noContraction global float)
@@ -63,12 +71,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 33
// Id's are bound by 32
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 26 32
EntryPoint Fragment 4 "main" 26
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 13 "MyFunction(f1;vf3;"
@@ -77,10 +85,9 @@ gl_FragCoord origin is upper left
Name 16 "PS_OUTPUT"
MemberName 16(PS_OUTPUT) 0 "color"
Name 18 "ps_output"
Name 26 "@entryPointOutput"
Name 30 "precisefloat"
Name 32 "color"
Decorate 32(color) Location 0
Name 26 "color"
Name 31 "precisefloat"
Decorate 26(color) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -96,19 +103,18 @@ gl_FragCoord origin is upper left
21: 6(float) Constant 1065353216
22: 15(fvec4) ConstantComposite 21 21 21 21
23: TypePointer Function 15(fvec4)
25: TypePointer Output 16(PS_OUTPUT)
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
25: TypePointer Output 15(fvec4)
26(color): 25(ptr) Variable Output
30: TypePointer Private 6(float)
31(precisefloat): 30(ptr) Variable Private
4(main): 2 Function None 3
5: Label
18(ps_output): 17(ptr) Variable Function
24: 23(ptr) AccessChain 18(ps_output) 20
Store 24 22
27:16(PS_OUTPUT) Load 18(ps_output)
Store 26(@entryPointOutput) 27
27: 23(ptr) AccessChain 18(ps_output) 20
28: 15(fvec4) Load 27
Store 26(color) 28
Return
FunctionEnd
13(MyFunction(f1;vf3;): 2 Function None 10