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 fragment stage:
|
|||
|
||||
// Module Version 99
|
||||
// Generated by (magic number): 51a00bb
|
||||
// Id's are bound by 62
|
||||
// Id's are bound by 61
|
||||
|
||||
Source GLSL 130
|
||||
Capability Shader
|
||||
|
|
@ -16,91 +16,89 @@ Linked fragment stage:
|
|||
EntryPoint Fragment 4 "main"
|
||||
ExecutionMode 4 OriginLowerLeft
|
||||
Name 4 "main"
|
||||
Name 9 "scale"
|
||||
Name 19 "lunarStruct1"
|
||||
MemberName 19(lunarStruct1) 0 "i"
|
||||
MemberName 19(lunarStruct1) 1 "f"
|
||||
MemberName 19(lunarStruct1) 2 "color"
|
||||
Name 22 "lunarStruct2"
|
||||
MemberName 22(lunarStruct2) 0 "i"
|
||||
MemberName 22(lunarStruct2) 1 "f"
|
||||
MemberName 22(lunarStruct2) 2 "s1_1"
|
||||
Name 25 "foo2"
|
||||
Name 47 "gl_FragColor"
|
||||
Name 52 "sampler"
|
||||
Name 56 "coord"
|
||||
Name 61 "foo"
|
||||
Decorate 47(gl_FragColor) BuiltIn FragColor
|
||||
Decorate 56(coord) Smooth
|
||||
Decorate 61(foo) NoStaticUse
|
||||
Name 8 "scale"
|
||||
Name 18 "lunarStruct1"
|
||||
MemberName 18(lunarStruct1) 0 "i"
|
||||
MemberName 18(lunarStruct1) 1 "f"
|
||||
MemberName 18(lunarStruct1) 2 "color"
|
||||
Name 21 "lunarStruct2"
|
||||
MemberName 21(lunarStruct2) 0 "i"
|
||||
MemberName 21(lunarStruct2) 1 "f"
|
||||
MemberName 21(lunarStruct2) 2 "s1_1"
|
||||
Name 24 "foo2"
|
||||
Name 46 "gl_FragColor"
|
||||
Name 51 "sampler"
|
||||
Name 55 "coord"
|
||||
Name 60 "foo"
|
||||
Decorate 46(gl_FragColor) BuiltIn FragColor
|
||||
Decorate 55(coord) Smooth
|
||||
Decorate 60(foo) NoStaticUse
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
7: TypeFloat 32
|
||||
8: TypePointer Function 7(float)
|
||||
10: 7(float) Constant 0
|
||||
11: TypeInt 32 1
|
||||
12: TypeInt 32 0
|
||||
13: 12(int) Constant 5
|
||||
14: TypeArray 11(int) 13
|
||||
15: 12(int) Constant 4
|
||||
16: TypeArray 7(float) 15
|
||||
17: TypeVector 7(float) 4
|
||||
18: TypeArray 17(fvec4) 13
|
||||
19(lunarStruct1): TypeStruct 11(int) 16 18
|
||||
20: 12(int) Constant 7
|
||||
21: TypeArray 19(lunarStruct1) 20
|
||||
22(lunarStruct2): TypeStruct 14 7(float) 21
|
||||
23: TypeArray 22(lunarStruct2) 13
|
||||
24: TypePointer UniformConstant 23
|
||||
25(foo2): 24(ptr) Variable UniformConstant
|
||||
26: 11(int) Constant 3
|
||||
27: 11(int) Constant 0
|
||||
28: 11(int) Constant 4
|
||||
29: TypePointer UniformConstant 11(int)
|
||||
32: TypeBool
|
||||
36: 11(int) Constant 2
|
||||
37: TypePointer UniformConstant 17(fvec4)
|
||||
42: 11(int) Constant 1
|
||||
43: TypePointer UniformConstant 7(float)
|
||||
46: TypePointer Output 17(fvec4)
|
||||
47(gl_FragColor): 46(ptr) Variable Output
|
||||
49: TypeImage 7(float) 2D sampled format:Unknown
|
||||
50: TypeSampledImage 49
|
||||
51: TypePointer UniformConstant 50
|
||||
52(sampler): 51(ptr) Variable UniformConstant
|
||||
54: TypeVector 7(float) 2
|
||||
55: TypePointer Input 54(fvec2)
|
||||
56(coord): 55(ptr) Variable Input
|
||||
60: TypePointer UniformConstant 19(lunarStruct1)
|
||||
61(foo): 60(ptr) Variable UniformConstant
|
||||
6: TypeFloat 32
|
||||
7: TypePointer Function 6(float)
|
||||
9: 6(float) Constant 0
|
||||
10: TypeInt 32 1
|
||||
11: TypeInt 32 0
|
||||
12: 11(int) Constant 5
|
||||
13: TypeArray 10(int) 12
|
||||
14: 11(int) Constant 4
|
||||
15: TypeArray 6(float) 14
|
||||
16: TypeVector 6(float) 4
|
||||
17: TypeArray 16(fvec4) 12
|
||||
18(lunarStruct1): TypeStruct 10(int) 15 17
|
||||
19: 11(int) Constant 7
|
||||
20: TypeArray 18(lunarStruct1) 19
|
||||
21(lunarStruct2): TypeStruct 13 6(float) 20
|
||||
22: TypeArray 21(lunarStruct2) 12
|
||||
23: TypePointer UniformConstant 22
|
||||
24(foo2): 23(ptr) Variable UniformConstant
|
||||
25: 10(int) Constant 3
|
||||
26: 10(int) Constant 0
|
||||
27: 10(int) Constant 4
|
||||
28: TypePointer UniformConstant 10(int)
|
||||
31: TypeBool
|
||||
35: 10(int) Constant 2
|
||||
36: TypePointer UniformConstant 16(fvec4)
|
||||
41: 10(int) Constant 1
|
||||
42: TypePointer UniformConstant 6(float)
|
||||
45: TypePointer Output 16(fvec4)
|
||||
46(gl_FragColor): 45(ptr) Variable Output
|
||||
48: TypeImage 6(float) 2D sampled format:Unknown
|
||||
49: TypeSampledImage 48
|
||||
50: TypePointer UniformConstant 49
|
||||
51(sampler): 50(ptr) Variable UniformConstant
|
||||
53: TypeVector 6(float) 2
|
||||
54: TypePointer Input 53(fvec2)
|
||||
55(coord): 54(ptr) Variable Input
|
||||
59: TypePointer UniformConstant 18(lunarStruct1)
|
||||
60(foo): 59(ptr) Variable UniformConstant
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
9(scale): 8(ptr) Variable Function
|
||||
Store 9(scale) 10
|
||||
30: 29(ptr) AccessChain 25(foo2) 26 27 28
|
||||
31: 11(int) Load 30
|
||||
33: 32(bool) SGreaterThan 31 27
|
||||
SelectionMerge 35 None
|
||||
BranchConditional 33 34 41
|
||||
34: Label
|
||||
38: 37(ptr) AccessChain 25(foo2) 26 36 36 36 26
|
||||
39: 17(fvec4) Load 38
|
||||
40: 7(float) CompositeExtract 39 0
|
||||
Store 9(scale) 40
|
||||
Branch 35
|
||||
41: Label
|
||||
44: 43(ptr) AccessChain 25(foo2) 26 36 36 42 26
|
||||
45: 7(float) Load 44
|
||||
Store 9(scale) 45
|
||||
Branch 35
|
||||
35: Label
|
||||
48: 7(float) Load 9(scale)
|
||||
53: 50 Load 52(sampler)
|
||||
57: 54(fvec2) Load 56(coord)
|
||||
58: 17(fvec4) ImageSampleImplicitLod 53 57
|
||||
59: 17(fvec4) VectorTimesScalar 58 48
|
||||
Store 47(gl_FragColor) 59
|
||||
Branch 6
|
||||
6: Label
|
||||
8(scale): 7(ptr) Variable Function
|
||||
Store 8(scale) 9
|
||||
29: 28(ptr) AccessChain 24(foo2) 25 26 27
|
||||
30: 10(int) Load 29
|
||||
32: 31(bool) SGreaterThan 30 26
|
||||
SelectionMerge 34 None
|
||||
BranchConditional 32 33 40
|
||||
33: Label
|
||||
37: 36(ptr) AccessChain 24(foo2) 25 35 35 35 25
|
||||
38: 16(fvec4) Load 37
|
||||
39: 6(float) CompositeExtract 38 0
|
||||
Store 8(scale) 39
|
||||
Branch 34
|
||||
40: Label
|
||||
43: 42(ptr) AccessChain 24(foo2) 25 35 35 41 25
|
||||
44: 6(float) Load 43
|
||||
Store 8(scale) 44
|
||||
Branch 34
|
||||
34: Label
|
||||
47: 6(float) Load 8(scale)
|
||||
52: 49 Load 51(sampler)
|
||||
56: 53(fvec2) Load 55(coord)
|
||||
57: 16(fvec4) ImageSampleImplicitLod 52 56
|
||||
58: 16(fvec4) VectorTimesScalar 57 47
|
||||
Store 46(gl_FragColor) 58
|
||||
Return
|
||||
FunctionEnd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue