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:
John Kessenich 2015-09-14 20:58:02 -06:00
parent 5f5b205ce9
commit e770b3e6cf
74 changed files with 9648 additions and 9816 deletions

View file

@ -7,7 +7,7 @@ Linked vertex stage:
// Module Version 99
// Generated by (magic number): 51a00bb
// Id's are bound by 26
// Id's are bound by 25
Source GLSL 430
Capability Shader
@ -15,52 +15,50 @@ Linked vertex stage:
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main"
Name 4 "main"
Name 10 "outVc"
Name 12 "inV"
Name 14 "outVs"
Name 16 "outVf"
Name 18 "outVn"
Name 20 "outVcn"
Name 24 "gl_VertexID"
Name 25 "gl_InstanceID"
Decorate 10(outVc) Smooth
Decorate 14(outVs) Smooth
Decorate 16(outVf) Flat
Decorate 18(outVn) Noperspective
Decorate 20(outVcn) Noperspective
Decorate 24(gl_VertexID) BuiltIn VertexId
Decorate 24(gl_VertexID) NoStaticUse
Decorate 25(gl_InstanceID) BuiltIn InstanceId
Decorate 25(gl_InstanceID) NoStaticUse
Name 9 "outVc"
Name 11 "inV"
Name 13 "outVs"
Name 15 "outVf"
Name 17 "outVn"
Name 19 "outVcn"
Name 23 "gl_VertexID"
Name 24 "gl_InstanceID"
Decorate 9(outVc) Smooth
Decorate 13(outVs) Smooth
Decorate 15(outVf) Flat
Decorate 17(outVn) Noperspective
Decorate 19(outVcn) Noperspective
Decorate 23(gl_VertexID) BuiltIn VertexId
Decorate 23(gl_VertexID) NoStaticUse
Decorate 24(gl_InstanceID) BuiltIn InstanceId
Decorate 24(gl_InstanceID) NoStaticUse
2: TypeVoid
3: TypeFunction 2
7: TypeFloat 32
8: TypeVector 7(float) 4
9: TypePointer Output 8(fvec4)
10(outVc): 9(ptr) Variable Output
11: TypePointer Input 8(fvec4)
12(inV): 11(ptr) Variable Input
14(outVs): 9(ptr) Variable Output
16(outVf): 9(ptr) Variable Output
18(outVn): 9(ptr) Variable Output
20(outVcn): 9(ptr) Variable Output
22: TypeInt 32 1
23: TypePointer Input 22(int)
24(gl_VertexID): 23(ptr) Variable Input
25(gl_InstanceID): 23(ptr) Variable Input
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(outVc): 8(ptr) Variable Output
10: TypePointer Input 7(fvec4)
11(inV): 10(ptr) Variable Input
13(outVs): 8(ptr) Variable Output
15(outVf): 8(ptr) Variable Output
17(outVn): 8(ptr) Variable Output
19(outVcn): 8(ptr) Variable Output
21: TypeInt 32 1
22: TypePointer Input 21(int)
23(gl_VertexID): 22(ptr) Variable Input
24(gl_InstanceID): 22(ptr) Variable Input
4(main): 2 Function None 3
5: Label
13: 8(fvec4) Load 12(inV)
Store 10(outVc) 13
15: 8(fvec4) Load 12(inV)
Store 14(outVs) 15
17: 8(fvec4) Load 12(inV)
Store 16(outVf) 17
19: 8(fvec4) Load 12(inV)
Store 18(outVn) 19
21: 8(fvec4) Load 12(inV)
Store 20(outVcn) 21
Branch 6
6: Label
12: 7(fvec4) Load 11(inV)
Store 9(outVc) 12
14: 7(fvec4) Load 11(inV)
Store 13(outVs) 14
16: 7(fvec4) Load 11(inV)
Store 15(outVf) 16
18: 7(fvec4) Load 11(inV)
Store 17(outVn) 18
20: 7(fvec4) Load 11(inV)
Store 19(outVcn) 20
Return
FunctionEnd