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
|
|
@ -7,7 +7,7 @@ Linked vertex stage:
|
|||
|
||||
// Module Version 99
|
||||
// Generated by (magic number): 51a00bb
|
||||
// Id's are bound by 63
|
||||
// Id's are bound by 62
|
||||
|
||||
Source GLSL 430
|
||||
Capability Shader
|
||||
|
|
@ -15,122 +15,120 @@ Linked vertex stage:
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main"
|
||||
Name 4 "main"
|
||||
Name 11 "gl_PerVertex"
|
||||
MemberName 11(gl_PerVertex) 0 "gl_ClipDistance"
|
||||
Name 13 ""
|
||||
Name 24 "bad"
|
||||
Name 35 "badorder3"
|
||||
Name 39 "f"
|
||||
Name 43 "uv4"
|
||||
Name 44 "badorder"
|
||||
Name 45 "badorder2"
|
||||
Name 46 "boundblock"
|
||||
MemberName 46(boundblock) 0 "aoeu"
|
||||
Name 48 "boundInst"
|
||||
Name 49 "anonblock"
|
||||
MemberName 49(anonblock) 0 "aoeu"
|
||||
Name 51 ""
|
||||
Name 55 "sampb1"
|
||||
Name 58 "sampb2"
|
||||
Name 59 "sampb4"
|
||||
Name 61 "gl_VertexID"
|
||||
Name 62 "gl_InstanceID"
|
||||
MemberDecorate 11(gl_PerVertex) 0 BuiltIn ClipDistance
|
||||
Decorate 11(gl_PerVertex) Block
|
||||
Decorate 35(badorder3) Flat
|
||||
Decorate 43(uv4) Location 4
|
||||
Decorate 43(uv4) NoStaticUse
|
||||
Decorate 29 NoStaticUse
|
||||
Decorate 29 NoStaticUse
|
||||
Decorate 44(badorder) NoStaticUse
|
||||
Decorate 45(badorder2) Smooth
|
||||
Decorate 45(badorder2) Invariant
|
||||
Decorate 45(badorder2) NoStaticUse
|
||||
Decorate 46(boundblock) GLSLShared
|
||||
Decorate 46(boundblock) Block
|
||||
Decorate 48(boundInst) Binding 3
|
||||
Decorate 48(boundInst) NoStaticUse
|
||||
Decorate 49(anonblock) GLSLShared
|
||||
Decorate 49(anonblock) Block
|
||||
Decorate 51 Binding 7
|
||||
Decorate 51 NoStaticUse
|
||||
Decorate 55(sampb1) Binding 4
|
||||
Decorate 55(sampb1) NoStaticUse
|
||||
Decorate 58(sampb2) Binding 5
|
||||
Decorate 58(sampb2) NoStaticUse
|
||||
Decorate 59(sampb4) Binding 31
|
||||
Decorate 59(sampb4) NoStaticUse
|
||||
Decorate 61(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 61(gl_VertexID) NoStaticUse
|
||||
Decorate 62(gl_InstanceID) BuiltIn InstanceId
|
||||
Decorate 62(gl_InstanceID) NoStaticUse
|
||||
Name 10 "gl_PerVertex"
|
||||
MemberName 10(gl_PerVertex) 0 "gl_ClipDistance"
|
||||
Name 12 ""
|
||||
Name 23 "bad"
|
||||
Name 34 "badorder3"
|
||||
Name 38 "f"
|
||||
Name 42 "uv4"
|
||||
Name 43 "badorder"
|
||||
Name 44 "badorder2"
|
||||
Name 45 "boundblock"
|
||||
MemberName 45(boundblock) 0 "aoeu"
|
||||
Name 47 "boundInst"
|
||||
Name 48 "anonblock"
|
||||
MemberName 48(anonblock) 0 "aoeu"
|
||||
Name 50 ""
|
||||
Name 54 "sampb1"
|
||||
Name 57 "sampb2"
|
||||
Name 58 "sampb4"
|
||||
Name 60 "gl_VertexID"
|
||||
Name 61 "gl_InstanceID"
|
||||
MemberDecorate 10(gl_PerVertex) 0 BuiltIn ClipDistance
|
||||
Decorate 10(gl_PerVertex) Block
|
||||
Decorate 34(badorder3) Flat
|
||||
Decorate 42(uv4) Location 4
|
||||
Decorate 42(uv4) NoStaticUse
|
||||
Decorate 28 NoStaticUse
|
||||
Decorate 28 NoStaticUse
|
||||
Decorate 43(badorder) NoStaticUse
|
||||
Decorate 44(badorder2) Smooth
|
||||
Decorate 44(badorder2) Invariant
|
||||
Decorate 44(badorder2) NoStaticUse
|
||||
Decorate 45(boundblock) GLSLShared
|
||||
Decorate 45(boundblock) Block
|
||||
Decorate 47(boundInst) Binding 3
|
||||
Decorate 47(boundInst) NoStaticUse
|
||||
Decorate 48(anonblock) GLSLShared
|
||||
Decorate 48(anonblock) Block
|
||||
Decorate 50 Binding 7
|
||||
Decorate 50 NoStaticUse
|
||||
Decorate 54(sampb1) Binding 4
|
||||
Decorate 54(sampb1) NoStaticUse
|
||||
Decorate 57(sampb2) Binding 5
|
||||
Decorate 57(sampb2) NoStaticUse
|
||||
Decorate 58(sampb4) Binding 31
|
||||
Decorate 58(sampb4) NoStaticUse
|
||||
Decorate 60(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 60(gl_VertexID) NoStaticUse
|
||||
Decorate 61(gl_InstanceID) BuiltIn InstanceId
|
||||
Decorate 61(gl_InstanceID) NoStaticUse
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
7: TypeFloat 32
|
||||
8: TypeInt 32 0
|
||||
9: 8(int) Constant 3
|
||||
10: TypeArray 7(float) 9
|
||||
11(gl_PerVertex): TypeStruct 10
|
||||
12: TypePointer Output 11(gl_PerVertex)
|
||||
13: 12(ptr) Variable Output
|
||||
14: TypeInt 32 1
|
||||
15: 14(int) Constant 0
|
||||
16: 14(int) Constant 2
|
||||
17: 7(float) Constant 1080872141
|
||||
18: TypePointer Output 7(float)
|
||||
20: TypeVector 7(float) 4
|
||||
21: 8(int) Constant 10
|
||||
22: TypeArray 20(fvec4) 21
|
||||
23: TypePointer Input 22
|
||||
24(bad): 23(ptr) Variable Input
|
||||
25: TypePointer Input 20(fvec4)
|
||||
29: 7(float) Constant 1082549862
|
||||
30: TypeBool
|
||||
34: TypePointer Output 20(fvec4)
|
||||
35(badorder3): 34(ptr) Variable Output
|
||||
38: TypePointer UniformConstant 7(float)
|
||||
39(f): 38(ptr) Variable UniformConstant
|
||||
42: TypePointer UniformConstant 20(fvec4)
|
||||
43(uv4): 42(ptr) Variable UniformConstant
|
||||
44(badorder): 25(ptr) Variable Input
|
||||
45(badorder2): 34(ptr) Variable Output
|
||||
46(boundblock): TypeStruct 14(int)
|
||||
47: TypePointer Uniform 46(boundblock)
|
||||
48(boundInst): 47(ptr) Variable Uniform
|
||||
49(anonblock): TypeStruct 14(int)
|
||||
50: TypePointer Uniform 49(anonblock)
|
||||
51: 50(ptr) Variable Uniform
|
||||
52: TypeImage 7(float) 2D sampled format:Unknown
|
||||
53: TypeSampledImage 52
|
||||
54: TypePointer UniformConstant 53
|
||||
55(sampb1): 54(ptr) Variable UniformConstant
|
||||
56: TypeArray 53 21
|
||||
57: TypePointer UniformConstant 56
|
||||
58(sampb2): 57(ptr) Variable UniformConstant
|
||||
59(sampb4): 54(ptr) Variable UniformConstant
|
||||
60: TypePointer Input 14(int)
|
||||
61(gl_VertexID): 60(ptr) Variable Input
|
||||
62(gl_InstanceID): 60(ptr) Variable Input
|
||||
6: TypeFloat 32
|
||||
7: TypeInt 32 0
|
||||
8: 7(int) Constant 3
|
||||
9: TypeArray 6(float) 8
|
||||
10(gl_PerVertex): TypeStruct 9
|
||||
11: TypePointer Output 10(gl_PerVertex)
|
||||
12: 11(ptr) Variable Output
|
||||
13: TypeInt 32 1
|
||||
14: 13(int) Constant 0
|
||||
15: 13(int) Constant 2
|
||||
16: 6(float) Constant 1080872141
|
||||
17: TypePointer Output 6(float)
|
||||
19: TypeVector 6(float) 4
|
||||
20: 7(int) Constant 10
|
||||
21: TypeArray 19(fvec4) 20
|
||||
22: TypePointer Input 21
|
||||
23(bad): 22(ptr) Variable Input
|
||||
24: TypePointer Input 19(fvec4)
|
||||
28: 6(float) Constant 1082549862
|
||||
29: TypeBool
|
||||
33: TypePointer Output 19(fvec4)
|
||||
34(badorder3): 33(ptr) Variable Output
|
||||
37: TypePointer UniformConstant 6(float)
|
||||
38(f): 37(ptr) Variable UniformConstant
|
||||
41: TypePointer UniformConstant 19(fvec4)
|
||||
42(uv4): 41(ptr) Variable UniformConstant
|
||||
43(badorder): 24(ptr) Variable Input
|
||||
44(badorder2): 33(ptr) Variable Output
|
||||
45(boundblock): TypeStruct 13(int)
|
||||
46: TypePointer Uniform 45(boundblock)
|
||||
47(boundInst): 46(ptr) Variable Uniform
|
||||
48(anonblock): TypeStruct 13(int)
|
||||
49: TypePointer Uniform 48(anonblock)
|
||||
50: 49(ptr) Variable Uniform
|
||||
51: TypeImage 6(float) 2D sampled format:Unknown
|
||||
52: TypeSampledImage 51
|
||||
53: TypePointer UniformConstant 52
|
||||
54(sampb1): 53(ptr) Variable UniformConstant
|
||||
55: TypeArray 52 20
|
||||
56: TypePointer UniformConstant 55
|
||||
57(sampb2): 56(ptr) Variable UniformConstant
|
||||
58(sampb4): 53(ptr) Variable UniformConstant
|
||||
59: TypePointer Input 13(int)
|
||||
60(gl_VertexID): 59(ptr) Variable Input
|
||||
61(gl_InstanceID): 59(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
19: 18(ptr) AccessChain 13 15 16
|
||||
Store 19 17
|
||||
26: 25(ptr) AccessChain 24(bad) 15
|
||||
27: 20(fvec4) Load 26
|
||||
28: 7(float) CompositeExtract 27 0
|
||||
31: 30(bool) FOrdEqual 28 29
|
||||
SelectionMerge 33 None
|
||||
BranchConditional 31 32 33
|
||||
32: Label
|
||||
36: 25(ptr) AccessChain 24(bad) 15
|
||||
37: 20(fvec4) Load 36
|
||||
Store 35(badorder3) 37
|
||||
Branch 33
|
||||
33: Label
|
||||
40: 7(float) Load 39(f)
|
||||
41: 18(ptr) AccessChain 13 15 15
|
||||
Store 41 40
|
||||
Branch 6
|
||||
6: Label
|
||||
18: 17(ptr) AccessChain 12 14 15
|
||||
Store 18 16
|
||||
25: 24(ptr) AccessChain 23(bad) 14
|
||||
26: 19(fvec4) Load 25
|
||||
27: 6(float) CompositeExtract 26 0
|
||||
30: 29(bool) FOrdEqual 27 28
|
||||
SelectionMerge 32 None
|
||||
BranchConditional 30 31 32
|
||||
31: Label
|
||||
35: 24(ptr) AccessChain 23(bad) 14
|
||||
36: 19(fvec4) Load 35
|
||||
Store 34(badorder3) 36
|
||||
Branch 32
|
||||
32: Label
|
||||
39: 6(float) Load 38(f)
|
||||
40: 17(ptr) AccessChain 12 14 14
|
||||
Store 40 39
|
||||
Return
|
||||
FunctionEnd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue