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:
......
...@@ -8,64 +8,66 @@ Linked vertex stage: ...@@ -8,64 +8,66 @@ 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)
27: 18(fvec4) Load 26(color)
29: 28(ptr) AccessChain 23(colorOut) 24
Store 29 27
30: 6(int) Load 8(i)
31: 6(int) IAdd 30 9
Store 8(i) 31
Branch 10
11: Label 11: Label
34: 28(ptr) AccessChain 23(colorOut) 33 35: 29(ptr) AccessChain 24(colorOut) 34
35: 18(fvec4) Load 34 36: 19(fvec4) Load 35
Store 32(gl_Position) 35 Store 33(gl_Position) 36
Return Return
12: Label
31: 6(int) Load 8(i)
32: 6(int) IAdd 31 9
Store 8(i) 32
Branch 13
13: Label
14: 6(int) Load 8(i)
17: 16(bool) SLessThan 14 15
LoopMerge 11 12 None
BranchConditional 17 10 11
FunctionEnd 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
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 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
12: Label
16: 6(int) Load 8(i)
19: 18(bool) SLessThan 16 17
LoopMerge 11 12 None
BranchConditional 19 10 11
FunctionEnd FunctionEnd
...@@ -5,100 +5,89 @@ Linked vertex stage: ...@@ -5,100 +5,89 @@ 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
50(gl_InstanceID): 48(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
24(A): 7(ptr) Variable Function 13(A): 7(ptr) Variable Function
30(B): 7(ptr) Variable Function 20(B): 7(ptr) Variable Function
33(C): 7(ptr) Variable Function 23(C): 7(ptr) Variable Function
39(D): 7(ptr) Variable Function 29(D): 7(ptr) Variable Function
42(E): 7(ptr) Variable Function 32(E): 7(ptr) Variable Function
44(F): 7(ptr) Variable Function 34(F): 7(ptr) Variable Function
46(G): 7(ptr) Variable Function 40(G): 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 31 28 31 38 Store 13(A) 9
LoopMerge 11 10 None 14: 6(int) Load 8(i)
Branch 16 17: 16(bool) IEqual 14 15
16: Label SelectionMerge 19 None
SelectionMerge 12 None BranchConditional 17 18 19
BranchConditional 13 12 17
17: Label
18: 6(int) Load 8(i)
20: 6(int) IAdd 18 19
Store 8(i) 20
22: 14(bool) SLessThan 20 21
SelectionMerge 23 None
BranchConditional 22 23 11
23: Label
Branch 12
12: Label
Store 24(A) 9
25: 6(int) Load 8(i)
27: 14(bool) IEqual 25 26
SelectionMerge 29 None
BranchConditional 27 28 29
28: Label
Store 30(B) 19
Branch 10
32: Label
Store 33(C) 26
Branch 29
29: Label
34: 6(int) Load 8(i)
36: 14(bool) IEqual 34 35
SelectionMerge 38 None
BranchConditional 36 37 38
37: Label
Store 39(D) 40
Branch 11
41: Label
Store 42(E) 43
Branch 38
38: Label
Store 44(F) 45
Branch 10
11: Label 11: Label
Store 46(G) 47 Store 40(G) 41
Return Return
12: Label
36: 6(int) Load 8(i)
37: 6(int) IAdd 36 21
Store 8(i) 37
39: 16(bool) SLessThan 37 38
LoopMerge 11 12 None
BranchConditional 39 10 11
18: Label
Store 20(B) 21
Branch 12
22: Label
Store 23(C) 15
Branch 19
19: Label
24: 6(int) Load 8(i)
26: 16(bool) IEqual 24 25
SelectionMerge 28 None
BranchConditional 26 27 28
27: Label
Store 29(D) 30
Branch 11
31: Label
Store 32(E) 33
Branch 28
28: Label
Store 34(F) 35
Branch 12
FunctionEnd FunctionEnd
...@@ -5,7 +5,7 @@ Linked fragment stage: ...@@ -5,7 +5,7 @@ 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"
...@@ -16,9 +16,9 @@ Linked fragment stage: ...@@ -16,9 +16,9 @@ Linked fragment stage:
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 17 "bigColor"
Name 27 "d" Name 27 "d"
Name 32 "bigColor" Name 32 "gl_FragColor"
Name 38 "gl_FragColor"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
...@@ -26,18 +26,16 @@ Linked fragment stage: ...@@ -26,18 +26,16 @@ Linked fragment stage:
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)
38(gl_FragColor): 37(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
...@@ -45,29 +43,20 @@ Linked fragment stage: ...@@ -45,29 +43,20 @@ Linked fragment stage:
Store 9(color) 12 Store 9(color) 12
Branch 13 Branch 13
13: Label 13: Label
16: 17(bool) Phi 18 5 36 15 18: 7(fvec4) Load 17(bigColor)
LoopMerge 14 13 None 19: 7(fvec4) Load 9(color)
Branch 19 20: 7(fvec4) FAdd 19 18
19: Label Store 9(color) 20
SelectionMerge 15 None
BranchConditional 16 15 20
20: Label
24: 23(ptr) AccessChain 9(color) 22
25: 6(float) Load 24
28: 6(float) Load 27(d)
29: 17(bool) FOrdLessThan 25 28
SelectionMerge 30 None
BranchConditional 29 30 14
30: Label
Branch 15 Branch 15
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 14: Label
39: 7(fvec4) Load 9(color) 33: 7(fvec4) Load 9(color)
Store 38(gl_FragColor) 39 Store 32(gl_FragColor) 33
Return Return
15: Label
24: 23(ptr) AccessChain 9(color) 22
25: 6(float) Load 24
28: 6(float) Load 27(d)
30: 29(bool) FOrdLessThan 25 28
LoopMerge 14 15 None
BranchConditional 30 13 14
FunctionEnd FunctionEnd
...@@ -5,93 +5,92 @@ Linked vertex stage: ...@@ -5,93 +5,92 @@ 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
SelectionMerge 25 None
BranchConditional 23 24 25
11: Label
Store 42(G) 43
Return
12: Label 12: Label
Store 17(A) 18 40: 6(int) Load 8(i)
19: 6(int) Load 8(i) 41: 6(int) IAdd 40 19
21: 6(int) SMod 19 20 Store 8(i) 41
22: 15(bool) IEqual 21 9 Branch 13
SelectionMerge 24 None 13: Label
BranchConditional 22 23 24 14: 6(int) Load 8(i)
23: Label 17: 16(bool) SLessThan 14 15
Store 25(B) 18 LoopMerge 11 12 None
26: 6(int) Load 8(i) BranchConditional 17 10 11
27: 6(int) IAdd 26 18
Store 8(i) 27
Branch 10
28: Label
Store 29(C) 18
Branch 24
24: Label 24: Label
30: 6(int) Load 8(i) Store 26(B) 19
32: 6(int) SMod 30 31 Branch 12
33: 15(bool) IEqual 32 9 27: Label
SelectionMerge 35 None Store 28(C) 19
BranchConditional 33 34 35 Branch 25
34: Label 25: Label
Store 36(D) 18 29: 6(int) Load 8(i)
31: 6(int) SMod 29 30
32: 16(bool) IEqual 31 9
SelectionMerge 34 None
BranchConditional 32 33 34
33: Label
Store 35(D) 19
Branch 11 Branch 11
37: Label 36: Label
Store 38(E) 18 Store 37(E) 19
Branch 35 Branch 34
35: Label 34: Label
Store 39(F) 40 Store 38(F) 39
41: 6(int) Load 8(i) Branch 12
42: 6(int) IAdd 41 18
Store 8(i) 42
Branch 10
11: Label
Store 43(G) 44
Return
FunctionEnd FunctionEnd
...@@ -8,12 +8,12 @@ Linked fragment stage: ...@@ -8,12 +8,12 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 136 // Id's are bound by 137
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 40 96 EntryPoint Fragment 4 "main" 40 97
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
...@@ -38,14 +38,14 @@ Linked fragment stage: ...@@ -38,14 +38,14 @@ Linked fragment stage:
Name 68 "x" Name 68 "x"
Name 70 "localArray" Name 70 "localArray"
Name 75 "i" Name 75 "i"
Name 82 "a" Name 83 "a"
Name 88 "condition" Name 89 "condition"
Name 96 "color" Name 97 "color"
Name 106 "gl_FragColor" Name 107 "gl_FragColor"
Name 126 "samp2D" Name 127 "samp2D"
Name 132 "foo" Name 133 "foo"
Name 133 "foo2" Name 134 "foo2"
Name 135 "uFloatArray" Name 136 "uFloatArray"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
...@@ -80,26 +80,26 @@ Linked fragment stage: ...@@ -80,26 +80,26 @@ Linked fragment stage:
48: TypePointer Function 47 48: TypePointer Function 47
52: TypePointer Function 6(int) 52: TypePointer Function 6(int)
69: 6(int) Constant 5 69: 6(int) Constant 5
80: 6(int) Constant 16 81: 6(int) Constant 16
84: 7(float) Constant 0 85: 7(float) Constant 0
88(condition): 20(ptr) Variable UniformConstant 89(condition): 20(ptr) Variable UniformConstant
94: 6(int) Constant 3 95: 6(int) Constant 3
95: TypePointer Input 9(fvec4) 96: TypePointer Input 9(fvec4)
96(color): 95(ptr) Variable Input 97(color): 96(ptr) Variable Input
98: TypePointer Function 9(fvec4) 99: TypePointer Function 9(fvec4)
100: 32(int) Constant 1 101: 32(int) Constant 1
103: 32(int) Constant 2 104: 32(int) Constant 2
105: TypePointer Output 9(fvec4) 106: TypePointer Output 9(fvec4)
106(gl_FragColor): 105(ptr) Variable Output 107(gl_FragColor): 106(ptr) Variable Output
123: TypeImage 7(float) 2D sampled format:Unknown 124: TypeImage 7(float) 2D sampled format:Unknown
124: TypeSampledImage 123 125: TypeSampledImage 124
125: TypePointer UniformConstant 124 126: TypePointer UniformConstant 125
126(samp2D): 125(ptr) Variable UniformConstant 127(samp2D): 126(ptr) Variable UniformConstant
131: TypePointer UniformConstant 8(s1) 132: TypePointer UniformConstant 8(s1)
132(foo): 131(ptr) Variable UniformConstant 133(foo): 132(ptr) Variable UniformConstant
133(foo2): 17(ptr) Variable UniformConstant 134(foo2): 17(ptr) Variable UniformConstant
134: TypePointer UniformConstant 34 135: TypePointer UniformConstant 34
135(uFloatArray): 134(ptr) Variable UniformConstant 136(uFloatArray): 135(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
12(locals2): 11(ptr) Variable Function 12(locals2): 11(ptr) Variable Function
...@@ -108,7 +108,7 @@ Linked fragment stage: ...@@ -108,7 +108,7 @@ Linked fragment stage:
68(x): 52(ptr) Variable Function 68(x): 52(ptr) Variable Function
70(localArray): 35(ptr) Variable Function 70(localArray): 35(ptr) Variable Function
75(i): 52(ptr) Variable Function 75(i): 52(ptr) Variable Function
82(a): 35(ptr) Variable Function 83(a): 35(ptr) Variable Function
18: 17(ptr) AccessChain 15(foo3) 16 18: 17(ptr) AccessChain 15(foo3) 16
19: 10(s2) Load 18 19: 10(s2) Load 18
Store 12(locals2) 19 Store 12(locals2) 19
...@@ -159,57 +159,59 @@ Linked fragment stage: ...@@ -159,57 +159,59 @@ Linked fragment stage:
74: 30(ptr) AccessChain 70(localArray) 71 74: 30(ptr) AccessChain 70(localArray) 71
Store 74 73 Store 74 73
Store 75(i) 16 Store 75(i) 16
Branch 76 Branch 79
76: Label 76: Label
79: 6(int) Load 75(i) 84: 6(int) Load 75(i)
81: 23(bool) SLessThan 79 80 86: 30(ptr) AccessChain 83(a) 84
LoopMerge 77 76 None Store 86 85
BranchConditional 81 78 77 Branch 78
78: Label
83: 6(int) Load 75(i)
85: 30(ptr) AccessChain 82(a) 83
Store 85 84
86: 6(int) Load 75(i)
87: 6(int) IAdd 86 28
Store 75(i) 87
Branch 76
77: Label 77: Label
89: 6(int) Load 88(condition) 90: 6(int) Load 89(condition)
90: 23(bool) IEqual 89 28 91: 23(bool) IEqual 90 28
SelectionMerge 92 None SelectionMerge 93 None
BranchConditional 90 91 92 BranchConditional 91 92 93
91: Label 78: Label
93: 34 Load 70(localArray) 87: 6(int) Load 75(i)
Store 82(a) 93 88: 6(int) IAdd 87 28
Branch 92 Store 75(i) 88
Branch 79
79: Label
80: 6(int) Load 75(i)
82: 23(bool) SLessThan 80 81
LoopMerge 77 78 None
BranchConditional 82 76 77
92: Label 92: Label
97: 9(fvec4) Load 96(color) 94: 34 Load 70(localArray)
99: 98(ptr) AccessChain 12(locals2) 94 Store 83(a) 94
Store 99 97 Branch 93
101: 42(ptr) AccessChain 40(coord) 100 93: Label
102: 7(float) Load 101 98: 9(fvec4) Load 97(color)
104: 30(ptr) AccessChain 12(locals2) 94 103 100: 99(ptr) AccessChain 12(locals2) 95
Store 104 102 Store 100 98
107: 98(ptr) AccessChain 12(locals2) 94 102: 42(ptr) AccessChain 40(coord) 101
108: 9(fvec4) Load 107 103: 7(float) Load 102
109: 30(ptr) AccessChain 36(localFArray) 37 105: 30(ptr) AccessChain 12(locals2) 95 104
110: 7(float) Load 109 Store 105 103
111: 30(ptr) AccessChain 12(locals2) 27 28 108: 99(ptr) AccessChain 12(locals2) 95
112: 7(float) Load 111 109: 9(fvec4) Load 108
113: 7(float) FAdd 110 112 110: 30(ptr) AccessChain 36(localFArray) 37
114: 6(int) Load 68(x) 111: 7(float) Load 110
115: 30(ptr) AccessChain 70(localArray) 114 112: 30(ptr) AccessChain 12(locals2) 27 28
116: 7(float) Load 115 113: 7(float) Load 112
117: 7(float) FAdd 113 116 114: 7(float) FAdd 111 113
118: 6(int) Load 68(x) 115: 6(int) Load 68(x)
119: 30(ptr) AccessChain 82(a) 118 116: 30(ptr) AccessChain 70(localArray) 115
120: 7(float) Load 119 117: 7(float) Load 116
121: 7(float) FAdd 117 120 118: 7(float) FAdd 114 117
122: 9(fvec4) VectorTimesScalar 108 121 119: 6(int) Load 68(x)
127: 124 Load 126(samp2D) 120: 30(ptr) AccessChain 83(a) 119
128: 38(fvec2) Load 40(coord) 121: 7(float) Load 120
129: 9(fvec4) ImageSampleImplicitLod 127 128 122: 7(float) FAdd 118 121
130: 9(fvec4) FMul 122 129 123: 9(fvec4) VectorTimesScalar 109 122
Store 106(gl_FragColor) 130 128: 125 Load 127(samp2D)
129: 38(fvec2) Load 40(coord)
130: 9(fvec4) ImageSampleImplicitLod 128 129
131: 9(fvec4) FMul 123 130
Store 107(gl_FragColor) 131
Return Return
FunctionEnd FunctionEnd
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5,82 +5,84 @@ Linked vertex stage: ...@@ -5,82 +5,84 @@ 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
SelectionMerge 25 None
BranchConditional 23 24 25
11: Label
Store 38(D) 39
Return
12: Label 12: Label
Store 17(A) 18 Branch 13
19: 6(int) Load 8(i) 13: Label
21: 6(int) SMod 19 20 14: 6(int) Load 8(i)
22: 15(bool) IEqual 21 9 17: 16(bool) SLessThan 14 15
SelectionMerge 24 None LoopMerge 11 12 None
BranchConditional 22 23 24 BranchConditional 17 10 11
23: Label
Store 25(B) 20
Branch 10
26: Label
Store 27(C) 20
Branch 24
24: Label 24: Label
28: 6(int) Load 8(i) Store 26(B) 21
30: 6(int) SMod 28 29 Branch 12
31: 15(bool) IEqual 30 9 27: Label
SelectionMerge 33 None Store 28(C) 21
BranchConditional 31 32 33 Branch 25
32: Label 25: Label
Store 25(B) 20 29: 6(int) Load 8(i)
31: 6(int) SMod 29 30
32: 16(bool) IEqual 31 9
SelectionMerge 34 None
BranchConditional 32 33 34
33: Label
Store 26(B) 21
Branch 11 Branch 11
35: Label
Store 28(C) 21
Branch 34
34: Label 34: Label
Store 27(C) 20 36: 6(int) Load 8(i)
Branch 33 37: 6(int) IAdd 36 19
33: Label Store 8(i) 37
35: 6(int) Load 8(i) Branch 12
36: 6(int) IAdd 35 18
Store 8(i) 36
Branch 10
11: Label
Store 37(D) 38
Return
FunctionEnd FunctionEnd
...@@ -5,45 +5,47 @@ Linked vertex stage: ...@@ -5,45 +5,47 @@ 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
17: 6(int) Load 8(i)
19: 6(int) IAdd 17 18
Store 8(i) 19
Branch 10
11: Label 11: Label
Return Return
12: Label
Branch 13
13: Label
14: 6(int) Load 8(i)
17: 16(bool) SLessThan 14 15
LoopMerge 11 12 None
BranchConditional 17 10 11
FunctionEnd FunctionEnd
...@@ -5,7 +5,7 @@ Linked fragment stage: ...@@ -5,7 +5,7 @@ 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"
...@@ -16,9 +16,9 @@ Linked fragment stage: ...@@ -16,9 +16,9 @@ Linked fragment stage:
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
...@@ -26,37 +26,39 @@ Linked fragment stage: ...@@ -26,37 +26,39 @@ Linked fragment stage:
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
15: Label
28: 7(fvec4) Load 27(bigColor)
29: 7(fvec4) Load 9(color)
30: 7(fvec4) FAdd 29 28
Store 9(color) 30
Branch 13
14: Label 14: Label
33: 7(fvec4) Load 9(color) 34: 7(fvec4) Load 9(color)
Store 32(gl_FragColor) 33 Store 33(gl_FragColor) 34
Return Return
15: Label
Branch 16
16: Label
20: 19(ptr) AccessChain 9(color) 18
21: 6(float) Load 20
24: 6(float) Load 23(d)
26: 25(bool) FOrdLessThan 21 24
LoopMerge 14 15 None
BranchConditional 26 13 14
FunctionEnd 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