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:
@@ -5,7 +5,7 @@ Linked fragment stage:
|
||||
|
||||
// Module Version 99
|
||||
// Generated by (magic number): 51a00bb
|
||||
// Id's are bound by 37
|
||||
// Id's are bound by 36
|
||||
|
||||
Source GLSL 110
|
||||
Capability Shader
|
||||
@@ -14,51 +14,49 @@ Linked fragment stage:
|
||||
EntryPoint Fragment 4 "main"
|
||||
ExecutionMode 4 OriginLowerLeft
|
||||
Name 4 "main"
|
||||
Name 10 "v"
|
||||
Name 14 "tex"
|
||||
Name 18 "coord"
|
||||
Name 35 "gl_FragColor"
|
||||
Decorate 18(coord) Smooth
|
||||
Decorate 35(gl_FragColor) BuiltIn FragColor
|
||||
Name 9 "v"
|
||||
Name 13 "tex"
|
||||
Name 17 "coord"
|
||||
Name 34 "gl_FragColor"
|
||||
Decorate 17(coord) Smooth
|
||||
Decorate 34(gl_FragColor) BuiltIn FragColor
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
7: TypeFloat 32
|
||||
8: TypeVector 7(float) 4
|
||||
9: TypePointer Function 8(fvec4)
|
||||
11: TypeImage 7(float) 2D sampled format:Unknown
|
||||
12: TypeSampledImage 11
|
||||
13: TypePointer UniformConstant 12
|
||||
14(tex): 13(ptr) Variable UniformConstant
|
||||
16: TypeVector 7(float) 2
|
||||
17: TypePointer Input 16(fvec2)
|
||||
18(coord): 17(ptr) Variable Input
|
||||
22: 7(float) Constant 1036831949
|
||||
23: 7(float) Constant 1045220557
|
||||
24: 7(float) Constant 1050253722
|
||||
25: 7(float) Constant 1053609165
|
||||
26: 8(fvec4) ConstantComposite 22 23 24 25
|
||||
27: TypeBool
|
||||
28: TypeVector 27(bool) 4
|
||||
34: TypePointer Output 8(fvec4)
|
||||
35(gl_FragColor): 34(ptr) Variable Output
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypePointer Function 7(fvec4)
|
||||
10: TypeImage 6(float) 2D sampled format:Unknown
|
||||
11: TypeSampledImage 10
|
||||
12: TypePointer UniformConstant 11
|
||||
13(tex): 12(ptr) Variable UniformConstant
|
||||
15: TypeVector 6(float) 2
|
||||
16: TypePointer Input 15(fvec2)
|
||||
17(coord): 16(ptr) Variable Input
|
||||
21: 6(float) Constant 1036831949
|
||||
22: 6(float) Constant 1045220557
|
||||
23: 6(float) Constant 1050253722
|
||||
24: 6(float) Constant 1053609165
|
||||
25: 7(fvec4) ConstantComposite 21 22 23 24
|
||||
26: TypeBool
|
||||
27: TypeVector 26(bool) 4
|
||||
33: TypePointer Output 7(fvec4)
|
||||
34(gl_FragColor): 33(ptr) Variable Output
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
10(v): 9(ptr) Variable Function
|
||||
15: 12 Load 14(tex)
|
||||
19: 16(fvec2) Load 18(coord)
|
||||
20: 8(fvec4) ImageSampleImplicitLod 15 19
|
||||
Store 10(v) 20
|
||||
21: 8(fvec4) Load 10(v)
|
||||
29: 28(bvec4) FOrdEqual 21 26
|
||||
30: 27(bool) All 29
|
||||
SelectionMerge 32 None
|
||||
BranchConditional 30 31 32
|
||||
31: Label
|
||||
9(v): 8(ptr) Variable Function
|
||||
14: 11 Load 13(tex)
|
||||
18: 15(fvec2) Load 17(coord)
|
||||
19: 7(fvec4) ImageSampleImplicitLod 14 18
|
||||
Store 9(v) 19
|
||||
20: 7(fvec4) Load 9(v)
|
||||
28: 27(bvec4) FOrdEqual 20 25
|
||||
29: 26(bool) All 28
|
||||
SelectionMerge 31 None
|
||||
BranchConditional 29 30 31
|
||||
30: Label
|
||||
Kill
|
||||
32: Label
|
||||
36: 8(fvec4) Load 10(v)
|
||||
Store 35(gl_FragColor) 36
|
||||
Branch 6
|
||||
6: Label
|
||||
31: Label
|
||||
35: 7(fvec4) Load 9(v)
|
||||
Store 34(gl_FragColor) 35
|
||||
Return
|
||||
FunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user