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:
@@ -7,7 +7,7 @@ Linked vertex stage:
|
||||
|
||||
// Module Version 99
|
||||
// Generated by (magic number): 51a00bb
|
||||
// Id's are bound by 28
|
||||
// Id's are bound by 27
|
||||
|
||||
Source GLSL 130
|
||||
Capability Shader
|
||||
@@ -15,44 +15,42 @@ Linked vertex stage:
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main"
|
||||
Name 4 "main"
|
||||
Name 10 "uv"
|
||||
Name 12 "uv_in"
|
||||
Name 16 "gl_Position"
|
||||
Name 19 "transform"
|
||||
Name 22 "position"
|
||||
Name 27 "gl_VertexID"
|
||||
Decorate 10(uv) Smooth
|
||||
Decorate 16(gl_Position) BuiltIn Position
|
||||
Decorate 27(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 27(gl_VertexID) NoStaticUse
|
||||
Name 9 "uv"
|
||||
Name 11 "uv_in"
|
||||
Name 15 "gl_Position"
|
||||
Name 18 "transform"
|
||||
Name 21 "position"
|
||||
Name 26 "gl_VertexID"
|
||||
Decorate 9(uv) Smooth
|
||||
Decorate 15(gl_Position) BuiltIn Position
|
||||
Decorate 26(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 26(gl_VertexID) NoStaticUse
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
7: TypeFloat 32
|
||||
8: TypeVector 7(float) 2
|
||||
9: TypePointer Output 8(fvec2)
|
||||
10(uv): 9(ptr) Variable Output
|
||||
11: TypePointer Input 8(fvec2)
|
||||
12(uv_in): 11(ptr) Variable Input
|
||||
14: TypeVector 7(float) 4
|
||||
15: TypePointer Output 14(fvec4)
|
||||
16(gl_Position): 15(ptr) Variable Output
|
||||
17: TypeMatrix 14(fvec4) 4
|
||||
18: TypePointer UniformConstant 17
|
||||
19(transform): 18(ptr) Variable UniformConstant
|
||||
21: TypePointer Input 14(fvec4)
|
||||
22(position): 21(ptr) Variable Input
|
||||
25: TypeInt 32 1
|
||||
26: TypePointer Input 25(int)
|
||||
27(gl_VertexID): 26(ptr) Variable Input
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 2
|
||||
8: TypePointer Output 7(fvec2)
|
||||
9(uv): 8(ptr) Variable Output
|
||||
10: TypePointer Input 7(fvec2)
|
||||
11(uv_in): 10(ptr) Variable Input
|
||||
13: TypeVector 6(float) 4
|
||||
14: TypePointer Output 13(fvec4)
|
||||
15(gl_Position): 14(ptr) Variable Output
|
||||
16: TypeMatrix 13(fvec4) 4
|
||||
17: TypePointer UniformConstant 16
|
||||
18(transform): 17(ptr) Variable UniformConstant
|
||||
20: TypePointer Input 13(fvec4)
|
||||
21(position): 20(ptr) Variable Input
|
||||
24: TypeInt 32 1
|
||||
25: TypePointer Input 24(int)
|
||||
26(gl_VertexID): 25(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
13: 8(fvec2) Load 12(uv_in)
|
||||
Store 10(uv) 13
|
||||
20: 17 Load 19(transform)
|
||||
23: 14(fvec4) Load 22(position)
|
||||
24: 14(fvec4) MatrixTimesVector 20 23
|
||||
Store 16(gl_Position) 24
|
||||
Branch 6
|
||||
6: Label
|
||||
12: 7(fvec2) Load 11(uv_in)
|
||||
Store 9(uv) 12
|
||||
19: 16 Load 18(transform)
|
||||
22: 13(fvec4) Load 21(position)
|
||||
23: 13(fvec4) MatrixTimesVector 19 22
|
||||
Store 15(gl_Position) 23
|
||||
Return
|
||||
FunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user