Commit c8fbbab4 by Dejan Mircevski

Update .out files with new loop SPIR-V.

Also update breakForLoop and call builder.closeLoop() in code generation. Remove dead code. Change-Id: Ic8ce5b208530f8787989ef45a2efa405f1b45310
parent 7819bee8
...@@ -142,7 +142,6 @@ protected: ...@@ -142,7 +142,6 @@ protected:
std::unordered_map<const glslang::TTypeList*, spv::Id> structMap; std::unordered_map<const glslang::TTypeList*, spv::Id> structMap;
std::unordered_map<const glslang::TTypeList*, std::vector<int> > memberRemapper; // for mapping glslang block indices to spv indices (e.g., due to hidden members) std::unordered_map<const glslang::TTypeList*, std::vector<int> > memberRemapper; // for mapping glslang block indices to spv indices (e.g., due to hidden members)
std::stack<bool> breakForLoop; // false means break for switch std::stack<bool> breakForLoop; // false means break for switch
std::stack<glslang::TIntermTyped*> loopTerminal; // code from the last part of a for loop: for(...; ...; terminal), needed for e.g., continue };
}; };
// //
...@@ -1354,10 +1353,12 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn ...@@ -1354,10 +1353,12 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn
builder.createLoopMerge(&blocks.merge, &blocks.continue_target, spv::LoopControlMaskNone); builder.createLoopMerge(&blocks.merge, &blocks.continue_target, spv::LoopControlMaskNone);
builder.createConditionalBranch(condition, &blocks.body, &blocks.merge); builder.createConditionalBranch(condition, &blocks.body, &blocks.merge);
breakForLoop.push(true);
builder.setBuildPoint(&blocks.body); builder.setBuildPoint(&blocks.body);
if (node->getBody()) if (node->getBody())
node->getBody()->traverse(this); node->getBody()->traverse(this);
builder.createBranch(&blocks.continue_target); builder.createBranch(&blocks.continue_target);
breakForLoop.pop();
builder.setBuildPoint(&blocks.continue_target); builder.setBuildPoint(&blocks.continue_target);
if (node->getTerminal()) if (node->getTerminal())
...@@ -1366,10 +1367,12 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn ...@@ -1366,10 +1367,12 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn
} else { } else {
builder.createBranch(&blocks.body); builder.createBranch(&blocks.body);
breakForLoop.push(true);
builder.setBuildPoint(&blocks.body); builder.setBuildPoint(&blocks.body);
if (node->getBody()) if (node->getBody())
node->getBody()->traverse(this); node->getBody()->traverse(this);
builder.createBranch(&blocks.continue_target); builder.createBranch(&blocks.continue_target);
breakForLoop.pop();
builder.setBuildPoint(&blocks.continue_target); builder.setBuildPoint(&blocks.continue_target);
if (node->getTerminal()) if (node->getTerminal())
...@@ -1387,6 +1390,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn ...@@ -1387,6 +1390,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn
} }
builder.setBuildPoint(&blocks.merge); builder.setBuildPoint(&blocks.merge);
builder.closeLoop();
return false; return false;
} }
...@@ -1406,8 +1410,6 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T ...@@ -1406,8 +1410,6 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T
builder.addSwitchBreak(); builder.addSwitchBreak();
break; break;
case glslang::EOpContinue: case glslang::EOpContinue:
if (loopTerminal.top())
loopTerminal.top()->traverse(this);
builder.createLoopContinue(); builder.createLoopContinue();
break; break;
case glslang::EOpReturn: case glslang::EOpReturn:
......
spv.dataOutIndirect.vert spv.dataOutIndirect.vert
WARNING: 0:3: attribute deprecated in version 130; may be removed in future release WARNING: 0:3: attribute deprecated in version 130; may be removed in future release
WARNING: 0:4: varying deprecated in version 130; may be removed in future release WARNING: 0:4: varying deprecated in version 130; may be removed in future release
Linked vertex stage: Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 38 // Id's are bound by 39
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 26 23 37 EntryPoint Vertex 4 "main" 27 24 38
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 23 "colorOut" Name 24 "colorOut"
Name 26 "color" Name 27 "color"
Name 32 "gl_Position" Name 33 "gl_Position"
Name 37 "gl_VertexID" Name 38 "gl_VertexID"
Decorate 32(gl_Position) BuiltIn Position Decorate 33(gl_Position) BuiltIn Position
Decorate 37(gl_VertexID) BuiltIn VertexId Decorate 38(gl_VertexID) BuiltIn VertexId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 1 9: 6(int) Constant 1
14: 6(int) Constant 5 15: 6(int) Constant 5
15: TypeBool 16: TypeBool
17: TypeFloat 32 18: TypeFloat 32
18: TypeVector 17(float) 4 19: TypeVector 18(float) 4
19: TypeInt 32 0 20: TypeInt 32 0
20: 19(int) Constant 6 21: 20(int) Constant 6
21: TypeArray 18(fvec4) 20 22: TypeArray 19(fvec4) 21
22: TypePointer Output 21 23: TypePointer Output 22
23(colorOut): 22(ptr) Variable Output 24(colorOut): 23(ptr) Variable Output
25: TypePointer Input 18(fvec4) 26: TypePointer Input 19(fvec4)
26(color): 25(ptr) Variable Input 27(color): 26(ptr) Variable Input
28: TypePointer Output 18(fvec4) 29: TypePointer Output 19(fvec4)
32(gl_Position): 28(ptr) Variable Output 33(gl_Position): 29(ptr) Variable Output
33: 6(int) Constant 2 34: 6(int) Constant 2
36: TypePointer Input 6(int) 37: TypePointer Input 6(int)
37(gl_VertexID): 36(ptr) Variable Input 38(gl_VertexID): 37(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 13
10: Label 10: Label
13: 6(int) Load 8(i) 25: 6(int) Load 8(i)
16: 15(bool) SLessThan 13 14 28: 19(fvec4) Load 27(color)
LoopMerge 11 10 None 30: 29(ptr) AccessChain 24(colorOut) 25
BranchConditional 16 12 11 Store 30 28
12: Label Branch 12
24: 6(int) Load 8(i) 11: Label
27: 18(fvec4) Load 26(color) 35: 29(ptr) AccessChain 24(colorOut) 34
29: 28(ptr) AccessChain 23(colorOut) 24 36: 19(fvec4) Load 35
Store 29 27 Store 33(gl_Position) 36
30: 6(int) Load 8(i) Return
31: 6(int) IAdd 30 9 12: Label
Store 8(i) 31 31: 6(int) Load 8(i)
Branch 10 32: 6(int) IAdd 31 9
11: Label Store 8(i) 32
34: 28(ptr) AccessChain 23(colorOut) 33 Branch 13
35: 18(fvec4) Load 34 13: Label
Store 32(gl_Position) 35 14: 6(int) Load 8(i)
Return 17: 16(bool) SLessThan 14 15
FunctionEnd LoopMerge 11 12 None
BranchConditional 17 10 11
FunctionEnd
...@@ -5,56 +5,45 @@ Linked vertex stage: ...@@ -5,56 +5,45 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 29 // Id's are bound by 23
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 27 28 EntryPoint Vertex 4 "main" 21 22
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 27 "gl_VertexID" Name 21 "gl_VertexID"
Name 28 "gl_InstanceID" Name 22 "gl_InstanceID"
Decorate 27(gl_VertexID) BuiltIn VertexId Decorate 21(gl_VertexID) BuiltIn VertexId
Decorate 28(gl_InstanceID) BuiltIn InstanceId Decorate 22(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: TypeBool 14: 6(int) Constant 1
15: 14(bool) ConstantTrue 17: 6(int) Constant 10
19: 6(int) Constant 10 18: TypeBool
23: 6(int) Constant 1 20: TypePointer Input 6(int)
25: 14(bool) ConstantFalse 21(gl_VertexID): 20(ptr) Variable Input
26: TypePointer Input 6(int) 22(gl_InstanceID): 20(ptr) Variable Input
27(gl_VertexID): 26(ptr) Variable Input
28(gl_InstanceID): 26(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
13: 14(bool) Phi 15 5 25 12 13: 6(int) Load 8(i)
LoopMerge 11 10 None 15: 6(int) IAdd 13 14
Branch 16 Store 8(i) 15
16: Label Branch 12
SelectionMerge 12 None
BranchConditional 13 12 17
17: Label
18: 6(int) Load 8(i)
20: 14(bool) SLessThan 18 19
SelectionMerge 21 None
BranchConditional 20 21 11
21: Label
Branch 12
12: Label
22: 6(int) Load 8(i)
24: 6(int) IAdd 22 23
Store 8(i) 24
Branch 10
11: Label 11: Label
Return Return
FunctionEnd 12: Label
16: 6(int) Load 8(i)
19: 18(bool) SLessThan 16 17
LoopMerge 11 12 None
BranchConditional 19 10 11
FunctionEnd
spv.do-while-continue-break.vert spv.do-while-continue-break.vert
Linked vertex stage: Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 51 // Id's are bound by 45
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 49 50 EntryPoint Vertex 4 "main" 43 44
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 24 "A" Name 13 "A"
Name 30 "B" Name 20 "B"
Name 33 "C" Name 23 "C"
Name 39 "D" Name 29 "D"
Name 42 "E" Name 32 "E"
Name 44 "F" Name 34 "F"
Name 46 "G" Name 40 "G"
Name 49 "gl_VertexID" Name 43 "gl_VertexID"
Name 50 "gl_InstanceID" Name 44 "gl_InstanceID"
Decorate 49(gl_VertexID) BuiltIn VertexId Decorate 43(gl_VertexID) BuiltIn VertexId
Decorate 50(gl_InstanceID) BuiltIn InstanceId Decorate 44(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: TypeBool 15: 6(int) Constant 2
15: 14(bool) ConstantTrue 16: TypeBool
19: 6(int) Constant 1 21: 6(int) Constant 1
21: 6(int) Constant 19 25: 6(int) Constant 5
26: 6(int) Constant 2 30: 6(int) Constant 3
31: 14(bool) ConstantFalse 33: 6(int) Constant 42
35: 6(int) Constant 5 35: 6(int) Constant 99
40: 6(int) Constant 3 38: 6(int) Constant 19
43: 6(int) Constant 42 41: 6(int) Constant 12
45: 6(int) Constant 99 42: TypePointer Input 6(int)
47: 6(int) Constant 12 43(gl_VertexID): 42(ptr) Variable Input
48: TypePointer Input 6(int) 44(gl_InstanceID): 42(ptr) Variable Input
49(gl_VertexID): 48(ptr) Variable Input 4(main): 2 Function None 3
50(gl_InstanceID): 48(ptr) Variable Input 5: Label
4(main): 2 Function None 3 8(i): 7(ptr) Variable Function
5: Label 13(A): 7(ptr) Variable Function
8(i): 7(ptr) Variable Function 20(B): 7(ptr) Variable Function
24(A): 7(ptr) Variable Function 23(C): 7(ptr) Variable Function
30(B): 7(ptr) Variable Function 29(D): 7(ptr) Variable Function
33(C): 7(ptr) Variable Function 32(E): 7(ptr) Variable Function
39(D): 7(ptr) Variable Function 34(F): 7(ptr) Variable Function
42(E): 7(ptr) Variable Function 40(G): 7(ptr) Variable Function
44(F): 7(ptr) Variable Function Store 8(i) 9
46(G): 7(ptr) Variable Function Branch 10
Store 8(i) 9 10: Label
Branch 10 Store 13(A) 9
10: Label 14: 6(int) Load 8(i)
13: 14(bool) Phi 15 5 31 28 31 38 17: 16(bool) IEqual 14 15
LoopMerge 11 10 None SelectionMerge 19 None
Branch 16 BranchConditional 17 18 19
16: Label 11: Label
SelectionMerge 12 None Store 40(G) 41
BranchConditional 13 12 17 Return
17: Label 12: Label
18: 6(int) Load 8(i) 36: 6(int) Load 8(i)
20: 6(int) IAdd 18 19 37: 6(int) IAdd 36 21
Store 8(i) 20 Store 8(i) 37
22: 14(bool) SLessThan 20 21 39: 16(bool) SLessThan 37 38
SelectionMerge 23 None LoopMerge 11 12 None
BranchConditional 22 23 11 BranchConditional 39 10 11
23: Label 18: Label
Branch 12 Store 20(B) 21
12: Label Branch 12
Store 24(A) 9 22: Label
25: 6(int) Load 8(i) Store 23(C) 15
27: 14(bool) IEqual 25 26 Branch 19
SelectionMerge 29 None 19: Label
BranchConditional 27 28 29 24: 6(int) Load 8(i)
28: Label 26: 16(bool) IEqual 24 25
Store 30(B) 19 SelectionMerge 28 None
Branch 10 BranchConditional 26 27 28
32: Label 27: Label
Store 33(C) 26 Store 29(D) 30
Branch 29 Branch 11
29: Label 31: Label
34: 6(int) Load 8(i) Store 32(E) 33
36: 14(bool) IEqual 34 35 Branch 28
SelectionMerge 38 None 28: Label
BranchConditional 36 37 38 Store 34(F) 35
37: Label Branch 12
Store 39(D) 40 FunctionEnd
Branch 11
41: Label
Store 42(E) 43
Branch 38
38: Label
Store 44(F) 45
Branch 10
11: Label
Store 46(G) 47
Return
FunctionEnd
spv.doWhileLoop.frag spv.doWhileLoop.frag
Linked fragment stage: Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 40 // Id's are bound by 34
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 EntryPoint Fragment 4 "main" 11
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 110 Source GLSL 110
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 27 "d" Name 17 "bigColor"
Name 32 "bigColor" Name 27 "d"
Name 38 "gl_FragColor" Name 32 "gl_FragColor"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
7: TypeVector 6(float) 4 7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4) 8: TypePointer Function 7(fvec4)
10: TypePointer Input 7(fvec4) 10: TypePointer Input 7(fvec4)
11(BaseColor): 10(ptr) Variable Input 11(BaseColor): 10(ptr) Variable Input
17: TypeBool 16: TypePointer UniformConstant 7(fvec4)
18: 17(bool) ConstantTrue 17(bigColor): 16(ptr) Variable UniformConstant
21: TypeInt 32 0 21: TypeInt 32 0
22: 21(int) Constant 0 22: 21(int) Constant 0
23: TypePointer Function 6(float) 23: TypePointer Function 6(float)
26: TypePointer UniformConstant 6(float) 26: TypePointer UniformConstant 6(float)
27(d): 26(ptr) Variable UniformConstant 27(d): 26(ptr) Variable UniformConstant
31: TypePointer UniformConstant 7(fvec4) 29: TypeBool
32(bigColor): 31(ptr) Variable UniformConstant 31: TypePointer Output 7(fvec4)
36: 17(bool) ConstantFalse 32(gl_FragColor): 31(ptr) Variable Output
37: TypePointer Output 7(fvec4) 4(main): 2 Function None 3
38(gl_FragColor): 37(ptr) Variable Output 5: Label
4(main): 2 Function None 3 9(color): 8(ptr) Variable Function
5: Label 12: 7(fvec4) Load 11(BaseColor)
9(color): 8(ptr) Variable Function Store 9(color) 12
12: 7(fvec4) Load 11(BaseColor) Branch 13
Store 9(color) 12 13: Label
Branch 13 18: 7(fvec4) Load 17(bigColor)
13: Label 19: 7(fvec4) Load 9(color)
16: 17(bool) Phi 18 5 36 15 20: 7(fvec4) FAdd 19 18
LoopMerge 14 13 None Store 9(color) 20
Branch 19 Branch 15
19: Label 14: Label
SelectionMerge 15 None 33: 7(fvec4) Load 9(color)
BranchConditional 16 15 20 Store 32(gl_FragColor) 33
20: Label Return
24: 23(ptr) AccessChain 9(color) 22 15: Label
25: 6(float) Load 24 24: 23(ptr) AccessChain 9(color) 22
28: 6(float) Load 27(d) 25: 6(float) Load 24
29: 17(bool) FOrdLessThan 25 28 28: 6(float) Load 27(d)
SelectionMerge 30 None 30: 29(bool) FOrdLessThan 25 28
BranchConditional 29 30 14 LoopMerge 14 15 None
30: Label BranchConditional 30 13 14
Branch 15 FunctionEnd
15: Label
33: 7(fvec4) Load 32(bigColor)
34: 7(fvec4) Load 9(color)
35: 7(fvec4) FAdd 34 33
Store 9(color) 35
Branch 13
14: Label
39: 7(fvec4) Load 9(color)
Store 38(gl_FragColor) 39
Return
FunctionEnd
spv.for-continue-break.vert spv.for-continue-break.vert
Linked vertex stage: Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 48 // Id's are bound by 47
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 46 47 EntryPoint Vertex 4 "main" 45 46
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 17 "A" Name 18 "A"
Name 25 "B" Name 26 "B"
Name 29 "C" Name 28 "C"
Name 36 "D" Name 35 "D"
Name 38 "E" Name 37 "E"
Name 39 "F" Name 38 "F"
Name 43 "G" Name 42 "G"
Name 46 "gl_VertexID" Name 45 "gl_VertexID"
Name 47 "gl_InstanceID" Name 46 "gl_InstanceID"
Decorate 46(gl_VertexID) BuiltIn VertexId Decorate 45(gl_VertexID) BuiltIn VertexId
Decorate 47(gl_InstanceID) BuiltIn InstanceId Decorate 46(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: 6(int) Constant 10 15: 6(int) Constant 10
15: TypeBool 16: TypeBool
18: 6(int) Constant 1 19: 6(int) Constant 1
20: 6(int) Constant 2 21: 6(int) Constant 2
31: 6(int) Constant 3 30: 6(int) Constant 3
40: 6(int) Constant 12 39: 6(int) Constant 12
44: 6(int) Constant 99 43: 6(int) Constant 99
45: TypePointer Input 6(int) 44: TypePointer Input 6(int)
46(gl_VertexID): 45(ptr) Variable Input 45(gl_VertexID): 44(ptr) Variable Input
47(gl_InstanceID): 45(ptr) Variable Input 46(gl_InstanceID): 44(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
17(A): 7(ptr) Variable Function 18(A): 7(ptr) Variable Function
25(B): 7(ptr) Variable Function 26(B): 7(ptr) Variable Function
29(C): 7(ptr) Variable Function 28(C): 7(ptr) Variable Function
36(D): 7(ptr) Variable Function 35(D): 7(ptr) Variable Function
38(E): 7(ptr) Variable Function 37(E): 7(ptr) Variable Function
39(F): 7(ptr) Variable Function 38(F): 7(ptr) Variable Function
43(G): 7(ptr) Variable Function 42(G): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 13
10: Label 10: Label
13: 6(int) Load 8(i) Store 18(A) 19
16: 15(bool) SLessThan 13 14 20: 6(int) Load 8(i)
LoopMerge 11 10 None 22: 6(int) SMod 20 21
BranchConditional 16 12 11 23: 16(bool) IEqual 22 9
12: Label SelectionMerge 25 None
Store 17(A) 18 BranchConditional 23 24 25
19: 6(int) Load 8(i) 11: Label
21: 6(int) SMod 19 20 Store 42(G) 43
22: 15(bool) IEqual 21 9 Return
SelectionMerge 24 None 12: Label
BranchConditional 22 23 24 40: 6(int) Load 8(i)
23: Label 41: 6(int) IAdd 40 19
Store 25(B) 18 Store 8(i) 41
26: 6(int) Load 8(i) Branch 13
27: 6(int) IAdd 26 18 13: Label
Store 8(i) 27 14: 6(int) Load 8(i)
Branch 10 17: 16(bool) SLessThan 14 15
28: Label LoopMerge 11 12 None
Store 29(C) 18 BranchConditional 17 10 11
Branch 24 24: Label
24: Label Store 26(B) 19
30: 6(int) Load 8(i) Branch 12
32: 6(int) SMod 30 31 27: Label
33: 15(bool) IEqual 32 9 Store 28(C) 19
SelectionMerge 35 None Branch 25
BranchConditional 33 34 35 25: Label
34: Label 29: 6(int) Load 8(i)
Store 36(D) 18 31: 6(int) SMod 29 30
Branch 11 32: 16(bool) IEqual 31 9
37: Label SelectionMerge 34 None
Store 38(E) 18 BranchConditional 32 33 34
Branch 35 33: Label
35: Label Store 35(D) 19
Store 39(F) 40 Branch 11
41: 6(int) Load 8(i) 36: Label
42: 6(int) IAdd 41 18 Store 37(E) 19
Store 8(i) 42 Branch 34
Branch 10 34: Label
11: Label Store 38(F) 39
Store 43(G) 44 Branch 12
Return FunctionEnd
FunctionEnd
This source diff could not be displayed because it is too large. You can view the blob instead.
spv.while-continue-break.vert spv.while-continue-break.vert
Linked vertex stage: Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 42 // Id's are bound by 43
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 40 41 EntryPoint Vertex 4 "main" 41 42
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 17 "A" Name 18 "A"
Name 25 "B" Name 26 "B"
Name 27 "C" Name 28 "C"
Name 37 "D" Name 38 "D"
Name 40 "gl_VertexID" Name 41 "gl_VertexID"
Name 41 "gl_InstanceID" Name 42 "gl_InstanceID"
Decorate 40(gl_VertexID) BuiltIn VertexId Decorate 41(gl_VertexID) BuiltIn VertexId
Decorate 41(gl_InstanceID) BuiltIn InstanceId Decorate 42(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: 6(int) Constant 10 15: 6(int) Constant 10
15: TypeBool 16: TypeBool
18: 6(int) Constant 1 19: 6(int) Constant 1
20: 6(int) Constant 2 21: 6(int) Constant 2
29: 6(int) Constant 5 30: 6(int) Constant 5
38: 6(int) Constant 3 39: 6(int) Constant 3
39: TypePointer Input 6(int) 40: TypePointer Input 6(int)
40(gl_VertexID): 39(ptr) Variable Input 41(gl_VertexID): 40(ptr) Variable Input
41(gl_InstanceID): 39(ptr) Variable Input 42(gl_InstanceID): 40(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
17(A): 7(ptr) Variable Function 18(A): 7(ptr) Variable Function
25(B): 7(ptr) Variable Function 26(B): 7(ptr) Variable Function
27(C): 7(ptr) Variable Function 28(C): 7(ptr) Variable Function
37(D): 7(ptr) Variable Function 38(D): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 13
10: Label 10: Label
13: 6(int) Load 8(i) Store 18(A) 19
16: 15(bool) SLessThan 13 14 20: 6(int) Load 8(i)
LoopMerge 11 10 None 22: 6(int) SMod 20 21
BranchConditional 16 12 11 23: 16(bool) IEqual 22 9
12: Label SelectionMerge 25 None
Store 17(A) 18 BranchConditional 23 24 25
19: 6(int) Load 8(i) 11: Label
21: 6(int) SMod 19 20 Store 38(D) 39
22: 15(bool) IEqual 21 9 Return
SelectionMerge 24 None 12: Label
BranchConditional 22 23 24 Branch 13
23: Label 13: Label
Store 25(B) 20 14: 6(int) Load 8(i)
Branch 10 17: 16(bool) SLessThan 14 15
26: Label LoopMerge 11 12 None
Store 27(C) 20 BranchConditional 17 10 11
Branch 24 24: Label
24: Label Store 26(B) 21
28: 6(int) Load 8(i) Branch 12
30: 6(int) SMod 28 29 27: Label
31: 15(bool) IEqual 30 9 Store 28(C) 21
SelectionMerge 33 None Branch 25
BranchConditional 31 32 33 25: Label
32: Label 29: 6(int) Load 8(i)
Store 25(B) 20 31: 6(int) SMod 29 30
Branch 11 32: 16(bool) IEqual 31 9
34: Label SelectionMerge 34 None
Store 27(C) 20 BranchConditional 32 33 34
Branch 33 33: Label
33: Label Store 26(B) 21
35: 6(int) Load 8(i) Branch 11
36: 6(int) IAdd 35 18 35: Label
Store 8(i) 36 Store 28(C) 21
Branch 10 Branch 34
11: Label 34: Label
Store 37(D) 38 36: 6(int) Load 8(i)
Return 37: 6(int) IAdd 36 19
FunctionEnd Store 8(i) 37
Branch 12
FunctionEnd
spv.while-simple.vert spv.while-simple.vert
Linked vertex stage: Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 23 // Id's are bound by 24
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 21 22 EntryPoint Vertex 4 "main" 22 23
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 21 "gl_VertexID" Name 22 "gl_VertexID"
Name 22 "gl_InstanceID" Name 23 "gl_InstanceID"
Decorate 21(gl_VertexID) BuiltIn VertexId Decorate 22(gl_VertexID) BuiltIn VertexId
Decorate 22(gl_InstanceID) BuiltIn InstanceId Decorate 23(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: 6(int) Constant 10 15: 6(int) Constant 10
15: TypeBool 16: TypeBool
18: 6(int) Constant 1 19: 6(int) Constant 1
20: TypePointer Input 6(int) 21: TypePointer Input 6(int)
21(gl_VertexID): 20(ptr) Variable Input 22(gl_VertexID): 21(ptr) Variable Input
22(gl_InstanceID): 20(ptr) Variable Input 23(gl_InstanceID): 21(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 13
10: Label 10: Label
13: 6(int) Load 8(i) 18: 6(int) Load 8(i)
16: 15(bool) SLessThan 13 14 20: 6(int) IAdd 18 19
LoopMerge 11 10 None Store 8(i) 20
BranchConditional 16 12 11 Branch 12
12: Label 11: Label
17: 6(int) Load 8(i) Return
19: 6(int) IAdd 17 18 12: Label
Store 8(i) 19 Branch 13
Branch 10 13: Label
11: Label 14: 6(int) Load 8(i)
Return 17: 16(bool) SLessThan 14 15
FunctionEnd LoopMerge 11 12 None
BranchConditional 17 10 11
FunctionEnd
spv.whileLoop.frag spv.whileLoop.frag
Linked fragment stage: Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 34 // Id's are bound by 35
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 EntryPoint Fragment 4 "main" 11
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 110 Source GLSL 110
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 22 "d" Name 23 "d"
Name 27 "bigColor" Name 28 "bigColor"
Name 32 "gl_FragColor" Name 33 "gl_FragColor"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
7: TypeVector 6(float) 4 7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4) 8: TypePointer Function 7(fvec4)
10: TypePointer Input 7(fvec4) 10: TypePointer Input 7(fvec4)
11(BaseColor): 10(ptr) Variable Input 11(BaseColor): 10(ptr) Variable Input
16: TypeInt 32 0 17: TypeInt 32 0
17: 16(int) Constant 0 18: 17(int) Constant 0
18: TypePointer Function 6(float) 19: TypePointer Function 6(float)
21: TypePointer UniformConstant 6(float) 22: TypePointer UniformConstant 6(float)
22(d): 21(ptr) Variable UniformConstant 23(d): 22(ptr) Variable UniformConstant
24: TypeBool 25: TypeBool
26: TypePointer UniformConstant 7(fvec4) 27: TypePointer UniformConstant 7(fvec4)
27(bigColor): 26(ptr) Variable UniformConstant 28(bigColor): 27(ptr) Variable UniformConstant
31: TypePointer Output 7(fvec4) 32: TypePointer Output 7(fvec4)
32(gl_FragColor): 31(ptr) Variable Output 33(gl_FragColor): 32(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(color): 8(ptr) Variable Function 9(color): 8(ptr) Variable Function
12: 7(fvec4) Load 11(BaseColor) 12: 7(fvec4) Load 11(BaseColor)
Store 9(color) 12 Store 9(color) 12
Branch 13 Branch 16
13: Label 13: Label
19: 18(ptr) AccessChain 9(color) 17 29: 7(fvec4) Load 28(bigColor)
20: 6(float) Load 19 30: 7(fvec4) Load 9(color)
23: 6(float) Load 22(d) 31: 7(fvec4) FAdd 30 29
25: 24(bool) FOrdLessThan 20 23 Store 9(color) 31
LoopMerge 14 13 None Branch 15
BranchConditional 25 15 14 14: Label
15: Label 34: 7(fvec4) Load 9(color)
28: 7(fvec4) Load 27(bigColor) Store 33(gl_FragColor) 34
29: 7(fvec4) Load 9(color) Return
30: 7(fvec4) FAdd 29 28 15: Label
Store 9(color) 30 Branch 16
Branch 13 16: Label
14: Label 20: 19(ptr) AccessChain 9(color) 18
33: 7(fvec4) Load 9(color) 21: 6(float) Load 20
Store 32(gl_FragColor) 33 24: 6(float) Load 23(d)
Return 26: 25(bool) FOrdLessThan 21 24
FunctionEnd LoopMerge 14 15 None
BranchConditional 26 13 14
FunctionEnd
...@@ -5,6 +5,8 @@ spv.do-simple.vert ...@@ -5,6 +5,8 @@ spv.do-simple.vert
spv.do-while-continue-break.vert spv.do-while-continue-break.vert
spv.for-continue-break.vert spv.for-continue-break.vert
spv.for-simple.vert spv.for-simple.vert
spv.for-notest.vert
spv.for-nobody.vert
spv.while-continue-break.vert spv.while-continue-break.vert
spv.while-simple.vert spv.while-simple.vert
# vulkan-specific tests # vulkan-specific tests
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment