Update .out files with new loop SPIR-V.

Also update breakForLoop and call builder.closeLoop() in code
generation.

Remove dead code.

Change-Id: Ic8ce5b208530f8787989ef45a2efa405f1b45310
This commit is contained in:
Dejan Mircevski 2016-01-11 14:48:36 -05:00
parent 7819bee82c
commit c8fbbab419
15 changed files with 2766 additions and 2793 deletions

View File

@ -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
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
} 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
} }
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
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:

View File

@ -1,71 +1,73 @@
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

View File

@ -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

View File

@ -1,104 +1,93 @@
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

View File

@ -1,73 +1,62 @@
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

View File

@ -1,97 +1,96 @@
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

View File

@ -1,194 +1,204 @@
spv.forLoop.frag spv.forLoop.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 122 // Id's are bound by 127
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 97 EntryPoint Fragment 4 "main" 11 101
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 15 "i" Name 15 "i"
Name 22 "Count" Name 23 "Count"
Name 27 "bigColor" Name 28 "bigColor"
Name 35 "gl_FragColor" Name 36 "gl_FragColor"
Name 38 "sum" Name 39 "sum"
Name 40 "i" Name 41 "i"
Name 50 "v4" Name 52 "v4"
Name 60 "i" Name 62 "i"
Name 66 "tv4" Name 69 "tv4"
Name 83 "r" Name 86 "r"
Name 89 "i" Name 92 "i"
Name 97 "f" Name 101 "f"
Name 110 "i" Name 114 "i"
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
13: TypeInt 32 1 13: TypeInt 32 1
14: TypePointer Function 13(int) 14: TypePointer Function 13(int)
16: 13(int) Constant 0 16: 13(int) Constant 0
21: TypePointer UniformConstant 13(int) 22: TypePointer UniformConstant 13(int)
22(Count): 21(ptr) Variable UniformConstant 23(Count): 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
32: 13(int) Constant 1 33: 13(int) Constant 1
34: TypePointer Output 7(fvec4) 35: TypePointer Output 7(fvec4)
35(gl_FragColor): 34(ptr) Variable Output 36(gl_FragColor): 35(ptr) Variable Output
37: TypePointer Function 6(float) 38: TypePointer Function 6(float)
39: 6(float) Constant 0 40: 6(float) Constant 0
45: 13(int) Constant 4 47: 13(int) Constant 4
47: TypeInt 32 0 49: TypeInt 32 0
48: TypeVector 47(int) 4 50: TypeVector 49(int) 4
49: TypePointer UniformConstant 48(ivec4) 51: TypePointer UniformConstant 50(ivec4)
50(v4): 49(ptr) Variable UniformConstant 52(v4): 51(ptr) Variable UniformConstant
52: TypePointer UniformConstant 47(int) 54: TypePointer UniformConstant 49(int)
71: 47(int) Constant 4 74: 49(int) Constant 4
84: TypeVector 6(float) 3 87: TypeVector 6(float) 3
96: TypePointer Input 6(float) 100: TypePointer Input 6(float)
97(f): 96(ptr) Variable Input 101(f): 100(ptr) Variable Input
99: 47(int) Constant 3 103: 49(int) Constant 3
115: 13(int) Constant 16 120: 13(int) Constant 16
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
15(i): 14(ptr) Variable Function 15(i): 14(ptr) Variable Function
38(sum): 37(ptr) Variable Function 39(sum): 38(ptr) Variable Function
40(i): 14(ptr) Variable Function 41(i): 14(ptr) Variable Function
60(i): 14(ptr) Variable Function 62(i): 14(ptr) Variable Function
66(tv4): 8(ptr) Variable Function 69(tv4): 8(ptr) Variable Function
83(r): 8(ptr) Variable Function 86(r): 8(ptr) Variable Function
89(i): 14(ptr) Variable Function 92(i): 14(ptr) Variable Function
110(i): 14(ptr) Variable Function 114(i): 14(ptr) Variable Function
12: 7(fvec4) Load 11(BaseColor) 12: 7(fvec4) Load 11(BaseColor)
Store 9(color) 12 Store 9(color) 12
Store 15(i) 16 Store 15(i) 16
Branch 17 Branch 20
17: Label 17: Label
20: 13(int) Load 15(i) 29: 7(fvec4) Load 28(bigColor)
23: 13(int) Load 22(Count) 30: 7(fvec4) Load 9(color)
25: 24(bool) SLessThan 20 23 31: 7(fvec4) FAdd 30 29
LoopMerge 18 17 None Store 9(color) 31
BranchConditional 25 19 18 Branch 19
19: Label 18: Label
28: 7(fvec4) Load 27(bigColor) 37: 7(fvec4) Load 9(color)
29: 7(fvec4) Load 9(color) Store 36(gl_FragColor) 37
30: 7(fvec4) FAdd 29 28 Store 39(sum) 40
Store 9(color) 30 Store 41(i) 16
31: 13(int) Load 15(i) Branch 45
33: 13(int) IAdd 31 32 19: Label
Store 15(i) 33 32: 13(int) Load 15(i)
Branch 17 34: 13(int) IAdd 32 33
18: Label Store 15(i) 34
36: 7(fvec4) Load 9(color) Branch 20
Store 35(gl_FragColor) 36 20: Label
Store 38(sum) 39 21: 13(int) Load 15(i)
Store 40(i) 16 24: 13(int) Load 23(Count)
Branch 41 26: 25(bool) SLessThan 21 24
41: Label LoopMerge 18 19 None
44: 13(int) Load 40(i) BranchConditional 26 17 18
46: 24(bool) SLessThan 44 45 42: Label
LoopMerge 42 41 None 53: 13(int) Load 41(i)
BranchConditional 46 43 42 55: 54(ptr) AccessChain 52(v4) 53
43: Label 56: 49(int) Load 55
51: 13(int) Load 40(i) 57: 6(float) ConvertUToF 56
53: 52(ptr) AccessChain 50(v4) 51 58: 6(float) Load 39(sum)
54: 47(int) Load 53 59: 6(float) FAdd 58 57
55: 6(float) ConvertUToF 54 Store 39(sum) 59
56: 6(float) Load 38(sum) Branch 44
57: 6(float) FAdd 56 55 43: Label
Store 38(sum) 57 Store 62(i) 16
58: 13(int) Load 40(i) Branch 66
59: 13(int) IAdd 58 32 44: Label
Store 40(i) 59 60: 13(int) Load 41(i)
Branch 41 61: 13(int) IAdd 60 33
42: Label Store 41(i) 61
Store 60(i) 16 Branch 45
Branch 61 45: Label
61: Label 46: 13(int) Load 41(i)
64: 13(int) Load 60(i) 48: 25(bool) SLessThan 46 47
65: 24(bool) SLessThan 64 45 LoopMerge 43 44 None
LoopMerge 62 61 None BranchConditional 48 42 43
BranchConditional 65 63 62 63: Label
63: Label 70: 13(int) Load 62(i)
67: 13(int) Load 60(i) 71: 13(int) Load 62(i)
68: 13(int) Load 60(i) 72: 54(ptr) AccessChain 52(v4) 71
69: 52(ptr) AccessChain 50(v4) 68 73: 49(int) Load 72
70: 47(int) Load 69 75: 49(int) IMul 73 74
72: 47(int) IMul 70 71 76: 6(float) ConvertUToF 75
73: 6(float) ConvertUToF 72 77: 38(ptr) AccessChain 69(tv4) 70
74: 37(ptr) AccessChain 66(tv4) 67 Store 77 76
Store 74 73 Branch 65
75: 13(int) Load 60(i) 64: Label
76: 13(int) IAdd 75 32 80: 6(float) Load 39(sum)
Store 60(i) 76 81: 7(fvec4) CompositeConstruct 80 80 80 80
Branch 61 82: 7(fvec4) Load 69(tv4)
62: Label 83: 7(fvec4) FAdd 81 82
77: 6(float) Load 38(sum) 84: 7(fvec4) Load 36(gl_FragColor)
78: 7(fvec4) CompositeConstruct 77 77 77 77 85: 7(fvec4) FAdd 84 83
79: 7(fvec4) Load 66(tv4) Store 36(gl_FragColor) 85
80: 7(fvec4) FAdd 78 79 88: 7(fvec4) Load 11(BaseColor)
81: 7(fvec4) Load 35(gl_FragColor) 89: 87(fvec3) VectorShuffle 88 88 0 1 2
82: 7(fvec4) FAdd 81 80 90: 7(fvec4) Load 86(r)
Store 35(gl_FragColor) 82 91: 7(fvec4) VectorShuffle 90 89 4 5 6 3
85: 7(fvec4) Load 11(BaseColor) Store 86(r) 91
86: 84(fvec3) VectorShuffle 85 85 0 1 2 Store 92(i) 16
87: 7(fvec4) Load 83(r) Branch 96
88: 7(fvec4) VectorShuffle 87 86 4 5 6 3 65: Label
Store 83(r) 88 78: 13(int) Load 62(i)
Store 89(i) 16 79: 13(int) IAdd 78 33
Branch 90 Store 62(i) 79
90: Label Branch 66
93: 13(int) Load 89(i) 66: Label
94: 13(int) Load 22(Count) 67: 13(int) Load 62(i)
95: 24(bool) SLessThan 93 94 68: 25(bool) SLessThan 67 47
LoopMerge 91 90 None LoopMerge 64 65 None
BranchConditional 95 92 91 BranchConditional 68 63 64
92: Label 93: Label
98: 6(float) Load 97(f) 102: 6(float) Load 101(f)
100: 37(ptr) AccessChain 83(r) 99 104: 38(ptr) AccessChain 86(r) 103
Store 100 98 Store 104 102
101: 13(int) Load 89(i) Branch 95
102: 13(int) IAdd 101 32 94: Label
Store 89(i) 102 107: 7(fvec4) Load 86(r)
Branch 90 108: 87(fvec3) VectorShuffle 107 107 0 1 2
91: Label 109: 7(fvec4) Load 36(gl_FragColor)
103: 7(fvec4) Load 83(r) 110: 87(fvec3) VectorShuffle 109 109 0 1 2
104: 84(fvec3) VectorShuffle 103 103 0 1 2 111: 87(fvec3) FAdd 110 108
105: 7(fvec4) Load 35(gl_FragColor) 112: 7(fvec4) Load 36(gl_FragColor)
106: 84(fvec3) VectorShuffle 105 105 0 1 2 113: 7(fvec4) VectorShuffle 112 111 4 5 6 3
107: 84(fvec3) FAdd 106 104 Store 36(gl_FragColor) 113
108: 7(fvec4) Load 35(gl_FragColor) Store 114(i) 16
109: 7(fvec4) VectorShuffle 108 107 4 5 6 3 Branch 118
Store 35(gl_FragColor) 109 95: Label
Store 110(i) 16 105: 13(int) Load 92(i)
Branch 111 106: 13(int) IAdd 105 33
111: Label Store 92(i) 106
114: 13(int) Load 110(i) Branch 96
116: 24(bool) SLessThan 114 115 96: Label
LoopMerge 112 111 None 97: 13(int) Load 92(i)
BranchConditional 116 113 112 98: 13(int) Load 23(Count)
113: Label 99: 25(bool) SLessThan 97 98
117: 6(float) Load 97(f) LoopMerge 94 95 None
118: 7(fvec4) Load 35(gl_FragColor) BranchConditional 99 93 94
119: 7(fvec4) VectorTimesScalar 118 117 115: Label
Store 35(gl_FragColor) 119 122: 6(float) Load 101(f)
120: 13(int) Load 110(i) 123: 7(fvec4) Load 36(gl_FragColor)
121: 13(int) IAdd 120 45 124: 7(fvec4) VectorTimesScalar 123 122
Store 110(i) 121 Store 36(gl_FragColor) 124
Branch 111 Branch 117
112: Label 116: Label
Return Return
FunctionEnd 117: Label
125: 13(int) Load 114(i)
126: 13(int) IAdd 125 47
Store 114(i) 126
Branch 118
118: Label
119: 13(int) Load 114(i)
121: 25(bool) SLessThan 119 120
LoopMerge 116 117 None
BranchConditional 121 115 116
FunctionEnd

