SPV return from main: Simplify a legacy design such returns are not jumps to exit block.
Structured control-flow rules allow leaving the middle of a construct through a return, but not through a jump to a block that does a return. Addresses issue #58.
This commit is contained in:
parent
5f5b205ce9
commit
e770b3e6cf
74 changed files with 9648 additions and 9816 deletions
|
|
@ -5,7 +5,7 @@ Linked vertex stage:
|
|||
|
||||
// Module Version 99
|
||||
// Generated by (magic number): 51a00bb
|
||||
// Id's are bound by 112
|
||||
// Id's are bound by 111
|
||||
|
||||
Source ESSL 300
|
||||
Capability Shader
|
||||
|
|
@ -13,183 +13,181 @@ Linked vertex stage:
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main"
|
||||
Name 4 "main"
|
||||
Name 10 "pos"
|
||||
Name 12 "p"
|
||||
Name 18 "Transform"
|
||||
MemberName 18(Transform) 0 "M1"
|
||||
MemberName 18(Transform) 1 "M2"
|
||||
MemberName 18(Transform) 2 "N1"
|
||||
MemberName 18(Transform) 3 "iuin"
|
||||
Name 20 "tblock"
|
||||
Name 34 "T3"
|
||||
MemberName 34(T3) 0 "M3"
|
||||
MemberName 34(T3) 1 "M4"
|
||||
MemberName 34(T3) 2 "N2"
|
||||
MemberName 34(T3) 3 "uv3a"
|
||||
Name 36 ""
|
||||
Name 44 "T2"
|
||||
MemberName 44(T2) 0 "b"
|
||||
MemberName 44(T2) 1 "t2m"
|
||||
Name 46 ""
|
||||
Name 52 "color"
|
||||
Name 54 "c"
|
||||
Name 62 "iout"
|
||||
Name 68 "uiuin"
|
||||
Name 74 "aiv2"
|
||||
Name 78 "S"
|
||||
MemberName 78(S) 0 "c"
|
||||
MemberName 78(S) 1 "f"
|
||||
Name 80 "s"
|
||||
Name 110 "gl_VertexID"
|
||||
Name 111 "gl_InstanceID"
|
||||
Decorate 10(pos) Smooth
|
||||
Decorate 12(p) Location 3
|
||||
MemberDecorate 18(Transform) 0 RowMajor
|
||||
MemberDecorate 18(Transform) 0 Offset 0
|
||||
MemberDecorate 18(Transform) 0 MatrixStride 16
|
||||
MemberDecorate 18(Transform) 1 ColMajor
|
||||
MemberDecorate 18(Transform) 1 Offset 64
|
||||
MemberDecorate 18(Transform) 1 MatrixStride 16
|
||||
MemberDecorate 18(Transform) 2 RowMajor
|
||||
MemberDecorate 18(Transform) 2 Offset 128
|
||||
MemberDecorate 18(Transform) 2 MatrixStride 16
|
||||
MemberDecorate 18(Transform) 3 Offset 176
|
||||
Decorate 18(Transform) Block
|
||||
MemberDecorate 34(T3) 0 ColMajor
|
||||
MemberDecorate 34(T3) 1 RowMajor
|
||||
MemberDecorate 34(T3) 2 ColMajor
|
||||
Decorate 34(T3) GLSLShared
|
||||
Decorate 34(T3) Block
|
||||
MemberDecorate 44(T2) 1 RowMajor
|
||||
Decorate 44(T2) GLSLShared
|
||||
Decorate 44(T2) Block
|
||||
Decorate 52(color) Smooth
|
||||
Decorate 54(c) Location 7
|
||||
Decorate 62(iout) Flat
|
||||
Decorate 74(aiv2) Location 9
|
||||
Decorate 110(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 110(gl_VertexID) NoStaticUse
|
||||
Decorate 111(gl_InstanceID) BuiltIn InstanceId
|
||||
Decorate 111(gl_InstanceID) NoStaticUse
|
||||
Name 9 "pos"
|
||||
Name 11 "p"
|
||||
Name 17 "Transform"
|
||||
MemberName 17(Transform) 0 "M1"
|
||||
MemberName 17(Transform) 1 "M2"
|
||||
MemberName 17(Transform) 2 "N1"
|
||||
MemberName 17(Transform) 3 "iuin"
|
||||
Name 19 "tblock"
|
||||
Name 33 "T3"
|
||||
MemberName 33(T3) 0 "M3"
|
||||
MemberName 33(T3) 1 "M4"
|
||||
MemberName 33(T3) 2 "N2"
|
||||
MemberName 33(T3) 3 "uv3a"
|
||||
Name 35 ""
|
||||
Name 43 "T2"
|
||||
MemberName 43(T2) 0 "b"
|
||||
MemberName 43(T2) 1 "t2m"
|
||||
Name 45 ""
|
||||
Name 51 "color"
|
||||
Name 53 "c"
|
||||
Name 61 "iout"
|
||||
Name 67 "uiuin"
|
||||
Name 73 "aiv2"
|
||||
Name 77 "S"
|
||||
MemberName 77(S) 0 "c"
|
||||
MemberName 77(S) 1 "f"
|
||||
Name 79 "s"
|
||||
Name 109 "gl_VertexID"
|
||||
Name 110 "gl_InstanceID"
|
||||
Decorate 9(pos) Smooth
|
||||
Decorate 11(p) Location 3
|
||||
MemberDecorate 17(Transform) 0 RowMajor
|
||||
MemberDecorate 17(Transform) 0 Offset 0
|
||||
MemberDecorate 17(Transform) 0 MatrixStride 16
|
||||
MemberDecorate 17(Transform) 1 ColMajor
|
||||
MemberDecorate 17(Transform) 1 Offset 64
|
||||
MemberDecorate 17(Transform) 1 MatrixStride 16
|
||||
MemberDecorate 17(Transform) 2 RowMajor
|
||||
MemberDecorate 17(Transform) 2 Offset 128
|
||||
MemberDecorate 17(Transform) 2 MatrixStride 16
|
||||
MemberDecorate 17(Transform) 3 Offset 176
|
||||
Decorate 17(Transform) Block
|
||||
MemberDecorate 33(T3) 0 ColMajor
|
||||
MemberDecorate 33(T3) 1 RowMajor
|
||||
MemberDecorate 33(T3) 2 ColMajor
|
||||
Decorate 33(T3) GLSLShared
|
||||
Decorate 33(T3) Block
|
||||
MemberDecorate 43(T2) 1 RowMajor
|
||||
Decorate 43(T2) GLSLShared
|
||||
Decorate 43(T2) Block
|
||||
Decorate 51(color) Smooth
|
||||
Decorate 53(c) Location 7
|
||||
Decorate 61(iout) Flat
|
||||
Decorate 73(aiv2) Location 9
|
||||
Decorate 109(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 109(gl_VertexID) NoStaticUse
|
||||
Decorate 110(gl_InstanceID) BuiltIn InstanceId
|
||||
Decorate 110(gl_InstanceID) NoStaticUse
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
7: TypeFloat 32
|
||||
8: TypeVector 7(float) 4
|
||||
9: TypePointer Output 8(fvec4)
|
||||
10(pos): 9(ptr) Variable Output
|
||||
11: TypePointer Input 8(fvec4)
|
||||
12(p): 11(ptr) Variable Input
|
||||
14: TypeMatrix 8(fvec4) 4
|
||||
15: TypeVector 7(float) 3
|
||||
16: TypeMatrix 15(fvec3) 3
|
||||
17: TypeInt 32 1
|
||||
18(Transform): TypeStruct 14 14 16 17(int)
|
||||
19: TypePointer Uniform 18(Transform)
|
||||
20(tblock): 19(ptr) Variable Uniform
|
||||
21: 17(int) Constant 0
|
||||
22: TypePointer Uniform 14
|
||||
25: 17(int) Constant 1
|
||||
29: TypeMatrix 15(fvec3) 2
|
||||
30: TypeInt 32 0
|
||||
31: TypeVector 30(int) 3
|
||||
32: 30(int) Constant 4
|
||||
33: TypeArray 31(ivec3) 32
|
||||
34(T3): TypeStruct 14 14 29 33
|
||||
35: TypePointer Uniform 34(T3)
|
||||
36: 35(ptr) Variable Uniform
|
||||
43: TypeBool
|
||||
44(T2): TypeStruct 43(bool) 14
|
||||
45: TypePointer Uniform 44(T2)
|
||||
46: 45(ptr) Variable Uniform
|
||||
51: TypePointer Output 15(fvec3)
|
||||
52(color): 51(ptr) Variable Output
|
||||
53: TypePointer Input 15(fvec3)
|
||||
54(c): 53(ptr) Variable Input
|
||||
56: 17(int) Constant 2
|
||||
57: TypePointer Uniform 16
|
||||
61: TypePointer Output 17(int)
|
||||
62(iout): 61(ptr) Variable Output
|
||||
63: 17(int) Constant 3
|
||||
64: TypePointer Uniform 17(int)
|
||||
67: TypePointer UniformConstant 30(int)
|
||||
68(uiuin): 67(ptr) Variable UniformConstant
|
||||
72: TypeVector 17(int) 2
|
||||
73: TypePointer Input 72(ivec2)
|
||||
74(aiv2): 73(ptr) Variable Input
|
||||
78(S): TypeStruct 15(fvec3) 7(float)
|
||||
79: TypePointer Output 78(S)
|
||||
80(s): 79(ptr) Variable Output
|
||||
85: TypePointer Output 7(float)
|
||||
87: TypePointer Uniform 15(fvec3)
|
||||
90: 7(float) Constant 1065353216
|
||||
91: 15(fvec3) ConstantComposite 90 90 90
|
||||
92: TypeVector 43(bool) 3
|
||||
95: TypePointer Uniform 31(ivec3)
|
||||
98: 30(int) Constant 5
|
||||
99: 31(ivec3) ConstantComposite 98 98 98
|
||||
109: TypePointer Input 17(int)
|
||||
110(gl_VertexID): 109(ptr) Variable Input
|
||||
111(gl_InstanceID): 109(ptr) Variable Input
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypePointer Output 7(fvec4)
|
||||
9(pos): 8(ptr) Variable Output
|
||||
10: TypePointer Input 7(fvec4)
|
||||
11(p): 10(ptr) Variable Input
|
||||
13: TypeMatrix 7(fvec4) 4
|
||||
14: TypeVector 6(float) 3
|
||||
15: TypeMatrix 14(fvec3) 3
|
||||
16: TypeInt 32 1
|
||||
17(Transform): TypeStruct 13 13 15 16(int)
|
||||
18: TypePointer Uniform 17(Transform)
|
||||
19(tblock): 18(ptr) Variable Uniform
|
||||
20: 16(int) Constant 0
|
||||
21: TypePointer Uniform 13
|
||||
24: 16(int) Constant 1
|
||||
28: TypeMatrix 14(fvec3) 2
|
||||
29: TypeInt 32 0
|
||||
30: TypeVector 29(int) 3
|
||||
31: 29(int) Constant 4
|
||||
32: TypeArray 30(ivec3) 31
|
||||
33(T3): TypeStruct 13 13 28 32
|
||||
34: TypePointer Uniform 33(T3)
|
||||
35: 34(ptr) Variable Uniform
|
||||
42: TypeBool
|
||||
43(T2): TypeStruct 42(bool) 13
|
||||
44: TypePointer Uniform 43(T2)
|
||||
45: 44(ptr) Variable Uniform
|
||||
50: TypePointer Output 14(fvec3)
|
||||
51(color): 50(ptr) Variable Output
|
||||
52: TypePointer Input 14(fvec3)
|
||||
53(c): 52(ptr) Variable Input
|
||||
55: 16(int) Constant 2
|
||||
56: TypePointer Uniform 15
|
||||
60: TypePointer Output 16(int)
|
||||
61(iout): 60(ptr) Variable Output
|
||||
62: 16(int) Constant 3
|
||||
63: TypePointer Uniform 16(int)
|
||||
66: TypePointer UniformConstant 29(int)
|
||||
67(uiuin): 66(ptr) Variable UniformConstant
|
||||
71: TypeVector 16(int) 2
|
||||
72: TypePointer Input 71(ivec2)
|
||||
73(aiv2): 72(ptr) Variable Input
|
||||
77(S): TypeStruct 14(fvec3) 6(float)
|
||||
78: TypePointer Output 77(S)
|
||||
79(s): 78(ptr) Variable Output
|
||||
84: TypePointer Output 6(float)
|
||||
86: TypePointer Uniform 14(fvec3)
|
||||
89: 6(float) Constant 1065353216
|
||||
90: 14(fvec3) ConstantComposite 89 89 89
|
||||
91: TypeVector 42(bool) 3
|
||||
94: TypePointer Uniform 30(ivec3)
|
||||
97: 29(int) Constant 5
|
||||
98: 30(ivec3) ConstantComposite 97 97 97
|
||||
108: TypePointer Input 16(int)
|
||||
109(gl_VertexID): 108(ptr) Variable Input
|
||||
110(gl_InstanceID): 108(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
13: 8(fvec4) Load 12(p)
|
||||
23: 22(ptr) AccessChain 20(tblock) 21
|
||||
24: 14 Load 23
|
||||
26: 22(ptr) AccessChain 20(tblock) 25
|
||||
27: 14 Load 26
|
||||
28: 14 MatrixTimesMatrix 24 27
|
||||
37: 22(ptr) AccessChain 36 25
|
||||
38: 14 Load 37
|
||||
39: 14 MatrixTimesMatrix 28 38
|
||||
40: 22(ptr) AccessChain 36 21
|
||||
41: 14 Load 40
|
||||
42: 14 MatrixTimesMatrix 39 41
|
||||
47: 22(ptr) AccessChain 46 25
|
||||
48: 14 Load 47
|
||||
49: 14 MatrixTimesMatrix 42 48
|
||||
50: 8(fvec4) VectorTimesMatrix 13 49
|
||||
Store 10(pos) 50
|
||||
55: 15(fvec3) Load 54(c)
|
||||
58: 57(ptr) AccessChain 20(tblock) 56
|
||||
59: 16 Load 58
|
||||
60: 15(fvec3) VectorTimesMatrix 55 59
|
||||
Store 52(color) 60
|
||||
65: 64(ptr) AccessChain 20(tblock) 63
|
||||
66: 17(int) Load 65
|
||||
69: 30(int) Load 68(uiuin)
|
||||
70: 17(int) Bitcast 69
|
||||
71: 17(int) IAdd 66 70
|
||||
75: 72(ivec2) Load 74(aiv2)
|
||||
76: 17(int) CompositeExtract 75 1
|
||||
77: 17(int) IAdd 71 76
|
||||
Store 62(iout) 77
|
||||
81: 15(fvec3) Load 54(c)
|
||||
82: 51(ptr) AccessChain 80(s) 21
|
||||
Store 82 81
|
||||
83: 8(fvec4) Load 12(p)
|
||||
84: 7(float) CompositeExtract 83 0
|
||||
86: 85(ptr) AccessChain 80(s) 25
|
||||
Store 86 84
|
||||
88: 87(ptr) AccessChain 36 56 25
|
||||
89: 15(fvec3) Load 88
|
||||
93: 92(bvec3) FOrdNotEqual 89 91
|
||||
94: 43(bool) Any 93
|
||||
96: 95(ptr) AccessChain 36 63 56
|
||||
97: 31(ivec3) Load 96
|
||||
100: 92(bvec3) INotEqual 97 99
|
||||
101: 43(bool) Any 100
|
||||
102: 43(bool) LogicalOr 94 101
|
||||
SelectionMerge 104 None
|
||||
BranchConditional 102 103 104
|
||||
103: Label
|
||||
105: 51(ptr) AccessChain 80(s) 21
|
||||
106: 15(fvec3) Load 105
|
||||
107: 15(fvec3) CompositeConstruct 90 90 90
|
||||
108: 15(fvec3) FAdd 106 107
|
||||
Store 105 108
|
||||
Branch 104
|
||||
104: Label
|
||||
Branch 6
|
||||
6: Label
|
||||
12: 7(fvec4) Load 11(p)
|
||||
22: 21(ptr) AccessChain 19(tblock) 20
|
||||
23: 13 Load 22
|
||||
25: 21(ptr) AccessChain 19(tblock) 24
|
||||
26: 13 Load 25
|
||||
27: 13 MatrixTimesMatrix 23 26
|
||||
36: 21(ptr) AccessChain 35 24
|
||||
37: 13 Load 36
|
||||
38: 13 MatrixTimesMatrix 27 37
|
||||
39: 21(ptr) AccessChain 35 20
|
||||
40: 13 Load 39
|
||||
41: 13 MatrixTimesMatrix 38 40
|
||||
46: 21(ptr) AccessChain 45 24
|
||||
47: 13 Load 46
|
||||
48: 13 MatrixTimesMatrix 41 47
|
||||
49: 7(fvec4) VectorTimesMatrix 12 48
|
||||
Store 9(pos) 49
|
||||
54: 14(fvec3) Load 53(c)
|
||||
57: 56(ptr) AccessChain 19(tblock) 55
|
||||
58: 15 Load 57
|
||||
59: 14(fvec3) VectorTimesMatrix 54 58
|
||||
Store 51(color) 59
|
||||
64: 63(ptr) AccessChain 19(tblock) 62
|
||||
65: 16(int) Load 64
|
||||
68: 29(int) Load 67(uiuin)
|
||||
69: 16(int) Bitcast 68
|
||||
70: 16(int) IAdd 65 69
|
||||
74: 71(ivec2) Load 73(aiv2)
|
||||
75: 16(int) CompositeExtract 74 1
|
||||
76: 16(int) IAdd 70 75
|
||||
Store 61(iout) 76
|
||||
80: 14(fvec3) Load 53(c)
|
||||
81: 50(ptr) AccessChain 79(s) 20
|
||||
Store 81 80
|
||||
82: 7(fvec4) Load 11(p)
|
||||
83: 6(float) CompositeExtract 82 0
|
||||
85: 84(ptr) AccessChain 79(s) 24
|
||||
Store 85 83
|
||||
87: 86(ptr) AccessChain 35 55 24
|
||||
88: 14(fvec3) Load 87
|
||||
92: 91(bvec3) FOrdNotEqual 88 90
|
||||
93: 42(bool) Any 92
|
||||
95: 94(ptr) AccessChain 35 62 55
|
||||
96: 30(ivec3) Load 95
|
||||
99: 91(bvec3) INotEqual 96 98
|
||||
100: 42(bool) Any 99
|
||||
101: 42(bool) LogicalOr 93 100
|
||||
SelectionMerge 103 None
|
||||
BranchConditional 101 102 103
|
||||
102: Label
|
||||
104: 50(ptr) AccessChain 79(s) 20
|
||||
105: 14(fvec3) Load 104
|
||||
106: 14(fvec3) CompositeConstruct 89 89 89
|
||||
107: 14(fvec3) FAdd 105 106
|
||||
Store 104 107
|
||||
Branch 103
|
||||
103: Label
|
||||
Return
|
||||
FunctionEnd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue