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

@ -58,10 +58,14 @@ gl_FragCoord origin is upper left
0:18 Construct vec4 (temp 4-component vector of float)
0:18 Convert int to float (temp float)
0:18 'r07' (temp int)
0:19 Sequence
0:19 move second child to first child (temp structure{temp 4-component vector of float color})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float color})
0:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:? Sequence
0:? Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:19 color: direct index for structure (temp 4-component vector of float)
0:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:19 Constant:
0:19 0 (const int)
0:19 Branch: Return
0:? Linker Objects
0:? 'color' (layout(location=0 ) out 4-component vector of float)
@ -129,22 +133,26 @@ gl_FragCoord origin is upper left
0:18 Construct vec4 (temp 4-component vector of float)
0:18 Convert int to float (temp float)
0:18 'r07' (temp int)
0:19 Sequence
0:19 move second child to first child (temp structure{temp 4-component vector of float color})
0:? '@entryPointOutput' (out structure{temp 4-component vector of float color})
0:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:? Sequence
0:? Sequence
0:19 move second child to first child (temp 4-component vector of float)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
0:19 color: direct index for structure (temp 4-component vector of float)
0:19 'ps_output' (temp structure{temp 4-component vector of float color})
0:19 Constant:
0:19 0 (const int)
0:19 Branch: Return
0:? Linker Objects
0:? 'color' (layout(location=0 ) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 45
// Id's are bound by 44
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 40 44
EntryPoint Fragment 4 "main" 40
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 8 "r00"
@ -159,9 +167,8 @@ gl_FragCoord origin is upper left
Name 30 "PS_OUTPUT"
MemberName 30(PS_OUTPUT) 0 "color"
Name 32 "ps_output"
Name 40 "@entryPointOutput"
Name 44 "color"
Decorate 44(color) Location 0
Name 40 "color"
Decorate 40(color) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -183,10 +190,8 @@ gl_FragCoord origin is upper left
31: TypePointer Function 30(PS_OUTPUT)
33: 19(int) Constant 0
37: TypePointer Function 29(fvec4)
39: TypePointer Output 30(PS_OUTPUT)
40(@entryPointOutput): 39(ptr) Variable Output
43: TypePointer Output 29(fvec4)
44(color): 43(ptr) Variable Output
39: TypePointer Output 29(fvec4)
40(color): 39(ptr) Variable Output
4(main): 2 Function None 3
5: Label
8(r00): 7(ptr) Variable Function
@ -213,7 +218,8 @@ gl_FragCoord origin is upper left
36: 29(fvec4) CompositeConstruct 35 35 35 35
38: 37(ptr) AccessChain 32(ps_output) 33
Store 38 36
41:30(PS_OUTPUT) Load 32(ps_output)
Store 40(@entryPointOutput) 41
41: 37(ptr) AccessChain 32(ps_output) 33
42: 29(fvec4) Load 41
Store 40(color) 42
Return
FunctionEnd