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 compute stage:
|
|||
|
||||
// Module Version 99
|
||||
// Generated by (magic number): 51a00bb
|
||||
// Id's are bound by 63
|
||||
// Id's are bound by 62
|
||||
|
||||
Source GLSL 430
|
||||
Capability Shader
|
||||
|
|
@ -15,95 +15,93 @@ Linked compute stage:
|
|||
MemoryModel Logical GLSL450
|
||||
EntryPoint GLCompute 4 "main"
|
||||
Name 4 "main"
|
||||
Name 9 "bufName"
|
||||
MemberName 9(bufName) 0 "f"
|
||||
MemberName 9(bufName) 1 "d"
|
||||
Name 11 "bufInst"
|
||||
Name 23 "storePos"
|
||||
Name 27 "gl_GlobalInvocationID"
|
||||
Name 33 "localCoef"
|
||||
Name 34 "gl_LocalInvocationID"
|
||||
Name 50 "aa"
|
||||
Name 55 "globalCoef"
|
||||
Name 59 "roll"
|
||||
Name 62 "destTex"
|
||||
Decorate 9(bufName) GLSLShared
|
||||
Decorate 9(bufName) BufferBlock
|
||||
Decorate 27(gl_GlobalInvocationID) BuiltIn GlobalInvocationId
|
||||
Decorate 34(gl_LocalInvocationID) BuiltIn LocalInvocationId
|
||||
Decorate 14 NoStaticUse
|
||||
Decorate 57 NoStaticUse
|
||||
Decorate 14 NoStaticUse
|
||||
Decorate 14 NoStaticUse
|
||||
Decorate 59(roll) NoStaticUse
|
||||
Decorate 62(destTex) NoStaticUse
|
||||
Name 8 "bufName"
|
||||
MemberName 8(bufName) 0 "f"
|
||||
MemberName 8(bufName) 1 "d"
|
||||
Name 10 "bufInst"
|
||||
Name 22 "storePos"
|
||||
Name 26 "gl_GlobalInvocationID"
|
||||
Name 32 "localCoef"
|
||||
Name 33 "gl_LocalInvocationID"
|
||||
Name 49 "aa"
|
||||
Name 54 "globalCoef"
|
||||
Name 58 "roll"
|
||||
Name 61 "destTex"
|
||||
Decorate 8(bufName) GLSLShared
|
||||
Decorate 8(bufName) BufferBlock
|
||||
Decorate 26(gl_GlobalInvocationID) BuiltIn GlobalInvocationId
|
||||
Decorate 33(gl_LocalInvocationID) BuiltIn LocalInvocationId
|
||||
Decorate 13 NoStaticUse
|
||||
Decorate 56 NoStaticUse
|
||||
Decorate 13 NoStaticUse
|
||||
Decorate 13 NoStaticUse
|
||||
Decorate 58(roll) NoStaticUse
|
||||
Decorate 61(destTex) NoStaticUse
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
7: TypeFloat 32
|
||||
8: TypeFloat 64
|
||||
9(bufName): TypeStruct 7(float) 8(float)
|
||||
10: TypePointer Uniform 9(bufName)
|
||||
11(bufInst): 10(ptr) Variable Uniform
|
||||
12: TypeInt 32 1
|
||||
13: 12(int) Constant 1
|
||||
14: 8(float) Constant 1413754136 1074340347
|
||||
15: TypePointer Uniform 8(float)
|
||||
17: 12(int) Constant 0
|
||||
18: 7(float) Constant 1095307129
|
||||
19: TypePointer Uniform 7(float)
|
||||
21: TypeVector 12(int) 2
|
||||
22: TypePointer Function 21(ivec2)
|
||||
24: TypeInt 32 0
|
||||
25: TypeVector 24(int) 3
|
||||
26: TypePointer Input 25(ivec3)
|
||||
27(gl_GlobalInvocationID): 26(ptr) Variable Input
|
||||
28: TypeVector 24(int) 2
|
||||
32: TypePointer Function 8(float)
|
||||
34(gl_LocalInvocationID): 26(ptr) Variable Input
|
||||
38: 12(int) Constant 8
|
||||
41: TypeVector 7(float) 2
|
||||
43: 7(float) Constant 1090519040
|
||||
48: TypeVector 8(float) 4
|
||||
49: TypePointer Function 48(fvec4)
|
||||
51: 8(float) Constant 2576980378 1071225241
|
||||
52: 8(float) Constant 2576980378 1070176665
|
||||
53: 8(float) Constant 858993459 1070805811
|
||||
54: 48(fvec4) ConstantComposite 51 52 53 51
|
||||
56: 8(float) Constant 0 1072693248
|
||||
57: 8(float) Constant 3229815407 1074340298
|
||||
58: TypePointer UniformConstant 8(float)
|
||||
59(roll): 58(ptr) Variable UniformConstant
|
||||
60: TypeImage 7(float) 2D nonsampled format:Unknown
|
||||
61: TypePointer UniformConstant 60
|
||||
62(destTex): 61(ptr) Variable UniformConstant
|
||||
6: TypeFloat 32
|
||||
7: TypeFloat 64
|
||||
8(bufName): TypeStruct 6(float) 7(float)
|
||||
9: TypePointer Uniform 8(bufName)
|
||||
10(bufInst): 9(ptr) Variable Uniform
|
||||
11: TypeInt 32 1
|
||||
12: 11(int) Constant 1
|
||||
13: 7(float) Constant 1413754136 1074340347
|
||||
14: TypePointer Uniform 7(float)
|
||||
16: 11(int) Constant 0
|
||||
17: 6(float) Constant 1095307129
|
||||
18: TypePointer Uniform 6(float)
|
||||
20: TypeVector 11(int) 2
|
||||
21: TypePointer Function 20(ivec2)
|
||||
23: TypeInt 32 0
|
||||
24: TypeVector 23(int) 3
|
||||
25: TypePointer Input 24(ivec3)
|
||||
26(gl_GlobalInvocationID): 25(ptr) Variable Input
|
||||
27: TypeVector 23(int) 2
|
||||
31: TypePointer Function 7(float)
|
||||
33(gl_LocalInvocationID): 25(ptr) Variable Input
|
||||
37: 11(int) Constant 8
|
||||
40: TypeVector 6(float) 2
|
||||
42: 6(float) Constant 1090519040
|
||||
47: TypeVector 7(float) 4
|
||||
48: TypePointer Function 47(fvec4)
|
||||
50: 7(float) Constant 2576980378 1071225241
|
||||
51: 7(float) Constant 2576980378 1070176665
|
||||
52: 7(float) Constant 858993459 1070805811
|
||||
53: 47(fvec4) ConstantComposite 50 51 52 50
|
||||
55: 7(float) Constant 0 1072693248
|
||||
56: 7(float) Constant 3229815407 1074340298
|
||||
57: TypePointer UniformConstant 7(float)
|
||||
58(roll): 57(ptr) Variable UniformConstant
|
||||
59: TypeImage 6(float) 2D nonsampled format:Unknown
|
||||
60: TypePointer UniformConstant 59
|
||||
61(destTex): 60(ptr) Variable UniformConstant
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
23(storePos): 22(ptr) Variable Function
|
||||
33(localCoef): 32(ptr) Variable Function
|
||||
50(aa): 49(ptr) Variable Function
|
||||
55(globalCoef): 32(ptr) Variable Function
|
||||
16: 15(ptr) AccessChain 11(bufInst) 13
|
||||
Store 16 14
|
||||
20: 19(ptr) AccessChain 11(bufInst) 17
|
||||
Store 20 18
|
||||
29: 25(ivec3) Load 27(gl_GlobalInvocationID)
|
||||
30: 28(ivec2) VectorShuffle 29 29 0 1
|
||||
31: 21(ivec2) Bitcast 30
|
||||
Store 23(storePos) 31
|
||||
35: 25(ivec3) Load 34(gl_LocalInvocationID)
|
||||
36: 28(ivec2) VectorShuffle 35 35 0 1
|
||||
37: 21(ivec2) Bitcast 36
|
||||
39: 21(ivec2) CompositeConstruct 38 38
|
||||
40: 21(ivec2) ISub 37 39
|
||||
42: 41(fvec2) ConvertSToF 40
|
||||
44: 41(fvec2) CompositeConstruct 43 43
|
||||
45: 41(fvec2) FDiv 42 44
|
||||
46: 7(float) ExtInst 1(GLSL.std.450) 65(Length) 45
|
||||
47: 8(float) FConvert 46
|
||||
Store 33(localCoef) 47
|
||||
Store 50(aa) 54
|
||||
Store 55(globalCoef) 56
|
||||
Branch 6
|
||||
6: Label
|
||||
22(storePos): 21(ptr) Variable Function
|
||||
32(localCoef): 31(ptr) Variable Function
|
||||
49(aa): 48(ptr) Variable Function
|
||||
54(globalCoef): 31(ptr) Variable Function
|
||||
15: 14(ptr) AccessChain 10(bufInst) 12
|
||||
Store 15 13
|
||||
19: 18(ptr) AccessChain 10(bufInst) 16
|
||||
Store 19 17
|
||||
28: 24(ivec3) Load 26(gl_GlobalInvocationID)
|
||||
29: 27(ivec2) VectorShuffle 28 28 0 1
|
||||
30: 20(ivec2) Bitcast 29
|
||||
Store 22(storePos) 30
|
||||
34: 24(ivec3) Load 33(gl_LocalInvocationID)
|
||||
35: 27(ivec2) VectorShuffle 34 34 0 1
|
||||
36: 20(ivec2) Bitcast 35
|
||||
38: 20(ivec2) CompositeConstruct 37 37
|
||||
39: 20(ivec2) ISub 36 38
|
||||
41: 40(fvec2) ConvertSToF 39
|
||||
43: 40(fvec2) CompositeConstruct 42 42
|
||||
44: 40(fvec2) FDiv 41 43
|
||||
45: 6(float) ExtInst 1(GLSL.std.450) 65(Length) 44
|
||||
46: 7(float) FConvert 45
|
||||
Store 32(localCoef) 46
|
||||
Store 49(aa) 53
|
||||
Store 54(globalCoef) 55
|
||||
Return
|
||||
FunctionEnd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue