AST: Have type deepCopy() preserve type graphs as graphs.
Previously, a type graph would turn into a type tree. That is, a deep node that is shared would have multiple copies made. This is important when creating IO and non-IO versions of deep types.
This commit is contained in:
127
Test/baseResults/hlsl.typeGraphCopy.vert.out
Executable file
127
Test/baseResults/hlsl.typeGraphCopy.vert.out
Executable file
@@ -0,0 +1,127 @@
|
||||
hlsl.typeGraphCopy.vert
|
||||
Shader version: 450
|
||||
0:? Sequence
|
||||
0:22 Function Definition: @main( (temp float)
|
||||
0:22 Function Parameters:
|
||||
0:? Sequence
|
||||
0:23 Branch: Return with expression
|
||||
0:23 b: direct index for structure (temp float)
|
||||
0:23 s2: direct index for structure (temp structure{temp int a, temp float b})
|
||||
0:23 t3: direct index for structure (temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2})
|
||||
0:23 foo: direct index for structure (layout(offset=0 ) uniform structure{temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t1, temp structure{temp int a, temp float b} t2, temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t3})
|
||||
0:23 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t1, temp structure{temp int a, temp float b} t2, temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t3} foo})
|
||||
0:23 Constant:
|
||||
0:23 0 (const uint)
|
||||
0:23 Constant:
|
||||
0:23 2 (const int)
|
||||
0:23 Constant:
|
||||
0:23 1 (const int)
|
||||
0:23 Constant:
|
||||
0:23 1 (const int)
|
||||
0:22 Function Definition: main( (temp void)
|
||||
0:22 Function Parameters:
|
||||
0:? Sequence
|
||||
0:22 move second child to first child (temp float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out float)
|
||||
0:22 Function Call: @main( (temp float)
|
||||
0:? Linker Objects
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out float)
|
||||
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t1, temp structure{temp int a, temp float b} t2, temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t3} foo})
|
||||
|
||||
|
||||
Linked vertex stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
0:? Sequence
|
||||
0:22 Function Definition: @main( (temp float)
|
||||
0:22 Function Parameters:
|
||||
0:? Sequence
|
||||
0:23 Branch: Return with expression
|
||||
0:23 b: direct index for structure (temp float)
|
||||
0:23 s2: direct index for structure (temp structure{temp int a, temp float b})
|
||||
0:23 t3: direct index for structure (temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2})
|
||||
0:23 foo: direct index for structure (layout(offset=0 ) uniform structure{temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t1, temp structure{temp int a, temp float b} t2, temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t3})
|
||||
0:23 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t1, temp structure{temp int a, temp float b} t2, temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t3} foo})
|
||||
0:23 Constant:
|
||||
0:23 0 (const uint)
|
||||
0:23 Constant:
|
||||
0:23 2 (const int)
|
||||
0:23 Constant:
|
||||
0:23 1 (const int)
|
||||
0:23 Constant:
|
||||
0:23 1 (const int)
|
||||
0:22 Function Definition: main( (temp void)
|
||||
0:22 Function Parameters:
|
||||
0:? Sequence
|
||||
0:22 move second child to first child (temp float)
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out float)
|
||||
0:22 Function Call: @main( (temp float)
|
||||
0:? Linker Objects
|
||||
0:? '@entryPointOutput' (layout(location=0 ) out float)
|
||||
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t1, temp structure{temp int a, temp float b} t2, temp structure{temp structure{temp int a, temp float b} s1, temp structure{temp int a, temp float b} s2} t3} foo})
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 28
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main" 26
|
||||
Name 4 "main"
|
||||
Name 8 "@main("
|
||||
Name 11 "N1"
|
||||
MemberName 11(N1) 0 "a"
|
||||
MemberName 11(N1) 1 "b"
|
||||
Name 12 "N2"
|
||||
MemberName 12(N2) 0 "s1"
|
||||
MemberName 12(N2) 1 "s2"
|
||||
Name 13 "N3"
|
||||
MemberName 13(N3) 0 "t1"
|
||||
MemberName 13(N3) 1 "t2"
|
||||
MemberName 13(N3) 2 "t3"
|
||||
Name 14 "$Global"
|
||||
MemberName 14($Global) 0 "foo"
|
||||
Name 16 ""
|
||||
Name 26 "@entryPointOutput"
|
||||
MemberDecorate 11(N1) 0 Offset 0
|
||||
MemberDecorate 11(N1) 1 Offset 4
|
||||
MemberDecorate 12(N2) 0 Offset 0
|
||||
MemberDecorate 12(N2) 1 Offset 16
|
||||
MemberDecorate 13(N3) 0 Offset 0
|
||||
MemberDecorate 13(N3) 1 Offset 32
|
||||
MemberDecorate 13(N3) 2 Offset 48
|
||||
MemberDecorate 14($Global) 0 Offset 0
|
||||
Decorate 14($Global) Block
|
||||
Decorate 16 DescriptorSet 0
|
||||
Decorate 26(@entryPointOutput) Location 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeFunction 6(float)
|
||||
10: TypeInt 32 1
|
||||
11(N1): TypeStruct 10(int) 6(float)
|
||||
12(N2): TypeStruct 11(N1) 11(N1)
|
||||
13(N3): TypeStruct 12(N2) 11(N1) 12(N2)
|
||||
14($Global): TypeStruct 13(N3)
|
||||
15: TypePointer Uniform 14($Global)
|
||||
16: 15(ptr) Variable Uniform
|
||||
17: 10(int) Constant 0
|
||||
18: 10(int) Constant 2
|
||||
19: 10(int) Constant 1
|
||||
20: TypePointer Uniform 6(float)
|
||||
25: TypePointer Output 6(float)
|
||||
26(@entryPointOutput): 25(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
27: 6(float) FunctionCall 8(@main()
|
||||
Store 26(@entryPointOutput) 27
|
||||
Return
|
||||
FunctionEnd
|
||||
8(@main(): 6(float) Function None 7
|
||||
9: Label
|
||||
21: 20(ptr) AccessChain 16 17 18 19 19
|
||||
22: 6(float) Load 21
|
||||
ReturnValue 22
|
||||
FunctionEnd
|
||||
Reference in New Issue
Block a user