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

@@ -55,10 +55,20 @@ gl_FragCoord origin is upper left
0:22 'inpos' (noperspective in 4-component vector of float FragCoord)
0:22 Constant:
0:22 3 (const int)
0:24 Sequence
0:24 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:24 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:24 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:24 Color: direct index for structure (temp 4-component vector of float)
0:24 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:24 Constant:
0:24 0 (const int)
0:24 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:24 Depth: direct index for structure (temp float FragDepth)
0:24 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:24 Constant:
0:24 1 (const int)
0:24 Branch: Return
0:? Linker Objects
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
@@ -125,10 +135,20 @@ gl_FragCoord origin is upper left
0:22 'inpos' (noperspective in 4-component vector of float FragCoord)
0:22 Constant:
0:22 3 (const int)
0:24 Sequence
0:24 move second child to first child (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:24 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:? Sequence
0:? Sequence
0:24 move second child to first child (temp 4-component vector of float)
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
0:24 Color: direct index for structure (temp 4-component vector of float)
0:24 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:24 Constant:
0:24 0 (const int)
0:24 move second child to first child (temp float)
0:? 'Depth' (out float FragDepth)
0:24 Depth: direct index for structure (temp float FragDepth)
0:24 'psout' (temp structure{temp 4-component vector of float Color, temp float FragDepth Depth})
0:24 Constant:
0:24 1 (const int)
0:24 Branch: Return
0:? Linker Objects
0:? 'Color' (layout(location=0 ) out 4-component vector of float)
@@ -137,12 +157,12 @@ gl_FragCoord origin is upper left
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 60
// Id's are bound by 61
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 45 53 57 59
EntryPoint Fragment 4 "main" 45 53 57
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 12 "MyFunc(f1;f1;f1;"
@@ -160,14 +180,13 @@ gl_FragCoord origin is upper left
MemberName 31(PS_OUTPUT) 1 "Depth"
Name 33 "psout"
Name 45 "inpos"
Name 53 "@entryPointOutput"
Name 57 "Color"
Name 59 "Depth"
Name 53 "Color"
Name 57 "Depth"
MemberDecorate 31(PS_OUTPUT) 1 BuiltIn FragDepth
Decorate 45(inpos) NoPerspective
Decorate 45(inpos) BuiltIn FragCoord
Decorate 57(Color) Location 0
Decorate 59(Depth) BuiltIn FragDepth
Decorate 53(Color) Location 0
Decorate 57(Depth) BuiltIn FragDepth
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -189,12 +208,10 @@ gl_FragCoord origin is upper left
46: TypeInt 32 0
47: 46(int) Constant 3
48: TypePointer Input 6(float)
52: TypePointer Output 31(PS_OUTPUT)
53(@entryPointOutput): 52(ptr) Variable Output
56: TypePointer Output 30(fvec4)
57(Color): 56(ptr) Variable Output
58: TypePointer Output 6(float)
59(Depth): 58(ptr) Variable Output
52: TypePointer Output 30(fvec4)
53(Color): 52(ptr) Variable Output
56: TypePointer Output 6(float)
57(Depth): 56(ptr) Variable Output
4(main): 2 Function None 3
5: Label
17(x): 7(ptr) Variable Function
@@ -225,8 +242,12 @@ gl_FragCoord origin is upper left
50: 6(float) Load 49
51: 7(ptr) AccessChain 33(psout) 43
Store 51 50
54:31(PS_OUTPUT) Load 33(psout)
Store 53(@entryPointOutput) 54
54: 41(ptr) AccessChain 33(psout) 35
55: 30(fvec4) Load 54
Store 53(Color) 55
58: 7(ptr) AccessChain 33(psout) 43
59: 6(float) Load 58
Store 57(Depth) 59
Return
FunctionEnd
12(MyFunc(f1;f1;f1;): 2 Function None 8