View File

@ -1,215 +1,217 @@
spv.localAggregates.frag spv.localAggregates.frag
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
WARNING: 0:5: varying deprecated in version 130; may be removed in future release WARNING: 0:5: varying deprecated in version 130; may be removed in future release
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 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"
Name 8 "s1" Name 8 "s1"
MemberName 8(s1) 0 "i" MemberName 8(s1) 0 "i"
MemberName 8(s1) 1 "f" MemberName 8(s1) 1 "f"
Name 10 "s2" Name 10 "s2"
MemberName 10(s2) 0 "i" MemberName 10(s2) 0 "i"
MemberName 10(s2) 1 "f" MemberName 10(s2) 1 "f"
MemberName 10(s2) 2 "s1_1" MemberName 10(s2) 2 "s1_1"
MemberName 10(s2) 3 "bleh" MemberName 10(s2) 3 "bleh"
Name 12 "locals2" Name 12 "locals2"
Name 13 "s3" Name 13 "s3"
MemberName 13(s3) 0 "s2_1" MemberName 13(s3) 0 "s2_1"
MemberName 13(s3) 1 "i" MemberName 13(s3) 1 "i"
MemberName 13(s3) 2 "f" MemberName 13(s3) 2 "f"
MemberName 13(s3) 3 "s1_1" MemberName 13(s3) 3 "s1_1"
Name 15 "foo3" Name 15 "foo3"
Name 36 "localFArray" Name 36 "localFArray"
Name 40 "coord" Name 40 "coord"
Name 49 "localIArray" Name 49 "localIArray"
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
7: TypeFloat 32 7: TypeFloat 32
8(s1): TypeStruct 6(int) 7(float) 8(s1): TypeStruct 6(int) 7(float)
9: TypeVector 7(float) 4 9: TypeVector 7(float) 4
10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4) 10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4)
11: TypePointer Function 10(s2) 11: TypePointer Function 10(s2)
13(s3): TypeStruct 10(s2) 6(int) 7(float) 8(s1) 13(s3): TypeStruct 10(s2) 6(int) 7(float) 8(s1)
14: TypePointer UniformConstant 13(s3) 14: TypePointer UniformConstant 13(s3)
15(foo3): 14(ptr) Variable UniformConstant 15(foo3): 14(ptr) Variable UniformConstant
16: 6(int) Constant 0 16: 6(int) Constant 0
17: TypePointer UniformConstant 10(s2) 17: TypePointer UniformConstant 10(s2)
20: TypePointer UniformConstant 6(int) 20: TypePointer UniformConstant 6(int)
23: TypeBool 23: TypeBool
27: 6(int) Constant 2 27: 6(int) Constant 2
28: 6(int) Constant 1 28: 6(int) Constant 1
29: 7(float) Constant 1065353216 29: 7(float) Constant 1065353216
30: TypePointer Function 7(float) 30: TypePointer Function 7(float)
32: TypeInt 32 0 32: TypeInt 32 0
33: 32(int) Constant 16 33: 32(int) Constant 16
34: TypeArray 7(float) 33 34: TypeArray 7(float) 33
35: TypePointer Function 34 35: TypePointer Function 34
37: 6(int) Constant 4 37: 6(int) Constant 4
38: TypeVector 7(float) 2 38: TypeVector 7(float) 2
39: TypePointer Input 38(fvec2) 39: TypePointer Input 38(fvec2)
40(coord): 39(ptr) Variable Input 40(coord): 39(ptr) Variable Input
41: 32(int) Constant 0 41: 32(int) Constant 0
42: TypePointer Input 7(float) 42: TypePointer Input 7(float)
46: 32(int) Constant 8 46: 32(int) Constant 8
47: TypeArray 6(int) 46 47: TypeArray 6(int) 46
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
36(localFArray): 35(ptr) Variable Function 36(localFArray): 35(ptr) Variable Function
49(localIArray): 48(ptr) Variable Function 49(localIArray): 48(ptr) Variable Function
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
21: 20(ptr) AccessChain 15(foo3) 16 16 21: 20(ptr) AccessChain 15(foo3) 16 16
22: 6(int) Load 21 22: 6(int) Load 21
24: 23(bool) SGreaterThan 22 16 24: 23(bool) SGreaterThan 22 16
SelectionMerge 26 None SelectionMerge 26 None
BranchConditional 24 25 54 BranchConditional 24 25 54
25: Label 25: Label
31: 30(ptr) AccessChain 12(locals2) 27 28 31: 30(ptr) AccessChain 12(locals2) 27 28
Store 31 29 Store 31 29
43: 42(ptr) AccessChain 40(coord) 41 43: 42(ptr) AccessChain 40(coord) 41
44: 7(float) Load 43 44: 7(float) Load 43
45: 30(ptr) AccessChain 36(localFArray) 37 45: 30(ptr) AccessChain 36(localFArray) 37
Store 45 44 Store 45 44
50: 20(ptr) AccessChain 15(foo3) 16 16 50: 20(ptr) AccessChain 15(foo3) 16 16
51: 6(int) Load 50 51: 6(int) Load 50
53: 52(ptr) AccessChain 49(localIArray) 27 53: 52(ptr) AccessChain 49(localIArray) 27
Store 53 51 Store 53 51
Branch 26 Branch 26
54: Label 54: Label
55: 42(ptr) AccessChain 40(coord) 41 55: 42(ptr) AccessChain 40(coord) 41
56: 7(float) Load 55 56: 7(float) Load 55
57: 30(ptr) AccessChain 12(locals2) 27 28 57: 30(ptr) AccessChain 12(locals2) 27 28
Store 57 56 Store 57 56
58: 30(ptr) AccessChain 36(localFArray) 37 58: 30(ptr) AccessChain 36(localFArray) 37
Store 58 29 Store 58 29
59: 52(ptr) AccessChain 49(localIArray) 27 59: 52(ptr) AccessChain 49(localIArray) 27
Store 59 16 Store 59 16
Branch 26 Branch 26
26: Label 26: Label
60: 52(ptr) AccessChain 49(localIArray) 27 60: 52(ptr) AccessChain 49(localIArray) 27
61: 6(int) Load 60 61: 6(int) Load 60
62: 23(bool) IEqual 61 16 62: 23(bool) IEqual 61 16
SelectionMerge 64 None SelectionMerge 64 None
BranchConditional 62 63 64 BranchConditional 62 63 64
63: Label 63: Label
65: 30(ptr) AccessChain 36(localFArray) 37 65: 30(ptr) AccessChain 36(localFArray) 37
66: 7(float) Load 65 66: 7(float) Load 65
67: 7(float) FAdd 66 29 67: 7(float) FAdd 66 29
Store 65 67 Store 65 67
Branch 64 Branch 64
64: Label 64: Label
Store 68(x) 69 Store 68(x) 69
71: 6(int) Load 68(x) 71: 6(int) Load 68(x)
72: 42(ptr) AccessChain 40(coord) 41 72: 42(ptr) AccessChain 40(coord) 41
73: 7(float) Load 72 73: 7(float) Load 72
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 77: Label
83: 6(int) Load 75(i) 90: 6(int) Load 89(condition)
85: 30(ptr) AccessChain 82(a) 83 91: 23(bool) IEqual 90 28
Store 85 84 SelectionMerge 93 None
86: 6(int) Load 75(i) BranchConditional 91 92 93
87: 6(int) IAdd 86 28 78: Label
Store 75(i) 87 87: 6(int) Load 75(i)
Branch 76 88: 6(int) IAdd 87 28
77: Label Store 75(i) 88
89: 6(int) Load 88(condition) Branch 79
90: 23(bool) IEqual 89 28 79: Label
SelectionMerge 92 None 80: 6(int) Load 75(i)
BranchConditional 90 91 92 82: 23(bool) SLessThan 80 81
91: Label LoopMerge 77 78 None
93: 34 Load 70(localArray) BranchConditional 82 76 77
Store 82(a) 93 92: Label
Branch 92 94: 34 Load 70(localArray)
92: Label Store 83(a) 94
97: 9(fvec4) Load 96(color) Branch 93
99: 98(ptr) AccessChain 12(locals2) 94 93: Label
Store 99 97 98: 9(fvec4) Load 97(color)
101: 42(ptr) AccessChain 40(coord) 100 100: 99(ptr) AccessChain 12(locals2) 95
102: 7(float) Load 101 Store 100 98
104: 30(ptr) AccessChain 12(locals2) 94 103 102: 42(ptr) AccessChain 40(coord) 101
Store 104 102 103: 7(float) Load 102
107: 98(ptr) AccessChain 12(locals2) 94 105: 30(ptr) AccessChain 12(locals2) 95 104
108: 9(fvec4) Load 107 Store 105 103
109: 30(ptr) AccessChain 36(localFArray) 37 108: 99(ptr) AccessChain 12(locals2) 95
110: 7(float) Load 109 109: 9(fvec4) Load 108
111: 30(ptr) AccessChain 12(locals2) 27 28 110: 30(ptr) AccessChain 36(localFArray) 37
112: 7(float) Load 111 111: 7(float) Load 110
113: 7(float) FAdd 110 112 112: 30(ptr) AccessChain 12(locals2) 27 28
114: 6(int) Load 68(x) 113: 7(float) Load 112
115: 30(ptr) AccessChain 70(localArray) 114 114: 7(float) FAdd 111 113
116: 7(float) Load 115 115: 6(int) Load 68(x)
117: 7(float) FAdd 113 116 116: 30(ptr) AccessChain 70(localArray) 115
118: 6(int) Load 68(x) 117: 7(float) Load 116
119: 30(ptr) AccessChain 82(a) 118 118: 7(float) FAdd 114 117
120: 7(float) Load 119 119: 6(int) Load 68(x)
121: 7(float) FAdd 117 120 120: 30(ptr) AccessChain 83(a) 119
122: 9(fvec4) VectorTimesScalar 108 121 121: 7(float) Load 120
127: 124 Load 126(samp2D) 122: 7(float) FAdd 118 121
128: 38(fvec2) Load 40(coord) 123: 9(fvec4) VectorTimesScalar 109 122
129: 9(fvec4) ImageSampleImplicitLod 127 128 128: 125 Load 127(samp2D)
130: 9(fvec4) FMul 122 129 129: 38(fvec2) Load 40(coord)
Store 106(gl_FragColor) 130 130: 9(fvec4) ImageSampleImplicitLod 128 129
Return 131: 9(fvec4) FMul 123 130
FunctionEnd Store 107(gl_FragColor) 131
Return
FunctionEnd

