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
|
|
@ -8,7 +8,7 @@ Linked vertex stage:
|
|||
|
||||
// Module Version 99
|
||||
// Generated by (magic number): 51a00bb
|
||||
// Id's are bound by 39
|
||||
// Id's are bound by 38
|
||||
|
||||
Source GLSL 130
|
||||
Capability Shader
|
||||
|
|
@ -16,60 +16,58 @@ Linked vertex stage:
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main"
|
||||
Name 4 "main"
|
||||
Name 9 "i"
|
||||
Name 24 "colorOut"
|
||||
Name 27 "color"
|
||||
Name 33 "gl_Position"
|
||||
Name 38 "gl_VertexID"
|
||||
Decorate 24(colorOut) Smooth
|
||||
Decorate 33(gl_Position) BuiltIn Position
|
||||
Decorate 38(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 38(gl_VertexID) NoStaticUse
|
||||
Name 8 "i"
|
||||
Name 23 "colorOut"
|
||||
Name 26 "color"
|
||||
Name 32 "gl_Position"
|
||||
Name 37 "gl_VertexID"
|
||||
Decorate 23(colorOut) Smooth
|
||||
Decorate 32(gl_Position) BuiltIn Position
|
||||
Decorate 37(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 37(gl_VertexID) NoStaticUse
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
7: TypeInt 32 1
|
||||
8: TypePointer Function 7(int)
|
||||
10: 7(int) Constant 1
|
||||
15: 7(int) Constant 5
|
||||
16: TypeBool
|
||||
18: TypeFloat 32
|
||||
19: TypeVector 18(float) 4
|
||||
20: TypeInt 32 0
|
||||
21: 20(int) Constant 6
|
||||
22: TypeArray 19(fvec4) 21
|
||||
23: TypePointer Output 22
|
||||
24(colorOut): 23(ptr) Variable Output
|
||||
26: TypePointer Input 19(fvec4)
|
||||
27(color): 26(ptr) Variable Input
|
||||
29: TypePointer Output 19(fvec4)
|
||||
33(gl_Position): 29(ptr) Variable Output
|
||||
34: 7(int) Constant 2
|
||||
37: TypePointer Input 7(int)
|
||||
38(gl_VertexID): 37(ptr) Variable Input
|
||||
6: TypeInt 32 1
|
||||
7: TypePointer Function 6(int)
|
||||
9: 6(int) Constant 1
|
||||
14: 6(int) Constant 5
|
||||
15: TypeBool
|
||||
17: TypeFloat 32
|
||||
18: TypeVector 17(float) 4
|
||||
19: TypeInt 32 0
|
||||
20: 19(int) Constant 6
|
||||
21: TypeArray 18(fvec4) 20
|
||||
22: TypePointer Output 21
|
||||
23(colorOut): 22(ptr) Variable Output
|
||||
25: TypePointer Input 18(fvec4)
|
||||
26(color): 25(ptr) Variable Input
|
||||
28: TypePointer Output 18(fvec4)
|
||||
32(gl_Position): 28(ptr) Variable Output
|
||||
33: 6(int) Constant 2
|
||||
36: TypePointer Input 6(int)
|
||||
37(gl_VertexID): 36(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
9(i): 8(ptr) Variable Function
|
||||
Store 9(i) 10
|
||||
Branch 11
|
||||
8(i): 7(ptr) Variable Function
|
||||
Store 8(i) 9
|
||||
Branch 10
|
||||
10: Label
|
||||
13: 6(int) Load 8(i)
|
||||
16: 15(bool) SLessThan 13 14
|
||||
LoopMerge 11 None
|
||||
BranchConditional 16 12 11
|
||||
12: Label
|
||||
24: 6(int) Load 8(i)
|
||||
27: 18(fvec4) Load 26(color)
|
||||
29: 28(ptr) AccessChain 23(colorOut) 24
|
||||
Store 29 27
|
||||
30: 6(int) Load 8(i)
|
||||
31: 6(int) IAdd 30 9
|
||||
Store 8(i) 31
|
||||
Branch 10
|
||||
11: Label
|
||||
14: 7(int) Load 9(i)
|
||||
17: 16(bool) SLessThan 14 15
|
||||
LoopMerge 12 None
|
||||
BranchConditional 17 13 12
|
||||
13: Label
|
||||
25: 7(int) Load 9(i)
|
||||
28: 19(fvec4) Load 27(color)
|
||||
30: 29(ptr) AccessChain 24(colorOut) 25
|
||||
Store 30 28
|
||||
31: 7(int) Load 9(i)
|
||||
32: 7(int) IAdd 31 10
|
||||
Store 9(i) 32
|
||||
Branch 11
|
||||
12: Label
|
||||
35: 29(ptr) AccessChain 24(colorOut) 34
|
||||
36: 19(fvec4) Load 35
|
||||
Store 33(gl_Position) 36
|
||||
Branch 6
|
||||
6: Label
|
||||
34: 28(ptr) AccessChain 23(colorOut) 33
|
||||
35: 18(fvec4) Load 34
|
||||
Store 32(gl_Position) 35
|
||||
Return
|
||||
FunctionEnd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue