mirror of
https://github.com/RPCS3/glslang.git
synced 2024-12-03 16:41:30 +00:00
132d331870
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.
176 lines
7.6 KiB
Plaintext
176 lines
7.6 KiB
Plaintext
hlsl.struct.split.trivial.geom
|
|
Shader version: 450
|
|
invocations = -1
|
|
max_vertices = 3
|
|
input primitive = triangles
|
|
output primitive = triangle_strip
|
|
0:? Sequence
|
|
0:14 Function Definition: main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41; (temp void)
|
|
0:14 Function Parameters:
|
|
0:14 'i' (in 3-element array of structure{temp 4-component vector of float Position pos})
|
|
0:14 'ts' (out structure{temp 4-component vector of float Position pos})
|
|
0:? Sequence
|
|
0:17 Sequence
|
|
0:17 move second child to first child (temp int)
|
|
0:17 'x' (temp int)
|
|
0:17 Constant:
|
|
0:17 0 (const int)
|
|
0:17 Loop with condition tested first
|
|
0:17 Loop Condition
|
|
0:17 Compare Less Than (temp bool)
|
|
0:17 'x' (temp int)
|
|
0:17 Constant:
|
|
0:17 3 (const int)
|
|
0:17 Loop Body
|
|
0:? Sequence
|
|
0:18 move second child to first child (temp 4-component vector of float)
|
|
0:18 pos: direct index for structure (temp 4-component vector of float)
|
|
0:18 'o' (temp structure{temp 4-component vector of float pos})
|
|
0:18 Constant:
|
|
0:18 0 (const int)
|
|
0:18 indirect index (temp 4-component vector of float Position)
|
|
0:18 'i.pos' (in 3-element array of 4-component vector of float Position)
|
|
0:18 'x' (temp int)
|
|
0:19 Sequence
|
|
0:19 Sequence
|
|
0:19 move second child to first child (temp 4-component vector of float)
|
|
0:? 'ts.pos' (out 4-component vector of float Position)
|
|
0:19 pos: direct index for structure (temp 4-component vector of float)
|
|
0:19 'o' (temp structure{temp 4-component vector of float pos})
|
|
0:19 Constant:
|
|
0:19 0 (const int)
|
|
0:19 EmitVertex (temp void)
|
|
0:17 Loop Terminal Expression
|
|
0:17 Pre-Increment (temp int)
|
|
0:17 'x' (temp int)
|
|
0:? Linker Objects
|
|
0:? 'i.pos' (in 3-element array of 4-component vector of float Position)
|
|
0:? 'ts.pos' (out 4-component vector of float Position)
|
|
|
|
|
|
Linked geometry stage:
|
|
|
|
|
|
Shader version: 450
|
|
invocations = 1
|
|
max_vertices = 3
|
|
input primitive = triangles
|
|
output primitive = triangle_strip
|
|
0:? Sequence
|
|
0:14 Function Definition: main(struct-PS_IN-vf41[3];struct-GS_OUT-vf41; (temp void)
|
|
0:14 Function Parameters:
|
|
0:14 'i' (in 3-element array of structure{temp 4-component vector of float Position pos})
|
|
0:14 'ts' (out structure{temp 4-component vector of float Position pos})
|
|
0:? Sequence
|
|
0:17 Sequence
|
|
0:17 move second child to first child (temp int)
|
|
0:17 'x' (temp int)
|
|
0:17 Constant:
|
|
0:17 0 (const int)
|
|
0:17 Loop with condition tested first
|
|
0:17 Loop Condition
|
|
0:17 Compare Less Than (temp bool)
|
|
0:17 'x' (temp int)
|
|
0:17 Constant:
|
|
0:17 3 (const int)
|
|
0:17 Loop Body
|
|
0:? Sequence
|
|
0:18 move second child to first child (temp 4-component vector of float)
|
|
0:18 pos: direct index for structure (temp 4-component vector of float)
|
|
0:18 'o' (temp structure{temp 4-component vector of float pos})
|
|
0:18 Constant:
|
|
0:18 0 (const int)
|
|
0:18 indirect index (temp 4-component vector of float Position)
|
|
0:18 'i.pos' (in 3-element array of 4-component vector of float Position)
|
|
0:18 'x' (temp int)
|
|
0:19 Sequence
|
|
0:19 Sequence
|
|
0:19 move second child to first child (temp 4-component vector of float)
|
|
0:? 'ts.pos' (out 4-component vector of float Position)
|
|
0:19 pos: direct index for structure (temp 4-component vector of float)
|
|
0:19 'o' (temp structure{temp 4-component vector of float pos})
|
|
0:19 Constant:
|
|
0:19 0 (const int)
|
|
0:19 EmitVertex (temp void)
|
|
0:17 Loop Terminal Expression
|
|
0:17 Pre-Increment (temp int)
|
|
0:17 'x' (temp int)
|
|
0:? Linker Objects
|
|
0:? 'i.pos' (in 3-element array of 4-component vector of float Position)
|
|
0:? 'ts.pos' (out 4-component vector of float Position)
|
|
|
|
// Module Version 10000
|
|
// Generated by (magic number): 80001
|
|
// Id's are bound by 42
|
|
|
|
Capability Geometry
|
|
1: ExtInstImport "GLSL.std.450"
|
|
MemoryModel Logical GLSL450
|
|
EntryPoint Geometry 4 "main" 28 36
|
|
ExecutionMode 4 Triangles
|
|
ExecutionMode 4 Invocations 1
|
|
ExecutionMode 4 OutputTriangleStrip
|
|
ExecutionMode 4 OutputVertices 3
|
|
Name 4 "main"
|
|
Name 8 "x"
|
|
Name 21 "GS_OUT"
|
|
MemberName 21(GS_OUT) 0 "pos"
|
|
Name 23 "o"
|
|
Name 28 "i.pos"
|
|
Name 36 "ts.pos"
|
|
Decorate 28(i.pos) BuiltIn Position
|
|
Decorate 36(ts.pos) BuiltIn Position
|
|
2: TypeVoid
|
|
3: TypeFunction 2
|
|
6: TypeInt 32 1
|
|
7: TypePointer Function 6(int)
|
|
9: 6(int) Constant 0
|
|
16: 6(int) Constant 3
|
|
17: TypeBool
|
|
19: TypeFloat 32
|
|
20: TypeVector 19(float) 4
|
|
21(GS_OUT): TypeStruct 20(fvec4)
|
|
22: TypePointer Function 21(GS_OUT)
|
|
24: TypeInt 32 0
|
|
25: 24(int) Constant 3
|
|
26: TypeArray 20(fvec4) 25
|
|
27: TypePointer Input 26
|
|
28(i.pos): 27(ptr) Variable Input
|
|
30: TypePointer Input 20(fvec4)
|
|
33: TypePointer Function 20(fvec4)
|
|
35: TypePointer Output 20(fvec4)
|
|
36(ts.pos): 35(ptr) Variable Output
|
|
40: 6(int) Constant 1
|
|
4(main): 2 Function None 3
|
|
5: Label
|
|
8(x): 7(ptr) Variable Function
|
|
23(o): 22(ptr) Variable Function
|
|
Store 8(x) 9
|
|
Branch 10
|
|
10: Label
|
|
LoopMerge 12 13 None
|
|
Branch 14
|
|
14: Label
|
|
15: 6(int) Load 8(x)
|
|
18: 17(bool) SLessThan 15 16
|
|
BranchConditional 18 11 12
|
|
11: Label
|
|
29: 6(int) Load 8(x)
|
|
31: 30(ptr) AccessChain 28(i.pos) 29
|
|
32: 20(fvec4) Load 31
|
|
34: 33(ptr) AccessChain 23(o) 9
|
|
Store 34 32
|
|
37: 33(ptr) AccessChain 23(o) 9
|
|
38: 20(fvec4) Load 37
|
|
Store 36(ts.pos) 38
|
|
EmitVertex
|
|
Branch 13
|
|
13: Label
|
|
39: 6(int) Load 8(x)
|
|
41: 6(int) IAdd 39 40
|
|
Store 8(x) 41
|
|
Branch 10
|
|
12: Label
|
|
Return
|
|
FunctionEnd
|