File diff suppressed because it is too large Load Diff

View File

@ -1,308 +1,299 @@
spv.loopsArtificial.frag spv.loopsArtificial.frag
WARNING: 0:14: varying deprecated in version 130; may be removed in future release WARNING: 0:14: varying deprecated in version 130; may be removed in future release
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 191 // Id's are bound by 186
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 130 Source GLSL 130
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 27 "d4" Name 17 "bigColor4"
Name 32 "bigColor4" Name 27 "d4"
Name 84 "d13" Name 79 "d13"
Name 144 "gl_FragColor" Name 139 "gl_FragColor"
Name 146 "bigColor" Name 141 "bigColor"
Name 147 "bigColor1_1" Name 142 "bigColor1_1"
Name 148 "bigColor1_2" Name 143 "bigColor1_2"
Name 149 "bigColor1_3" Name 144 "bigColor1_3"
Name 150 "bigColor2" Name 145 "bigColor2"
Name 151 "bigColor3" Name 146 "bigColor3"
Name 152 "bigColor5" Name 147 "bigColor5"
Name 153 "bigColor6" Name 148 "bigColor6"
Name 154 "bigColor7" Name 149 "bigColor7"
Name 155 "bigColor8" Name 150 "bigColor8"
Name 156 "d" Name 151 "d"
Name 157 "d2" Name 152 "d2"
Name 158 "d3" Name 153 "d3"
Name 159 "d5" Name 154 "d5"
Name 160 "d6" Name 155 "d6"
Name 161 "d7" Name 156 "d7"
Name 162 "d8" Name 157 "d8"
Name 163 "d9" Name 158 "d9"
Name 164 "d10" Name 159 "d10"
Name 165 "d11" Name 160 "d11"
Name 166 "d12" Name 161 "d12"
Name 167 "d14" Name 162 "d14"
Name 168 "d15" Name 163 "d15"
Name 169 "d16" Name 164 "d16"
Name 170 "d17" Name 165 "d17"
Name 171 "d18" Name 166 "d18"
Name 172 "d19" Name 167 "d19"
Name 173 "d20" Name 168 "d20"
Name 174 "d21" Name 169 "d21"
Name 175 "d22" Name 170 "d22"
Name 176 "d23" Name 171 "d23"
Name 177 "d24" Name 172 "d24"
Name 178 "d25" Name 173 "d25"
Name 179 "d26" Name 174 "d26"
Name 180 "d27" Name 175 "d27"
Name 181 "d28" Name 176 "d28"
Name 182 "d29" Name 177 "d29"
Name 183 "d30" Name 178 "d30"
Name 184 "d31" Name 179 "d31"
Name 185 "d32" Name 180 "d32"
Name 186 "d33" Name 181 "d33"
Name 187 "d34" Name 182 "d34"
Name 190 "Count" Name 185 "Count"
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(bigColor4): 16(ptr) Variable UniformConstant
21: TypeInt 32 0 21: TypeInt 32 0
22: 21(int) Constant 2 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(d4): 26(ptr) Variable UniformConstant 27(d4): 26(ptr) Variable UniformConstant
31: TypePointer UniformConstant 7(fvec4) 29: TypeBool
32(bigColor4): 31(ptr) Variable UniformConstant 33: 6(float) Constant 1073741824
36: 21(int) Constant 0 34: 21(int) Constant 2
43: 6(float) Constant 1073741824 47: 6(float) Constant 1065353216
56: 6(float) Constant 1065353216 50: 21(int) Constant 1
58: 17(bool) ConstantFalse 76: 21(int) Constant 3
60: 21(int) Constant 1 79(d13): 26(ptr) Variable UniformConstant
81: 21(int) Constant 3 138: TypePointer Output 7(fvec4)
84(d13): 26(ptr) Variable UniformConstant 139(gl_FragColor): 138(ptr) Variable Output
143: TypePointer Output 7(fvec4) 141(bigColor): 16(ptr) Variable UniformConstant
144(gl_FragColor): 143(ptr) Variable Output 142(bigColor1_1): 16(ptr) Variable UniformConstant
146(bigColor): 31(ptr) Variable UniformConstant 143(bigColor1_2): 16(ptr) Variable UniformConstant
147(bigColor1_1): 31(ptr) Variable UniformConstant 144(bigColor1_3): 16(ptr) Variable UniformConstant
148(bigColor1_2): 31(ptr) Variable UniformConstant 145(bigColor2): 16(ptr) Variable UniformConstant
149(bigColor1_3): 31(ptr) Variable UniformConstant 146(bigColor3): 16(ptr) Variable UniformConstant
150(bigColor2): 31(ptr) Variable UniformConstant 147(bigColor5): 16(ptr) Variable UniformConstant
151(bigColor3): 31(ptr) Variable UniformConstant 148(bigColor6): 16(ptr) Variable UniformConstant
152(bigColor5): 31(ptr) Variable UniformConstant 149(bigColor7): 16(ptr) Variable UniformConstant
153(bigColor6): 31(ptr) Variable UniformConstant 150(bigColor8): 16(ptr) Variable UniformConstant
154(bigColor7): 31(ptr) Variable UniformConstant 151(d): 26(ptr) Variable UniformConstant
155(bigColor8): 31(ptr) Variable UniformConstant 152(d2): 26(ptr) Variable UniformConstant
156(d): 26(ptr) Variable UniformConstant 153(d3): 26(ptr) Variable UniformConstant
157(d2): 26(ptr) Variable UniformConstant 154(d5): 26(ptr) Variable UniformConstant
158(d3): 26(ptr) Variable UniformConstant 155(d6): 26(ptr) Variable UniformConstant
159(d5): 26(ptr) Variable UniformConstant 156(d7): 26(ptr) Variable UniformConstant
160(d6): 26(ptr) Variable UniformConstant 157(d8): 26(ptr) Variable UniformConstant
161(d7): 26(ptr) Variable UniformConstant 158(d9): 26(ptr) Variable UniformConstant
162(d8): 26(ptr) Variable UniformConstant 159(d10): 26(ptr) Variable UniformConstant
163(d9): 26(ptr) Variable UniformConstant 160(d11): 26(ptr) Variable UniformConstant
164(d10): 26(ptr) Variable UniformConstant 161(d12): 26(ptr) Variable UniformConstant
165(d11): 26(ptr) Variable UniformConstant 162(d14): 26(ptr) Variable UniformConstant
166(d12): 26(ptr) Variable UniformConstant 163(d15): 26(ptr) Variable UniformConstant
167(d14): 26(ptr) Variable UniformConstant 164(d16): 26(ptr) Variable UniformConstant
168(d15): 26(ptr) Variable UniformConstant 165(d17): 26(ptr) Variable UniformConstant
169(d16): 26(ptr) Variable UniformConstant 166(d18): 26(ptr) Variable UniformConstant
170(d17): 26(ptr) Variable UniformConstant 167(d19): 26(ptr) Variable UniformConstant
171(d18): 26(ptr) Variable UniformConstant 168(d20): 26(ptr) Variable UniformConstant
172(d19): 26(ptr) Variable UniformConstant 169(d21): 26(ptr) Variable UniformConstant
173(d20): 26(ptr) Variable UniformConstant 170(d22): 26(ptr) Variable UniformConstant
174(d21): 26(ptr) Variable UniformConstant 171(d23): 26(ptr) Variable UniformConstant
175(d22): 26(ptr) Variable UniformConstant 172(d24): 26(ptr) Variable UniformConstant
176(d23): 26(ptr) Variable UniformConstant 173(d25): 26(ptr) Variable UniformConstant
177(d24): 26(ptr) Variable UniformConstant 174(d26): 26(ptr) Variable UniformConstant
178(d25): 26(ptr) Variable UniformConstant 175(d27): 26(ptr) Variable UniformConstant
179(d26): 26(ptr) Variable UniformConstant 176(d28): 26(ptr) Variable UniformConstant
180(d27): 26(ptr) Variable UniformConstant 177(d29): 26(ptr) Variable UniformConstant
181(d28): 26(ptr) Variable UniformConstant 178(d30): 26(ptr) Variable UniformConstant
182(d29): 26(ptr) Variable UniformConstant 179(d31): 26(ptr) Variable UniformConstant
183(d30): 26(ptr) Variable UniformConstant 180(d32): 26(ptr) Variable UniformConstant
184(d31): 26(ptr) Variable UniformConstant 181(d33): 26(ptr) Variable UniformConstant
185(d32): 26(ptr) Variable UniformConstant 182(d34): 26(ptr) Variable UniformConstant
186(d33): 26(ptr) Variable UniformConstant 183: TypeInt 32 1
187(d34): 26(ptr) Variable UniformConstant 184: TypePointer UniformConstant 183(int)
188: TypeInt 32 1 185(Count): 184(ptr) Variable UniformConstant
189: TypePointer UniformConstant 188(int) 4(main): 2 Function None 3
190(Count): 189(ptr) Variable UniformConstant 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(bigColor4)
13: Label 19: 7(fvec4) Load 9(color)
16: 17(bool) Phi 18 5 58 52 58 66 20: 7(fvec4) FAdd 19 18
LoopMerge 14 13 None Store 9(color) 20
Branch 19 24: 23(ptr) AccessChain 9(color) 22
19: Label 25: 6(float) Load 24
SelectionMerge 15 None 28: 6(float) Load 27(d4)
BranchConditional 16 15 20 30: 29(bool) FOrdLessThan 25 28
20: Label SelectionMerge 32 None
24: 23(ptr) AccessChain 9(color) 22 BranchConditional 30 31 32
25: 6(float) Load 24 14: Label
28: 6(float) Load 27(d4) Branch 75
29: 17(bool) FOrdLessThan 25 28 15: Label
SelectionMerge 30 None 68: 23(ptr) AccessChain 9(color) 34
BranchConditional 29 30 14 69: 6(float) Load 68
30: Label 70: 6(float) Load 27(d4)
Branch 15 71: 29(bool) FOrdLessThan 69 70
15: Label LoopMerge 14 15 None
33: 7(fvec4) Load 32(bigColor4) BranchConditional 71 13 14
34: 7(fvec4) Load 9(color) 31: Label
35: 7(fvec4) FAdd 34 33 35: 23(ptr) AccessChain 9(color) 34
Store 9(color) 35 36: 6(float) Load 35
37: 23(ptr) AccessChain 9(color) 36 37: 6(float) FAdd 36 33
38: 6(float) Load 37 38: 23(ptr) AccessChain 9(color) 34
39: 6(float) Load 27(d4) Store 38 37
40: 17(bool) FOrdLessThan 38 39 39: 23(ptr) AccessChain 9(color) 34
SelectionMerge 42 None 40: 6(float) Load 39
BranchConditional 40 41 42 41: 6(float) Load 27(d4)
41: Label 42: 29(bool) FOrdLessThan 40 41
44: 23(ptr) AccessChain 9(color) 22 SelectionMerge 44 None
45: 6(float) Load 44 BranchConditional 42 43 44
46: 6(float) FAdd 45 43 43: Label
47: 23(ptr) AccessChain 9(color) 22 45: 23(ptr) AccessChain 9(color) 22
Store 47 46 46: 6(float) Load 45
48: 23(ptr) AccessChain 9(color) 22 48: 6(float) FAdd 46 47
49: 6(float) Load 48 Store 45 48
50: 6(float) Load 27(d4) Branch 15
51: 17(bool) FOrdLessThan 49 50 44: Label
SelectionMerge 53 None Branch 32
BranchConditional 51 52 53 32: Label
52: Label 51: 23(ptr) AccessChain 9(color) 50
54: 23(ptr) AccessChain 9(color) 36 52: 6(float) Load 51
55: 6(float) Load 54 53: 6(float) Load 27(d4)
57: 6(float) FAdd 55 56 54: 29(bool) FOrdLessThan 52 53
Store 54 57 SelectionMerge 56 None
Branch 13 BranchConditional 54 55 62
53: Label 55: Label
Branch 42 57: 6(float) Load 27(d4)
42: Label 58: 23(ptr) AccessChain 9(color) 50
61: 23(ptr) AccessChain 9(color) 60 59: 6(float) Load 58
62: 6(float) Load 61 60: 6(float) FAdd 59 57
63: 6(float) Load 27(d4) 61: 23(ptr) AccessChain 9(color) 50
64: 17(bool) FOrdLessThan 62 63 Store 61 60
SelectionMerge 66 None Branch 56
BranchConditional 64 65 72 62: Label
65: Label 63: 6(float) Load 27(d4)
67: 6(float) Load 27(d4) 64: 23(ptr) AccessChain 9(color) 22
68: 23(ptr) AccessChain 9(color) 60 65: 6(float) Load 64
69: 6(float) Load 68 66: 6(float) FAdd 65 63
70: 6(float) FAdd 69 67 67: 23(ptr) AccessChain 9(color) 22
71: 23(ptr) AccessChain 9(color) 60 Store 67 66
Store 71 70 Branch 56
Branch 66 56: Label
72: Label Branch 15
73: 6(float) Load 27(d4) 72: Label
74: 23(ptr) AccessChain 9(color) 36 82: 23(ptr) AccessChain 9(color) 34
75: 6(float) Load 74 83: 6(float) Load 82
76: 6(float) FAdd 75 73 84: 6(float) Load 79(d13)
77: 23(ptr) AccessChain 9(color) 36 85: 29(bool) FOrdLessThan 83 84
Store 77 76 SelectionMerge 87 None
Branch 66 BranchConditional 85 86 91
66: Label 73: Label
Branch 13 135: 7(fvec4) Load 9(color)
14: Label 136: 7(fvec4) CompositeConstruct 47 47 47 47
Branch 78 137: 7(fvec4) FAdd 135 136
78: Label Store 9(color) 137
82: 23(ptr) AccessChain 9(color) 81 140: 7(fvec4) Load 9(color)
83: 6(float) Load 82 Store 139(gl_FragColor) 140
85: 6(float) Load 84(d13) Return
86: 17(bool) FOrdLessThan 83 85 74: Label
LoopMerge 79 78 None Branch 75
BranchConditional 86 80 79 75: Label
80: Label 77: 23(ptr) AccessChain 9(color) 76
87: 23(ptr) AccessChain 9(color) 22 78: 6(float) Load 77
88: 6(float) Load 87 80: 6(float) Load 79(d13)
89: 6(float) Load 84(d13) 81: 29(bool) FOrdLessThan 78 80
90: 17(bool) FOrdLessThan 88 89 LoopMerge 73 74 None
SelectionMerge 92 None BranchConditional 81 72 73
BranchConditional 90 91 96 86: Label
91: Label 88: 7(fvec4) Load 9(color)
93: 7(fvec4) Load 9(color) 89: 7(fvec4) CompositeConstruct 47 47 47 47
94: 7(fvec4) CompositeConstruct 56 56 56 56 90: 7(fvec4) FAdd 88 89
95: 7(fvec4) FAdd 93 94 Store 9(color) 90
Store 9(color) 95 Branch 87
Branch 92 91: Label
96: Label 92: 7(fvec4) Load 9(color)
97: 7(fvec4) Load 9(color) 93: 7(fvec4) CompositeConstruct 47 47 47 47
98: 7(fvec4) CompositeConstruct 56 56 56 56 94: 7(fvec4) FSub 92 93
99: 7(fvec4) FSub 97 98 Store 9(color) 94
Store 9(color) 99 Branch 87
Branch 92 87: Label
92: Label 95: 7(fvec4) Load 17(bigColor4)
100: 7(fvec4) Load 32(bigColor4) 96: 7(fvec4) Load 9(color)
101: 7(fvec4) Load 9(color) 97: 7(fvec4) FAdd 96 95
102: 7(fvec4) FAdd 101 100 Store 9(color) 97
Store 9(color) 102 98: 23(ptr) AccessChain 9(color) 22
103: 23(ptr) AccessChain 9(color) 36 99: 6(float) Load 98
104: 6(float) Load 103 100: 6(float) Load 27(d4)
105: 6(float) Load 27(d4) 101: 29(bool) FOrdLessThan 99 100
106: 17(bool) FOrdLessThan 104 105 SelectionMerge 103 None
SelectionMerge 108 None BranchConditional 101 102 103
BranchConditional 106 107 108 102: Label
107: Label 104: 23(ptr) AccessChain 9(color) 34
109: 23(ptr) AccessChain 9(color) 22 105: 6(float) Load 104
110: 6(float) Load 109 106: 6(float) FAdd 105 33
111: 6(float) FAdd 110 43 107: 23(ptr) AccessChain 9(color) 34
112: 23(ptr) AccessChain 9(color) 22 Store 107 106
Store 112 111 108: 23(ptr) AccessChain 9(color) 34
113: 23(ptr) AccessChain 9(color) 22 109: 6(float) Load 108
114: 6(float) Load 113 110: 6(float) Load 27(d4)
115: 6(float) Load 27(d4) 111: 29(bool) FOrdLessThan 109 110
116: 17(bool) FOrdLessThan 114 115 SelectionMerge 113 None
SelectionMerge 118 None BranchConditional 111 112 113
BranchConditional 116 117 118 112: Label
117: Label 114: 23(ptr) AccessChain 9(color) 22
119: 23(ptr) AccessChain 9(color) 36 115: 6(float) Load 114
120: 6(float) Load 119 116: 6(float) FAdd 115 47
121: 6(float) FAdd 120 56 Store 114 116
Store 119 121 Branch 74
Branch 78 113: Label
118: Label Branch 103
Branch 108 103: Label
108: Label 118: 23(ptr) AccessChain 9(color) 50
123: 23(ptr) AccessChain 9(color) 60 119: 6(float) Load 118
124: 6(float) Load 123 120: 6(float) Load 27(d4)
125: 6(float) Load 27(d4) 121: 29(bool) FOrdLessThan 119 120
126: 17(bool) FOrdLessThan 124 125 SelectionMerge 123 None
SelectionMerge 128 None BranchConditional 121 122 129
BranchConditional 126 127 134 122: Label
127: Label 124: 6(float) Load 27(d4)
129: 6(float) Load 27(d4) 125: 23(ptr) AccessChain 9(color) 50
130: 23(ptr) AccessChain 9(color) 60 126: 6(float) Load 125
131: 6(float) Load 130 127: 6(float) FAdd 126 124
132: 6(float) FAdd 131 129 128: 23(ptr) AccessChain 9(color) 50
133: 23(ptr) AccessChain 9(color) 60 Store 128 127
Store 133 132 Branch 123
Branch 128 129: Label
134: Label 130: 6(float) Load 27(d4)
135: 6(float) Load 27(d4) 131: 23(ptr) AccessChain 9(color) 22
136: 23(ptr) AccessChain 9(color) 36 132: 6(float) Load 131
137: 6(float) Load 136 133: 6(float) FAdd 132 130
138: 6(float) FAdd 137 135 134: 23(ptr) AccessChain 9(color) 22
139: 23(ptr) AccessChain 9(color) 36 Store 134 133
Store 139 138 Branch 123
Branch 128 123: Label
128: Label Branch 74
Branch 78 FunctionEnd
79: Label
140: 7(fvec4) Load 9(color)
141: 7(fvec4) CompositeConstruct 56 56 56 56
142: 7(fvec4) FAdd 140 141
Store 9(color) 142
145: 7(fvec4) Load 9(color)
Store 144(gl_FragColor) 145
Return
FunctionEnd

