
This commit adds support for copying nested hierarchical types of split types. E.g, a struct of a struct containing both user and builtin interstage IO variables. When copying split types, if any subtree does NOT contain builtin interstage IO, we can copy the whole subtree with one assignment, which saves a bunch of AST verbosity for memberwise copies of that subtree.
109 lines
5.0 KiB
Plaintext
109 lines
5.0 KiB
Plaintext
hlsl.struct.split.trivial.vert
|
|
Shader version: 450
|
|
0:? Sequence
|
|
0:16 Function Definition: main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
|
|
0:16 Function Parameters:
|
|
0:16 'vsin' (in structure{temp 4-component vector of float Pos_in})
|
|
0:16 'Pos_loose' (in 4-component vector of float Position)
|
|
0:? Sequence
|
|
0:19 move second child to first child (temp 4-component vector of float)
|
|
0:19 Pos: direct index for structure (temp 4-component vector of float)
|
|
0:19 'vsout' (temp structure{temp 4-component vector of float Pos})
|
|
0:19 Constant:
|
|
0:19 0 (const int)
|
|
0:19 add (temp 4-component vector of float)
|
|
0:? 'Pos_in' (in 4-component vector of float Position)
|
|
0:19 'Pos_loose' (in 4-component vector of float Position)
|
|
0:21 Sequence
|
|
0:21 Sequence
|
|
0:21 move second child to first child (temp 4-component vector of float)
|
|
0:? 'Pos' (out 4-component vector of float Position)
|
|
0:21 Pos: direct index for structure (temp 4-component vector of float)
|
|
0:21 'vsout' (temp structure{temp 4-component vector of float Pos})
|
|
0:21 Constant:
|
|
0:21 0 (const int)
|
|
0:21 Branch: Return
|
|
0:? Linker Objects
|
|
0:? 'Pos_in' (in 4-component vector of float Position)
|
|
0:? 'Pos_loose' (in 4-component vector of float Position)
|
|
0:? 'Pos' (out 4-component vector of float Position)
|
|
|
|
|
|
Linked vertex stage:
|
|
|
|
|
|
Shader version: 450
|
|
0:? Sequence
|
|
0:16 Function Definition: main(struct-VS_INPUT-vf41;vf4; (temp structure{temp 4-component vector of float Position Pos})
|
|
0:16 Function Parameters:
|
|
0:16 'vsin' (in structure{temp 4-component vector of float Pos_in})
|
|
0:16 'Pos_loose' (in 4-component vector of float Position)
|
|
0:? Sequence
|
|
0:19 move second child to first child (temp 4-component vector of float)
|
|
0:19 Pos: direct index for structure (temp 4-component vector of float)
|
|
0:19 'vsout' (temp structure{temp 4-component vector of float Pos})
|
|
0:19 Constant:
|
|
0:19 0 (const int)
|
|
0:19 add (temp 4-component vector of float)
|
|
0:? 'Pos_in' (in 4-component vector of float Position)
|
|
0:19 'Pos_loose' (in 4-component vector of float Position)
|
|
0:21 Sequence
|
|
0:21 Sequence
|
|
0:21 move second child to first child (temp 4-component vector of float)
|
|
0:? 'Pos' (out 4-component vector of float Position)
|
|
0:21 Pos: direct index for structure (temp 4-component vector of float)
|
|
0:21 'vsout' (temp structure{temp 4-component vector of float Pos})
|
|
0:21 Constant:
|
|
0:21 0 (const int)
|
|
0:21 Branch: Return
|
|
0:? Linker Objects
|
|
0:? 'Pos_in' (in 4-component vector of float Position)
|
|
0:? 'Pos_loose' (in 4-component vector of float Position)
|
|
0:? 'Pos' (out 4-component vector of float Position)
|
|
|
|
// Module Version 10000
|
|
// Generated by (magic number): 80001
|
|
// Id's are bound by 26
|
|
|
|
Capability Shader
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint Vertex 4 "main" 14 16 22
|
|
Name 4 "main"
|
|
Name 8 "VS_OUTPUT"
|
|
MemberName 8(VS_OUTPUT) 0 "Pos"
|
|
Name 10 "vsout"
|
|
Name 14 "Pos_in"
|
|
Name 16 "Pos_loose"
|
|
Name 22 "Pos"
|
|
Decorate 14(Pos_in) BuiltIn Position
|
|
Decorate 16(Pos_loose) BuiltIn Position
|
|
Decorate 22(Pos) BuiltIn Position
|
|
2: TypeVoid
|
|
3: TypeFunction 2
|
|
6: TypeFloat 32
|
|
7: TypeVector 6(float) 4
|
|
8(VS_OUTPUT): TypeStruct 7(fvec4)
|
|
9: TypePointer Function 8(VS_OUTPUT)
|
|
11: TypeInt 32 1
|
|
12: 11(int) Constant 0
|
|
13: TypePointer Input 7(fvec4)
|
|
14(Pos_in): 13(ptr) Variable Input
|
|
16(Pos_loose): 13(ptr) Variable Input
|
|
19: TypePointer Function 7(fvec4)
|
|
21: TypePointer Output 7(fvec4)
|
|
22(Pos): 21(ptr) Variable Output
|
|
4(main): 2 Function None 3
|
|
5: Label
|
|
10(vsout): 9(ptr) Variable Function
|
|
15: 7(fvec4) Load 14(Pos_in)
|
|
17: 7(fvec4) Load 16(Pos_loose)
|
|
18: 7(fvec4) FAdd 15 17
|
|
20: 19(ptr) AccessChain 10(vsout) 12
|
|
Store 20 18
|
|
23: 19(ptr) AccessChain 10(vsout) 12
|
|
24: 7(fvec4) Load 23
|
|
Store 22(Pos) 24
|
|
Return
|
|
FunctionEnd
|