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

@@ -8,7 +8,7 @@ Linked fragment stage:
// Module Version 99
// Generated by (magic number): 51a00bb
// Id's are bound by 19
// Id's are bound by 18
Source GLSL 130
Capability Shader
@@ -17,33 +17,31 @@ Linked fragment stage:
EntryPoint Fragment 4 "main"
ExecutionMode 4 OriginLowerLeft
Name 4 "main"
Name 9 "gl_FragDepth"
Name 11 "Depth"
Name 15 "gl_FragColor"
Name 17 "Color"
Decorate 9(gl_FragDepth) BuiltIn FragDepth
Decorate 11(Depth) Smooth
Decorate 15(gl_FragColor) BuiltIn FragColor
Decorate 17(Color) Smooth
Name 8 "gl_FragDepth"
Name 10 "Depth"
Name 14 "gl_FragColor"
Name 16 "Color"
Decorate 8(gl_FragDepth) BuiltIn FragDepth
Decorate 10(Depth) Smooth
Decorate 14(gl_FragColor) BuiltIn FragColor
Decorate 16(Color) Smooth
2: TypeVoid
3: TypeFunction 2
7: TypeFloat 32
8: TypePointer Output 7(float)
9(gl_FragDepth): 8(ptr) Variable Output
10: TypePointer Input 7(float)
11(Depth): 10(ptr) Variable Input
13: TypeVector 7(float) 4
14: TypePointer Output 13(fvec4)
15(gl_FragColor): 14(ptr) Variable Output
16: TypePointer Input 13(fvec4)
17(Color): 16(ptr) Variable Input
6: TypeFloat 32
7: TypePointer Output 6(float)
8(gl_FragDepth): 7(ptr) Variable Output
9: TypePointer Input 6(float)
10(Depth): 9(ptr) Variable Input
12: TypeVector 6(float) 4
13: TypePointer Output 12(fvec4)
14(gl_FragColor): 13(ptr) Variable Output
15: TypePointer Input 12(fvec4)
16(Color): 15(ptr) Variable Input
4(main): 2 Function None 3
5: Label
12: 7(float) Load 11(Depth)
Store 9(gl_FragDepth) 12
18: 13(fvec4) Load 17(Color)
Store 15(gl_FragColor) 18
Branch 6
6: Label
11: 6(float) Load 10(Depth)
Store 8(gl_FragDepth) 11
17: 12(fvec4) Load 16(Color)
Store 14(gl_FragColor) 17
Return
FunctionEnd