View File

@ -1,400 +1,404 @@
spv.switch.frag spv.switch.frag
Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. Warning, version 310 is not yet complete; most version-specific features are present, but some are missing.
WARNING: 0:121: 'switch' : last case/default label not followed by statements WARNING: 0:121: 'switch' : last case/default label not followed by statements
WARNING: 0:134: 'switch' : last case/default label not followed by statements WARNING: 0:134: 'switch' : last case/default label not followed by statements
WARNING: 0:139: 'switch' : last case/default label not followed by statements WARNING: 0:139: 'switch' : last case/default label not followed by statements
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 263 // Id's are bound by 265
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 73 221 EntryPoint Fragment 4 "main" 73 223
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source ESSL 310 Source ESSL 310
Name 4 "main" Name 4 "main"
Name 15 "foo1(vf4;vf4;i1;" Name 15 "foo1(vf4;vf4;i1;"
Name 12 "v1" Name 12 "v1"
Name 13 "v2" Name 13 "v2"
Name 14 "i1" Name 14 "i1"
Name 20 "foo2(vf4;vf4;i1;" Name 20 "foo2(vf4;vf4;i1;"
Name 17 "v1" Name 17 "v1"
Name 18 "v2" Name 18 "v2"
Name 19 "i1" Name 19 "i1"
Name 58 "local" Name 58 "local"
Name 60 "c" Name 60 "c"
Name 71 "f" Name 71 "f"
Name 73 "x" Name 73 "x"
Name 127 "d" Name 127 "d"
Name 153 "i" Name 153 "i"
Name 171 "j" Name 172 "j"
Name 221 "color" Name 223 "color"
Name 227 "v" Name 229 "v"
Name 228 "param" Name 230 "param"
Name 230 "param" Name 232 "param"
Name 232 "param" Name 234 "param"
Name 240 "param" Name 242 "param"
Name 242 "param" Name 244 "param"
Name 244 "param" Name 246 "param"
Decorate 58(local) RelaxedPrecision Decorate 58(local) RelaxedPrecision
Decorate 60(c) RelaxedPrecision Decorate 60(c) RelaxedPrecision
Decorate 71(f) RelaxedPrecision Decorate 71(f) RelaxedPrecision
Decorate 73(x) RelaxedPrecision Decorate 73(x) RelaxedPrecision
Decorate 127(d) RelaxedPrecision Decorate 127(d) RelaxedPrecision
Decorate 153(i) RelaxedPrecision Decorate 153(i) RelaxedPrecision
Decorate 171(j) RelaxedPrecision Decorate 172(j) RelaxedPrecision
Decorate 221(color) RelaxedPrecision Decorate 223(color) RelaxedPrecision
Decorate 227(v) RelaxedPrecision Decorate 229(v) RelaxedPrecision
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)
9: TypeInt 32 1 9: TypeInt 32 1
10: TypePointer Function 9(int) 10: TypePointer Function 9(int)
11: TypeFunction 7(fvec4) 8(ptr) 8(ptr) 10(ptr) 11: TypeFunction 7(fvec4) 8(ptr) 8(ptr) 10(ptr)
36: 6(float) Constant 0 36: 6(float) Constant 0
37: 7(fvec4) ConstantComposite 36 36 36 36 37: 7(fvec4) ConstantComposite 36 36 36 36
47: 6(float) Constant 1065353216 47: 6(float) Constant 1065353216
48: 7(fvec4) ConstantComposite 47 47 47 47 48: 7(fvec4) ConstantComposite 47 47 47 47
59: TypePointer UniformConstant 9(int) 59: TypePointer UniformConstant 9(int)
60(c): 59(ptr) Variable UniformConstant 60(c): 59(ptr) Variable UniformConstant
63: 9(int) Constant 1 63: 9(int) Constant 1
70: TypePointer Function 6(float) 70: TypePointer Function 6(float)
72: TypePointer Input 6(float) 72: TypePointer Input 6(float)
73(x): 72(ptr) Variable Input 73(x): 72(ptr) Variable Input
127(d): 59(ptr) Variable UniformConstant 127(d): 59(ptr) Variable UniformConstant
154: 9(int) Constant 0 154: 9(int) Constant 0
159: 9(int) Constant 10 160: 9(int) Constant 10
160: TypeBool 161: TypeBool
172: 9(int) Constant 20 173: 9(int) Constant 20
177: 9(int) Constant 30 179: 9(int) Constant 30
182: 6(float) Constant 1120429670 184: 6(float) Constant 1120429670
202: 6(float) Constant 1079739679 204: 6(float) Constant 1079739679
220: TypePointer Output 6(float) 222: TypePointer Output 6(float)
221(color): 220(ptr) Variable Output 223(color): 222(ptr) Variable Output
226: TypePointer UniformConstant 7(fvec4) 228: TypePointer UniformConstant 7(fvec4)
227(v): 226(ptr) Variable UniformConstant 229(v): 228(ptr) Variable UniformConstant
235: TypeInt 32 0 237: TypeInt 32 0
236: 235(int) Constant 1 238: 237(int) Constant 1
247: 235(int) Constant 2 249: 237(int) Constant 2
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
58(local): 10(ptr) Variable Function 58(local): 10(ptr) Variable Function
71(f): 70(ptr) Variable Function 71(f): 70(ptr) Variable Function
153(i): 10(ptr) Variable Function 153(i): 10(ptr) Variable Function
171(j): 10(ptr) Variable Function 172(j): 10(ptr) Variable Function
228(param): 8(ptr) Variable Function 230(param): 8(ptr) Variable Function
230(param): 8(ptr) Variable Function 232(param): 8(ptr) Variable Function
232(param): 10(ptr) Variable Function 234(param): 10(ptr) Variable Function
240(param): 8(ptr) Variable Function 242(param): 8(ptr) Variable Function
242(param): 8(ptr) Variable Function 244(param): 8(ptr) Variable Function
244(param): 10(ptr) Variable Function 246(param): 10(ptr) Variable Function
61: 9(int) Load 60(c) 61: 9(int) Load 60(c)
Store 58(local) 61 Store 58(local) 61
62: 9(int) Load 58(local) 62: 9(int) Load 58(local)
64: 9(int) IAdd 62 63 64: 9(int) IAdd 62 63
Store 58(local) 64 Store 58(local) 64
65: 9(int) Load 60(c) 65: 9(int) Load 60(c)
SelectionMerge 69 None SelectionMerge 69 None
Switch 65 68 Switch 65 68
case 1: 66 case 1: 66
case 2: 67 case 2: 67
66: Label 66: Label
74: 6(float) Load 73(x) 74: 6(float) Load 73(x)
75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74 75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74
Store 71(f) 75 Store 71(f) 75
Branch 69 Branch 69
67: Label 67: Label
77: 6(float) Load 73(x) 77: 6(float) Load 73(x)
78: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 77 78: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 77
Store 71(f) 78 Store 71(f) 78
Branch 69 Branch 69
68: Label 68: Label
80: 6(float) Load 73(x) 80: 6(float) Load 73(x)
81: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 80 81: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 80
Store 71(f) 81 Store 71(f) 81
Branch 69 Branch 69
69: Label 69: Label
83: 9(int) Load 60(c) 83: 9(int) Load 60(c)
SelectionMerge 87 None SelectionMerge 87 None
Switch 83 86 Switch 83 86
case 1: 84 case 1: 84
case 2: 85 case 2: 85
84: Label 84: Label
88: 6(float) Load 73(x) 88: 6(float) Load 73(x)
89: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 88 89: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 88
90: 6(float) Load 71(f) 90: 6(float) Load 71(f)
91: 6(float) FAdd 90 89 91: 6(float) FAdd 90 89
Store 71(f) 91 Store 71(f) 91
Branch 85 Branch 85
85: Label 85: Label
92: 6(float) Load 73(x) 92: 6(float) Load 73(x)
93: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 92 93: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 92
94: 6(float) Load 71(f) 94: 6(float) Load 71(f)
95: 6(float) FAdd 94 93 95: 6(float) FAdd 94 93
Store 71(f) 95 Store 71(f) 95
Branch 87 Branch 87
86: Label 86: Label
97: 6(float) Load 73(x) 97: 6(float) Load 73(x)
98: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 97 98: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 97
99: 6(float) Load 71(f) 99: 6(float) Load 71(f)
100: 6(float) FAdd 99 98 100: 6(float) FAdd 99 98
Store 71(f) 100 Store 71(f) 100
Branch 87 Branch 87
87: Label 87: Label
102: 9(int) Load 60(c) 102: 9(int) Load 60(c)
SelectionMerge 105 None SelectionMerge 105 None
Switch 102 105 Switch 102 105
case 1: 103 case 1: 103
case 2: 104 case 2: 104
103: Label 103: Label
106: 6(float) Load 73(x) 106: 6(float) Load 73(x)
107: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 106 107: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 106
108: 6(float) Load 71(f) 108: 6(float) Load 71(f)
109: 6(float) FAdd 108 107 109: 6(float) FAdd 108 107
Store 71(f) 109 Store 71(f) 109
Branch 105 Branch 105
104: Label 104: Label
111: 6(float) Load 73(x) 111: 6(float) Load 73(x)
112: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 111 112: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 111
113: 6(float) Load 71(f) 113: 6(float) Load 71(f)
114: 6(float) FAdd 113 112 114: 6(float) FAdd 113 112
Store 71(f) 114 Store 71(f) 114
Branch 105 Branch 105
105: Label 105: Label
117: 9(int) Load 60(c) 117: 9(int) Load 60(c)
SelectionMerge 121 None SelectionMerge 121 None
Switch 117 120 Switch 117 120
case 1: 118 case 1: 118
case 2: 119 case 2: 119
118: Label 118: Label
122: 6(float) Load 73(x) 122: 6(float) Load 73(x)
123: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 122 123: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 122
124: 6(float) Load 71(f) 124: 6(float) Load 71(f)
125: 6(float) FAdd 124 123 125: 6(float) FAdd 124 123
Store 71(f) 125 Store 71(f) 125
Branch 121 Branch 121
119: Label 119: Label
128: 9(int) Load 127(d) 128: 9(int) Load 127(d)
SelectionMerge 131 None SelectionMerge 131 None
Switch 128 131 Switch 128 131
case 1: 129 case 1: 129
case 2: 130 case 2: 130
129: Label 129: Label
132: 6(float) Load 73(x) 132: 6(float) Load 73(x)
133: 6(float) Load 73(x) 133: 6(float) Load 73(x)
134: 6(float) FMul 132 133 134: 6(float) FMul 132 133
135: 6(float) Load 73(x) 135: 6(float) Load 73(x)
136: 6(float) FMul 134 135 136: 6(float) FMul 134 135
137: 6(float) Load 71(f) 137: 6(float) Load 71(f)
138: 6(float) FAdd 137 136 138: 6(float) FAdd 137 136
Store 71(f) 138 Store 71(f) 138
Branch 131 Branch 131
130: Label 130: Label
140: 6(float) Load 73(x) 140: 6(float) Load 73(x)
141: 6(float) Load 73(x) 141: 6(float) Load 73(x)
142: 6(float) FMul 140 141 142: 6(float) FMul 140 141
143: 6(float) Load 71(f) 143: 6(float) Load 71(f)
144: 6(float) FAdd 143 142 144: 6(float) FAdd 143 142
Store 71(f) 144 Store 71(f) 144
Branch 131 Branch 131
131: Label 131: Label
Branch 121 Branch 121
120: Label 120: Label
148: 6(float) Load 73(x) 148: 6(float) Load 73(x)
149: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 148 149: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 148
150: 6(float) Load 71(f) 150: 6(float) Load 71(f)
151: 6(float) FAdd 150 149 151: 6(float) FAdd 150 149
Store 71(f) 151 Store 71(f) 151
Branch 121 Branch 121
121: Label 121: Label
Store 153(i) 154 Store 153(i) 154
Branch 155 Branch 158
155: Label 155: Label
158: 9(int) Load 153(i) 163: 9(int) Load 60(c)
161: 160(bool) SLessThan 158 159 SelectionMerge 167 None
LoopMerge 156 155 None Switch 163 166
BranchConditional 161 157 156 case 1: 164
157: Label case 2: 165
162: 9(int) Load 60(c) 156: Label
SelectionMerge 166 None 211: 9(int) Load 60(c)
Switch 162 165 SelectionMerge 214 None
case 1: 163 Switch 211 214
case 2: 164 case 1: 212
163: Label case 2: 213
167: 6(float) Load 73(x) 157: Label
168: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 167 209: 9(int) Load 153(i)
169: 6(float) Load 71(f) 210: 9(int) IAdd 209 63
170: 6(float) FAdd 169 168 Store 153(i) 210
Store 71(f) 170 Branch 158
Store 171(j) 172 158: Label
Branch 173 159: 9(int) Load 153(i)
173: Label 162: 161(bool) SLessThan 159 160
176: 9(int) Load 171(j) LoopMerge 156 157 None
178: 160(bool) SLessThan 176 177 BranchConditional 162 155 156
LoopMerge 174 173 None 164: Label
BranchConditional 178 175 174 168: 6(float) Load 73(x)
175: Label 169: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 168
179: 6(float) Load 71(f) 170: 6(float) Load 71(f)
180: 6(float) FAdd 179 47 171: 6(float) FAdd 170 169
Store 71(f) 180 Store 71(f) 171
181: 6(float) Load 71(f) Store 172(j) 173
183: 160(bool) FOrdLessThan 181 182 Branch 177
SelectionMerge 185 None 174: Label
BranchConditional 183 184 185 181: 6(float) Load 71(f)
184: Label 182: 6(float) FAdd 181 47
Branch 174 Store 71(f) 182
185: Label 183: 6(float) Load 71(f)
187: 9(int) Load 171(j) 185: 161(bool) FOrdLessThan 183 184
188: 9(int) IAdd 187 63 SelectionMerge 187 None
Store 171(j) 188 BranchConditional 185 186 187
Branch 173 175: Label
174: Label Branch 167
Branch 166 176: Label
164: Label 189: 9(int) Load 172(j)
190: 6(float) Load 73(x) 190: 9(int) IAdd 189 63
191: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 190 Store 172(j) 190
192: 6(float) Load 71(f) Branch 177
193: 6(float) FAdd 192 191 177: Label
Store 71(f) 193 178: 9(int) Load 172(j)
Branch 166 180: 161(bool) SLessThan 178 179
165: Label LoopMerge 175 176 None
196: 6(float) Load 73(x) BranchConditional 180 174 175
197: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 196 186: Label
198: 6(float) Load 71(f) Branch 175
199: 6(float) FAdd 198 197 187: Label
Store 71(f) 199 Branch 176
Branch 166 165: Label
166: Label 192: 6(float) Load 73(x)
201: 6(float) Load 71(f) 193: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 192
203: 160(bool) FOrdLessThan 201 202 194: 6(float) Load 71(f)
SelectionMerge 205 None 195: 6(float) FAdd 194 193
BranchConditional 203 204 205 Store 71(f) 195
204: Label Branch 167
Branch 156 166: Label
205: Label 198: 6(float) Load 73(x)
207: 9(int) Load 153(i) 199: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 198
208: 9(int) IAdd 207 63 200: 6(float) Load 71(f)
Store 153(i) 208 201: 6(float) FAdd 200 199
Branch 155 Store 71(f) 201
156: Label Branch 167
209: 9(int) Load 60(c) 167: Label
SelectionMerge 212 None 203: 6(float) Load 71(f)
Switch 209 212 205: 161(bool) FOrdLessThan 203 204
case 1: 210 SelectionMerge 207 None
case 2: 211 BranchConditional 205 206 207
210: Label 206: Label
213: 6(float) Load 73(x) Branch 156
214: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 213 207: Label
215: 6(float) Load 71(f) Branch 157
216: 6(float) FAdd 215 214 212: Label
Store 71(f) 216 215: 6(float) Load 73(x)
Branch 212 216: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 215
211: Label 217: 6(float) Load 71(f)
Branch 212 218: 6(float) FAdd 217 216
212: Label Store 71(f) 218
222: 6(float) Load 71(f) Branch 214
223: 9(int) Load 58(local) 213: Label
224: 6(float) ConvertSToF 223 Branch 214
225: 6(float) FAdd 222 224 214: Label
Store 221(color) 225 224: 6(float) Load 71(f)
229: 7(fvec4) Load 227(v) 225: 9(int) Load 58(local)
Store 228(param) 229 226: 6(float) ConvertSToF 225
231: 7(fvec4) Load 227(v) 227: 6(float) FAdd 224 226
Store 230(param) 231 Store 223(color) 227
233: 9(int) Load 60(c) 231: 7(fvec4) Load 229(v)
Store 232(param) 233 Store 230(param) 231
234: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 228(param) 230(param) 232(param) 233: 7(fvec4) Load 229(v)
237: 6(float) CompositeExtract 234 1 Store 232(param) 233
238: 6(float) Load 221(color) 235: 9(int) Load 60(c)
239: 6(float) FAdd 238 237 Store 234(param) 235
Store 221(color) 239 236: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 230(param) 232(param) 234(param)
241: 7(fvec4) Load 227(v) 239: 6(float) CompositeExtract 236 1
Store 240(param) 241 240: 6(float) Load 223(color)
243: 7(fvec4) Load 227(v) 241: 6(float) FAdd 240 239
Store 242(param) 243 Store 223(color) 241
245: 9(int) Load 60(c) 243: 7(fvec4) Load 229(v)
Store 244(param) 245 Store 242(param) 243
246: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 240(param) 242(param) 244(param) 245: 7(fvec4) Load 229(v)
248: 6(float) CompositeExtract 246 2 Store 244(param) 245
249: 6(float) Load 221(color) 247: 9(int) Load 60(c)
250: 6(float) FAdd 249 248 Store 246(param) 247
Store 221(color) 250 248: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 242(param) 244(param) 246(param)
251: 9(int) Load 60(c) 250: 6(float) CompositeExtract 248 2
SelectionMerge 254 None 251: 6(float) Load 223(color)
Switch 251 253 252: 6(float) FAdd 251 250
case 0: 252 Store 223(color) 252
252: Label 253: 9(int) Load 60(c)
Branch 254 SelectionMerge 256 None
253: Label Switch 253 255
Branch 254 case 0: 254
254: Label 254: Label
258: 9(int) Load 60(c) Branch 256
SelectionMerge 260 None 255: Label
Switch 258 259 Branch 256
259: Label 256: Label
Branch 260 260: 9(int) Load 60(c)
260: Label SelectionMerge 262 None
Return Switch 260 261
FunctionEnd 261: Label
15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 Branch 262
12(v1): 8(ptr) FunctionParameter 262: Label
13(v2): 8(ptr) FunctionParameter Return
14(i1): 10(ptr) FunctionParameter FunctionEnd
16: Label 15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11
22: 9(int) Load 14(i1) 12(v1): 8(ptr) FunctionParameter
SelectionMerge 26 None 13(v2): 8(ptr) FunctionParameter
Switch 22 26 14(i1): 10(ptr) FunctionParameter
case 0: 23 16: Label
case 2: 24 22: 9(int) Load 14(i1)
case 1: 24 SelectionMerge 26 None
case 3: 25 Switch 22 26
23: Label case 0: 23
27: 7(fvec4) Load 12(v1) case 2: 24
ReturnValue 27 case 1: 24
24: Label case 3: 25
29: 7(fvec4) Load 13(v2) 23: Label
ReturnValue 29 27: 7(fvec4) Load 12(v1)
25: Label ReturnValue 27
31: 7(fvec4) Load 12(v1) 24: Label
32: 7(fvec4) Load 13(v2) 29: 7(fvec4) Load 13(v2)
33: 7(fvec4) FMul 31 32 ReturnValue 29
ReturnValue 33 25: Label
26: Label 31: 7(fvec4) Load 12(v1)
ReturnValue 37 32: 7(fvec4) Load 13(v2)
FunctionEnd 33: 7(fvec4) FMul 31 32
20(foo2(vf4;vf4;i1;): 7(fvec4) Function None 11 ReturnValue 33
17(v1): 8(ptr) FunctionParameter 26: Label
18(v2): 8(ptr) FunctionParameter ReturnValue 37
19(i1): 10(ptr) FunctionParameter FunctionEnd
21: Label 20(foo2(vf4;vf4;i1;): 7(fvec4) Function None 11
39: 9(int) Load 19(i1) 17(v1): 8(ptr) FunctionParameter
SelectionMerge 44 None 18(v2): 8(ptr) FunctionParameter
Switch 39 44 19(i1): 10(ptr) FunctionParameter
case 0: 40 21: Label
case 2: 41 39: 9(int) Load 19(i1)
case 1: 42 SelectionMerge 44 None
case 3: 43 Switch 39 44
40: Label case 0: 40
45: 7(fvec4) Load 17(v1) case 2: 41
ReturnValue 45 case 1: 42
41: Label case 3: 43
ReturnValue 48 40: Label
42: Label 45: 7(fvec4) Load 17(v1)
50: 7(fvec4) Load 18(v2) ReturnValue 45
ReturnValue 50 41: Label
43: Label ReturnValue 48
52: 7(fvec4) Load 17(v1) 42: Label
53: 7(fvec4) Load 18(v2) 50: 7(fvec4) Load 18(v2)
54: 7(fvec4) FMul 52 53 ReturnValue 50
ReturnValue 54 43: Label
44: Label 52: 7(fvec4) Load 17(v1)
ReturnValue 37 53: 7(fvec4) Load 18(v2)
FunctionEnd 54: 7(fvec4) FMul 52 53
ReturnValue 54
44: Label
ReturnValue 37
FunctionEnd

View File

@ -1,86 +1,88 @@
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

View File

@ -1,49 +1,51 @@
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

View File

@ -1,62 +1,64 @@
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

View File

@ -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