Commit f4984009 by John Kessenich

Merge pull request #33 from google/spv-builder-loop-ctor-inits-all-members

spv::Builder::Loop constructor inits all members.
parents 8ba301c7 3e6a33ce
...@@ -1738,19 +1738,8 @@ void Builder::endSwitch(std::vector<Block*>& /*segmentBlock*/) ...@@ -1738,19 +1738,8 @@ void Builder::endSwitch(std::vector<Block*>& /*segmentBlock*/)
// Comments in header // Comments in header
void Builder::makeNewLoop(bool loopTestFirst) void Builder::makeNewLoop(bool loopTestFirst)
{ {
loops.push(Loop()); loops.push(Loop(*this, loopTestFirst));
Loop& loop = loops.top(); const Loop& loop = loops.top();
loop.function = &getBuildPoint()->getParent();
loop.header = new Block(getUniqueId(), *loop.function);
loop.merge = new Block(getUniqueId(), *loop.function);
// Delaying creation of the loop body perturbs test results less,
// which makes for easier patch review.
// TODO(dneto): Create the loop body block here, instead of
// upon first use.
loop.body = 0;
loop.testFirst = loopTestFirst;
loop.isFirstIteration = 0;
// The loop test is always emitted before the loop body. // The loop test is always emitted before the loop body.
// But if the loop test executes at the bottom of the loop, then // But if the loop test executes at the bottom of the loop, then
...@@ -1771,8 +1760,6 @@ void Builder::makeNewLoop(bool loopTestFirst) ...@@ -1771,8 +1760,6 @@ void Builder::makeNewLoop(bool loopTestFirst)
// Generate code to defer the loop test until the second and // Generate code to defer the loop test until the second and
// subsequent iterations. // subsequent iterations.
// A phi node determines whether we're on the first iteration.
loop.isFirstIteration = new Instruction(getUniqueId(), makeBoolType(), OpPhi);
// It's always the first iteration when coming from the preheader. // It's always the first iteration when coming from the preheader.
// All other branches to this loop header will need to indicate "false", // All other branches to this loop header will need to indicate "false",
// but we don't yet know where they will come from. // but we don't yet know where they will come from.
...@@ -1792,7 +1779,6 @@ void Builder::makeNewLoop(bool loopTestFirst) ...@@ -1792,7 +1779,6 @@ void Builder::makeNewLoop(bool loopTestFirst)
loop.function->addBlock(firstIterationCheck); loop.function->addBlock(firstIterationCheck);
setBuildPoint(firstIterationCheck); setBuildPoint(firstIterationCheck);
loop.body = new Block(getUniqueId(), *loop.function);
// Control flow after this "if" normally reconverges at the loop body. // Control flow after this "if" normally reconverges at the loop body.
// However, the loop test has a "break branch" out of this selection // However, the loop test has a "break branch" out of this selection
// construct because it can transfer control to the loop merge block. // construct because it can transfer control to the loop merge block.
...@@ -1808,14 +1794,13 @@ void Builder::makeNewLoop(bool loopTestFirst) ...@@ -1808,14 +1794,13 @@ void Builder::makeNewLoop(bool loopTestFirst)
void Builder::createLoopTestBranch(Id condition) void Builder::createLoopTestBranch(Id condition)
{ {
Loop& loop = loops.top(); const Loop& loop = loops.top();
// Generate the merge instruction. If the loop test executes before // Generate the merge instruction. If the loop test executes before
// the body, then this is a loop merge. Otherwise the loop merge // the body, then this is a loop merge. Otherwise the loop merge
// has already been generated and this is a conditional merge. // has already been generated and this is a conditional merge.
if (loop.testFirst) { if (loop.testFirst) {
createMerge(OpLoopMerge, loop.merge, LoopControlMaskNone); createMerge(OpLoopMerge, loop.merge, LoopControlMaskNone);
loop.body = new Block(getUniqueId(), *loop.function);
// Branching to the "body" block will keep control inside // Branching to the "body" block will keep control inside
// the loop. // the loop.
createConditionalBranch(condition, loop.body, loop.merge); createConditionalBranch(condition, loop.body, loop.merge);
...@@ -1842,7 +1827,7 @@ void Builder::createLoopTestBranch(Id condition) ...@@ -1842,7 +1827,7 @@ void Builder::createLoopTestBranch(Id condition)
void Builder::createBranchToBody() void Builder::createBranchToBody()
{ {
Loop& loop = loops.top(); const Loop& loop = loops.top();
assert(loop.body); assert(loop.body);
// This is a reconvergence of control flow, so no merge instruction // This is a reconvergence of control flow, so no merge instruction
...@@ -1870,7 +1855,7 @@ void Builder::createLoopExit() ...@@ -1870,7 +1855,7 @@ void Builder::createLoopExit()
// Close the innermost loop // Close the innermost loop
void Builder::closeLoop() void Builder::closeLoop()
{ {
Loop& loop = loops.top(); const Loop& loop = loops.top();
// Branch back to the top // Branch back to the top
createBranchToLoopHeaderFromInside(loop); createBranchToLoopHeaderFromInside(loop);
...@@ -2198,4 +2183,15 @@ void ValidationError(const char* error) ...@@ -2198,4 +2183,15 @@ void ValidationError(const char* error)
printf("Validation Error: %s\n", error); printf("Validation Error: %s\n", error);
} }
Builder::Loop::Loop(Builder& builder, bool testFirstArg)
: function(&builder.getBuildPoint()->getParent()),
header(new Block(builder.getUniqueId(), *function)),
merge(new Block(builder.getUniqueId(), *function)),
body(new Block(builder.getUniqueId(), *function)),
testFirst(testFirstArg),
isFirstIteration(testFirst
? nullptr
: new Instruction(builder.getUniqueId(), builder.makeBoolType(), OpPhi))
{}
}; // end spv namespace }; // end spv namespace
...@@ -524,7 +524,18 @@ protected: ...@@ -524,7 +524,18 @@ protected:
// Data that needs to be kept in order to properly handle loops. // Data that needs to be kept in order to properly handle loops.
struct Loop { struct Loop {
Loop() : header(nullptr), merge(nullptr), body(nullptr), testFirst(false), isFirstIteration(nullptr), function(nullptr) { } // Constructs a default Loop structure containing new header, merge, and
// body blocks for the current function.
// The testFirst argument indicates whether the loop test executes at
// the top of the loop rather than at the bottom. In the latter case,
// also create a phi instruction whose value indicates whether we're on
// the first iteration of the loop. The phi instruction is initialized
// with no values or predecessor operands.
Loop(Builder& builder, bool testFirst);
Loop(const Loop&) = default;
// The function containing the loop.
Function* const function;
// The header is the first block generated for the loop. // The header is the first block generated for the loop.
// It dominates all the blocks in the loop, i.e. it is always // It dominates all the blocks in the loop, i.e. it is always
// executed before any others. // executed before any others.
...@@ -532,24 +543,22 @@ protected: ...@@ -532,24 +543,22 @@ protected:
// "for" loops), then the header begins with the test code. // "for" loops), then the header begins with the test code.
// Otherwise, the loop is a "do-while" loop and the header contains the // Otherwise, the loop is a "do-while" loop and the header contains the
// start of the body of the loop (if the body exists). // start of the body of the loop (if the body exists).
Block* header; Block* const header;
// The merge block marks the end of the loop. Control is transferred // The merge block marks the end of the loop. Control is transferred
// to the merge block when either the loop test fails, or when a // to the merge block when either the loop test fails, or when a
// nested "break" is encountered. // nested "break" is encountered.
Block* merge; Block* const merge;
// The body block is the first basic block in the body of the loop, i.e. // The body block is the first basic block in the body of the loop, i.e.
// the code that is to be repeatedly executed, aside from loop control. // the code that is to be repeatedly executed, aside from loop control.
// This member is null until we generate code that references the loop // This member is null until we generate code that references the loop
// body block. // body block.
Block* body; Block* const body;
// True when the loop test executes before the body. // True when the loop test executes before the body.
bool testFirst; const bool testFirst;
// When the test executes after the body, this is defined as the phi // When the test executes after the body, this is defined as the phi
// instruction that tells us whether we are on the first iteration of // instruction that tells us whether we are on the first iteration of
// the loop. Otherwise this is null. // the loop. Otherwise this is null.
Instruction* isFirstIteration; Instruction* const isFirstIteration;
// The function containing the loop.
Function* function;
}; };
// Our loop stack. // Our loop stack.
......
...@@ -29,8 +29,8 @@ Linked vertex stage: ...@@ -29,8 +29,8 @@ Linked vertex stage:
7: TypeInt 32 1 7: TypeInt 32 1
8: TypePointer Function 7(int) 8: TypePointer Function 7(int)
10: 7(int) Constant 1 10: 7(int) Constant 1
14: 7(int) Constant 5 15: 7(int) Constant 5
15: TypeBool 16: TypeBool
18: TypeFloat 32 18: TypeFloat 32
19: TypeVector 18(float) 4 19: TypeVector 18(float) 4
20: TypeInt 32 0 20: TypeInt 32 0
...@@ -51,11 +51,11 @@ Linked vertex stage: ...@@ -51,11 +51,11 @@ Linked vertex stage:
Store 9(i) 10 Store 9(i) 10
Branch 11 Branch 11
11: Label 11: Label
13: 7(int) Load 9(i) 14: 7(int) Load 9(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 12 None LoopMerge 12 None
BranchConditional 16 17 12 BranchConditional 17 13 12
17: Label 13: Label
25: 7(int) Load 9(i) 25: 7(int) Load 9(i)
28: 19(fvec4) Load 27(color) 28: 19(fvec4) Load 27(color)
30: 29(ptr) AccessChain 24(colorOut) 25 30: 29(ptr) AccessChain 24(colorOut) 25
......
...@@ -27,11 +27,11 @@ Linked vertex stage: ...@@ -27,11 +27,11 @@ Linked vertex stage:
7: TypeInt 32 1 7: TypeInt 32 1
8: TypePointer Function 7(int) 8: TypePointer Function 7(int)
10: 7(int) Constant 0 10: 7(int) Constant 0
14: TypeBool 15: TypeBool
15: 14(bool) ConstantTrue 16: 15(bool) ConstantTrue
20: 7(int) Constant 10 20: 7(int) Constant 10
24: 7(int) Constant 1 24: 7(int) Constant 1
26: 14(bool) ConstantFalse 26: 15(bool) ConstantFalse
27: TypePointer Input 7(int) 27: TypePointer Input 7(int)
28(gl_VertexID): 27(ptr) Variable Input 28(gl_VertexID): 27(ptr) Variable Input
29(gl_InstanceID): 27(ptr) Variable Input 29(gl_InstanceID): 27(ptr) Variable Input
...@@ -41,20 +41,20 @@ Linked vertex stage: ...@@ -41,20 +41,20 @@ Linked vertex stage:
Store 9(i) 10 Store 9(i) 10
Branch 11 Branch 11
11: Label 11: Label
13: 14(bool) Phi 15 5 26 17 14: 15(bool) Phi 16 5 26 13
LoopMerge 12 None LoopMerge 12 None
Branch 16 Branch 17
16: Label 17: Label
SelectionMerge 17 None SelectionMerge 13 None
BranchConditional 13 17 18 BranchConditional 14 13 18
18: Label 18: Label
19: 7(int) Load 9(i) 19: 7(int) Load 9(i)
21: 14(bool) SLessThan 19 20 21: 15(bool) SLessThan 19 20
SelectionMerge 22 None SelectionMerge 22 None
BranchConditional 21 22 12 BranchConditional 21 22 12
22: Label 22: Label
Branch 17 Branch 13
17: Label 13: Label
23: 7(int) Load 9(i) 23: 7(int) Load 9(i)
25: 7(int) IAdd 23 24 25: 7(int) IAdd 23 24
Store 9(i) 25 Store 9(i) 25
......
...@@ -41,12 +41,12 @@ Linked vertex stage: ...@@ -41,12 +41,12 @@ Linked vertex stage:
7: TypeInt 32 1 7: TypeInt 32 1
8: TypePointer Function 7(int) 8: TypePointer Function 7(int)
10: 7(int) Constant 0 10: 7(int) Constant 0
14: TypeBool 15: TypeBool
15: 14(bool) ConstantTrue 16: 15(bool) ConstantTrue
20: 7(int) Constant 1 20: 7(int) Constant 1
22: 7(int) Constant 19 22: 7(int) Constant 19
27: 7(int) Constant 2 27: 7(int) Constant 2
32: 14(bool) ConstantFalse 32: 15(bool) ConstantFalse
36: 7(int) Constant 5 36: 7(int) Constant 5
41: 7(int) Constant 3 41: 7(int) Constant 3
44: 7(int) Constant 42 44: 7(int) Constant 42
...@@ -68,25 +68,25 @@ Linked vertex stage: ...@@ -68,25 +68,25 @@ Linked vertex stage:
Store 9(i) 10 Store 9(i) 10
Branch 11 Branch 11
11: Label 11: Label
13: 14(bool) Phi 15 5 32 29 32 39 14: 15(bool) Phi 16 5 32 29 32 39
LoopMerge 12 None LoopMerge 12 None
Branch 16 Branch 17
16: Label 17: Label
SelectionMerge 17 None SelectionMerge 13 None
BranchConditional 13 17 18 BranchConditional 14 13 18
18: Label 18: Label
19: 7(int) Load 9(i) 19: 7(int) Load 9(i)
21: 7(int) IAdd 19 20 21: 7(int) IAdd 19 20
Store 9(i) 21 Store 9(i) 21
23: 14(bool) SLessThan 21 22 23: 15(bool) SLessThan 21 22
SelectionMerge 24 None SelectionMerge 24 None
BranchConditional 23 24 12 BranchConditional 23 24 12
24: Label 24: Label
Branch 17 Branch 13
17: Label 13: Label
Store 25(A) 10 Store 25(A) 10
26: 7(int) Load 9(i) 26: 7(int) Load 9(i)
28: 14(bool) IEqual 26 27 28: 15(bool) IEqual 26 27
SelectionMerge 30 None SelectionMerge 30 None
BranchConditional 28 29 30 BranchConditional 28 29 30
29: Label 29: Label
...@@ -97,7 +97,7 @@ Linked vertex stage: ...@@ -97,7 +97,7 @@ Linked vertex stage:
Branch 30 Branch 30
30: Label 30: Label
35: 7(int) Load 9(i) 35: 7(int) Load 9(i)
37: 14(bool) IEqual 35 36 37: 15(bool) IEqual 35 36
SelectionMerge 39 None SelectionMerge 39 None
BranchConditional 37 38 39 BranchConditional 37 38 39
38: Label 38: Label
......
...@@ -26,13 +26,13 @@ Linked fragment stage: ...@@ -26,13 +26,13 @@ Linked fragment stage:
9: TypePointer Function 8(fvec4) 9: TypePointer Function 8(fvec4)
11: TypePointer Input 8(fvec4) 11: TypePointer Input 8(fvec4)
12(BaseColor): 11(ptr) Variable Input 12(BaseColor): 11(ptr) Variable Input
17: TypeBool 18: TypeBool
18: 17(bool) ConstantTrue 19: 18(bool) ConstantTrue
24: TypePointer UniformConstant 7(float) 24: TypePointer UniformConstant 7(float)
25(d): 24(ptr) Variable UniformConstant 25(d): 24(ptr) Variable UniformConstant
29: TypePointer UniformConstant 8(fvec4) 29: TypePointer UniformConstant 8(fvec4)
30(bigColor): 29(ptr) Variable UniformConstant 30(bigColor): 29(ptr) Variable UniformConstant
34: 17(bool) ConstantFalse 34: 18(bool) ConstantFalse
35: TypePointer Output 8(fvec4) 35: TypePointer Output 8(fvec4)
36(gl_FragColor): 35(ptr) Variable Output 36(gl_FragColor): 35(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
...@@ -42,22 +42,22 @@ Linked fragment stage: ...@@ -42,22 +42,22 @@ Linked fragment stage:
Store 10(color) 13 Store 10(color) 13
Branch 14 Branch 14
14: Label 14: Label
16: 17(bool) Phi 18 5 34 20 17: 18(bool) Phi 19 5 34 16
LoopMerge 15 None LoopMerge 15 None
Branch 19 Branch 20
19: Label 20: Label
SelectionMerge 20 None SelectionMerge 16 None
BranchConditional 16 20 21 BranchConditional 17 16 21
21: Label 21: Label
22: 8(fvec4) Load 10(color) 22: 8(fvec4) Load 10(color)
23: 7(float) CompositeExtract 22 0 23: 7(float) CompositeExtract 22 0
26: 7(float) Load 25(d) 26: 7(float) Load 25(d)
27: 17(bool) FOrdLessThan 23 26 27: 18(bool) FOrdLessThan 23 26
SelectionMerge 28 None SelectionMerge 28 None
BranchConditional 27 28 15 BranchConditional 27 28 15
28: Label 28: Label
Branch 20 Branch 16
20: Label 16: Label
31: 8(fvec4) Load 30(bigColor) 31: 8(fvec4) Load 30(bigColor)
32: 8(fvec4) Load 10(color) 32: 8(fvec4) Load 10(color)
33: 8(fvec4) FAdd 32 31 33: 8(fvec4) FAdd 32 31
......
...@@ -41,8 +41,8 @@ Linked vertex stage: ...@@ -41,8 +41,8 @@ Linked vertex stage:
7: TypeInt 32 1 7: TypeInt 32 1
8: TypePointer Function 7(int) 8: TypePointer Function 7(int)
10: 7(int) Constant 0 10: 7(int) Constant 0
14: 7(int) Constant 10 15: 7(int) Constant 10
15: TypeBool 16: TypeBool
19: 7(int) Constant 1 19: 7(int) Constant 1
21: 7(int) Constant 2 21: 7(int) Constant 2
32: 7(int) Constant 3 32: 7(int) Constant 3
...@@ -64,15 +64,15 @@ Linked vertex stage: ...@@ -64,15 +64,15 @@ Linked vertex stage:
Store 9(i) 10 Store 9(i) 10
Branch 11 Branch 11
11: Label 11: Label
13: 7(int) Load 9(i) 14: 7(int) Load 9(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 12 None LoopMerge 12 None
BranchConditional 16 17 12 BranchConditional 17 13 12
17: Label 13: Label
Store 18(A) 19 Store 18(A) 19
20: 7(int) Load 9(i) 20: 7(int) Load 9(i)
22: 7(int) SMod 20 21 22: 7(int) SMod 20 21
23: 15(bool) IEqual 22 10 23: 16(bool) IEqual 22 10
SelectionMerge 25 None SelectionMerge 25 None
BranchConditional 23 24 25 BranchConditional 23 24 25
24: Label 24: Label
...@@ -87,7 +87,7 @@ Linked vertex stage: ...@@ -87,7 +87,7 @@ Linked vertex stage:
25: Label 25: Label
31: 7(int) Load 9(i) 31: 7(int) Load 9(i)
33: 7(int) SMod 31 32 33: 7(int) SMod 31 32
34: 15(bool) IEqual 33 10 34: 16(bool) IEqual 33 10
SelectionMerge 36 None SelectionMerge 36 None
BranchConditional 34 35 36 BranchConditional 34 35 36
35: Label 35: Label
......
...@@ -29,8 +29,8 @@ Linked vertex stage: ...@@ -29,8 +29,8 @@ Linked vertex stage:
7: TypeInt 32 1 7: TypeInt 32 1
8: TypePointer Function 7(int) 8: TypePointer Function 7(int)
10: 7(int) Constant 0 10: 7(int) Constant 0
14: 7(int) Constant 10 15: 7(int) Constant 10
15: TypeBool 16: TypeBool
19: 7(int) Constant 12 19: 7(int) Constant 12
21: 7(int) Constant 1 21: 7(int) Constant 1
23: TypePointer Input 7(int) 23: TypePointer Input 7(int)
...@@ -43,11 +43,11 @@ Linked vertex stage: ...@@ -43,11 +43,11 @@ Linked vertex stage:
Store 9(i) 10 Store 9(i) 10
Branch 11 Branch 11
11: Label 11: Label
13: 7(int) Load 9(i) 14: 7(int) Load 9(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 12 None LoopMerge 12 None
BranchConditional 16 17 12 BranchConditional 17 13 12
17: Label 13: Label
Store 18(j) 19 Store 18(j) 19
20: 7(int) Load 9(i) 20: 7(int) Load 9(i)
22: 7(int) IAdd 20 21 22: 7(int) IAdd 20 21
......
...@@ -15,7 +15,7 @@ Linked fragment stage: ...@@ -15,7 +15,7 @@ Linked fragment stage:
Name 10 "color" Name 10 "color"
Name 12 "BaseColor" Name 12 "BaseColor"
Name 16 "i" Name 16 "i"
Name 22 "Count" Name 23 "Count"
Name 28 "bigColor" Name 28 "bigColor"
Name 36 "gl_FragColor" Name 36 "gl_FragColor"
Name 39 "sum" Name 39 "sum"
...@@ -40,9 +40,9 @@ Linked fragment stage: ...@@ -40,9 +40,9 @@ Linked fragment stage:
14: TypeInt 32 1 14: TypeInt 32 1
15: TypePointer Function 14(int) 15: TypePointer Function 14(int)
17: 14(int) Constant 0 17: 14(int) Constant 0
21: TypePointer UniformConstant 14(int) 22: TypePointer UniformConstant 14(int)
22(Count): 21(ptr) Variable UniformConstant 23(Count): 22(ptr) Variable UniformConstant
24: TypeBool 25: TypeBool
27: TypePointer UniformConstant 8(fvec4) 27: TypePointer UniformConstant 8(fvec4)
28(bigColor): 27(ptr) Variable UniformConstant 28(bigColor): 27(ptr) Variable UniformConstant
33: 14(int) Constant 1 33: 14(int) Constant 1
...@@ -50,7 +50,7 @@ Linked fragment stage: ...@@ -50,7 +50,7 @@ Linked fragment stage:
36(gl_FragColor): 35(ptr) Variable Output 36(gl_FragColor): 35(ptr) Variable Output
38: TypePointer Function 7(float) 38: TypePointer Function 7(float)
40: 7(float) Constant 0 40: 7(float) Constant 0
45: 14(int) Constant 4 46: 14(int) Constant 4
48: TypeInt 32 0 48: TypeInt 32 0
49: TypeVector 48(int) 4 49: TypeVector 48(int) 4
50: TypePointer UniformConstant 49(ivec4) 50: TypePointer UniformConstant 49(ivec4)
...@@ -59,7 +59,7 @@ Linked fragment stage: ...@@ -59,7 +59,7 @@ Linked fragment stage:
86: TypeVector 7(float) 3 86: TypeVector 7(float) 3
97: TypePointer Input 7(float) 97: TypePointer Input 7(float)
98(f): 97(ptr) Variable Input 98(f): 97(ptr) Variable Input
115: 14(int) Constant 16 116: 14(int) Constant 16
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
10(color): 9(ptr) Variable Function 10(color): 9(ptr) Variable Function
...@@ -76,12 +76,12 @@ Linked fragment stage: ...@@ -76,12 +76,12 @@ Linked fragment stage:
Store 16(i) 17 Store 16(i) 17
Branch 18 Branch 18
18: Label 18: Label
20: 14(int) Load 16(i) 21: 14(int) Load 16(i)
23: 14(int) Load 22(Count) 24: 14(int) Load 23(Count)
25: 24(bool) SLessThan 20 23 26: 25(bool) SLessThan 21 24
LoopMerge 19 None LoopMerge 19 None
BranchConditional 25 26 19 BranchConditional 26 20 19
26: Label 20: Label
29: 8(fvec4) Load 28(bigColor) 29: 8(fvec4) Load 28(bigColor)
30: 8(fvec4) Load 10(color) 30: 8(fvec4) Load 10(color)
31: 8(fvec4) FAdd 30 29 31: 8(fvec4) FAdd 30 29
...@@ -97,11 +97,11 @@ Linked fragment stage: ...@@ -97,11 +97,11 @@ Linked fragment stage:
Store 41(i) 17 Store 41(i) 17
Branch 42 Branch 42
42: Label 42: Label
44: 14(int) Load 41(i) 45: 14(int) Load 41(i)
46: 24(bool) SLessThan 44 45 47: 25(bool) SLessThan 45 46
LoopMerge 43 None LoopMerge 43 None
BranchConditional 46 47 43 BranchConditional 47 44 43
47: Label 44: Label
52: 14(int) Load 41(i) 52: 14(int) Load 41(i)
53: 49(ivec4) Load 51(v4) 53: 49(ivec4) Load 51(v4)
54: 48(int) VectorExtractDynamic 53 52 54: 48(int) VectorExtractDynamic 53 52
...@@ -117,11 +117,11 @@ Linked fragment stage: ...@@ -117,11 +117,11 @@ Linked fragment stage:
Store 60(i) 17 Store 60(i) 17
Branch 61 Branch 61
61: Label 61: Label
63: 14(int) Load 60(i) 64: 14(int) Load 60(i)
64: 24(bool) SLessThan 63 45 65: 25(bool) SLessThan 64 46
LoopMerge 62 None LoopMerge 62 None
BranchConditional 64 65 62 BranchConditional 65 63 62
65: Label 63: Label
67: 14(int) Load 60(i) 67: 14(int) Load 60(i)
68: 14(int) Load 60(i) 68: 14(int) Load 60(i)
69: 49(ivec4) Load 51(v4) 69: 49(ivec4) Load 51(v4)
...@@ -151,12 +151,12 @@ Linked fragment stage: ...@@ -151,12 +151,12 @@ Linked fragment stage:
Store 90(i) 17 Store 90(i) 17
Branch 91 Branch 91
91: Label 91: Label
93: 14(int) Load 90(i) 94: 14(int) Load 90(i)
94: 14(int) Load 22(Count) 95: 14(int) Load 23(Count)
95: 24(bool) SLessThan 93 94 96: 25(bool) SLessThan 94 95
LoopMerge 92 None LoopMerge 92 None
BranchConditional 95 96 92 BranchConditional 96 93 92
96: Label 93: Label
99: 7(float) Load 98(f) 99: 7(float) Load 98(f)
100: 8(fvec4) Load 84(r) 100: 8(fvec4) Load 84(r)
101: 8(fvec4) CompositeInsert 99 100 3 101: 8(fvec4) CompositeInsert 99 100 3
...@@ -177,17 +177,17 @@ Linked fragment stage: ...@@ -177,17 +177,17 @@ Linked fragment stage:
Store 111(i) 17 Store 111(i) 17
Branch 112 Branch 112
112: Label 112: Label
114: 14(int) Load 111(i) 115: 14(int) Load 111(i)
116: 24(bool) SLessThan 114 115 117: 25(bool) SLessThan 115 116
LoopMerge 113 None LoopMerge 113 None
BranchConditional 116 117 113 BranchConditional 117 114 113
117: Label 114: Label
118: 7(float) Load 98(f) 118: 7(float) Load 98(f)
119: 8(fvec4) Load 36(gl_FragColor) 119: 8(fvec4) Load 36(gl_FragColor)
120: 8(fvec4) VectorTimesScalar 119 118 120: 8(fvec4) VectorTimesScalar 119 118
Store 36(gl_FragColor) 120 Store 36(gl_FragColor) 120
121: 14(int) Load 111(i) 121: 14(int) Load 111(i)
122: 14(int) IAdd 121 45 122: 14(int) IAdd 121 46
Store 111(i) 122 Store 111(i) 122
Branch 112 Branch 112
113: Label 113: Label
......
...@@ -82,7 +82,7 @@ Linked fragment stage: ...@@ -82,7 +82,7 @@ Linked fragment stage:
47: TypePointer Function 46 47: TypePointer Function 46
51: TypePointer Function 7(int) 51: TypePointer Function 7(int)
68: 7(int) Constant 5 68: 7(int) Constant 5
78: 7(int) Constant 16 79: 7(int) Constant 16
83: 8(float) Constant 0 83: 8(float) Constant 0
87(condition): 21(ptr) Variable UniformConstant 87(condition): 21(ptr) Variable UniformConstant
93: 7(int) Constant 3 93: 7(int) Constant 3
...@@ -160,11 +160,11 @@ Linked fragment stage: ...@@ -160,11 +160,11 @@ Linked fragment stage:
Store 74(i) 17 Store 74(i) 17
Branch 75 Branch 75
75: Label 75: Label
77: 7(int) Load 74(i) 78: 7(int) Load 74(i)
79: 24(bool) SLessThan 77 78 80: 24(bool) SLessThan 78 79
LoopMerge 76 None LoopMerge 76 None
BranchConditional 79 80 76 BranchConditional 80 77 76
80: Label 77: Label
82: 7(int) Load 74(i) 82: 7(int) Load 74(i)
84: 31(ptr) AccessChain 81(a) 82 84: 31(ptr) AccessChain 81(a) 82
Store 84 83 Store 84 83
......
...@@ -18,7 +18,7 @@ Linked fragment stage: ...@@ -18,7 +18,7 @@ Linked fragment stage:
Name 12 "BaseColor" Name 12 "BaseColor"
Name 25 "d4" Name 25 "d4"
Name 30 "bigColor4" Name 30 "bigColor4"
Name 83 "d13" Name 84 "d13"
Name 149 "gl_FragColor" Name 149 "gl_FragColor"
Name 151 "bigColor" Name 151 "bigColor"
Name 152 "bigColor1_1" Name 152 "bigColor1_1"
...@@ -115,16 +115,16 @@ Linked fragment stage: ...@@ -115,16 +115,16 @@ Linked fragment stage:
9: TypePointer Function 8(fvec4) 9: TypePointer Function 8(fvec4)
11: TypePointer Input 8(fvec4) 11: TypePointer Input 8(fvec4)
12(BaseColor): 11(ptr) Variable Input 12(BaseColor): 11(ptr) Variable Input
17: TypeBool 18: TypeBool
18: 17(bool) ConstantTrue 19: 18(bool) ConstantTrue
24: TypePointer UniformConstant 7(float) 24: TypePointer UniformConstant 7(float)
25(d4): 24(ptr) Variable UniformConstant 25(d4): 24(ptr) Variable UniformConstant
29: TypePointer UniformConstant 8(fvec4) 29: TypePointer UniformConstant 8(fvec4)
30(bigColor4): 29(ptr) Variable UniformConstant 30(bigColor4): 29(ptr) Variable UniformConstant
40: 7(float) Constant 1073741824 40: 7(float) Constant 1073741824
54: 7(float) Constant 1065353216 54: 7(float) Constant 1065353216
58: 17(bool) ConstantFalse 58: 18(bool) ConstantFalse
83(d13): 24(ptr) Variable UniformConstant 84(d13): 24(ptr) Variable UniformConstant
148: TypePointer Output 8(fvec4) 148: TypePointer Output 8(fvec4)
149(gl_FragColor): 148(ptr) Variable Output 149(gl_FragColor): 148(ptr) Variable Output
151(bigColor): 29(ptr) Variable UniformConstant 151(bigColor): 29(ptr) Variable UniformConstant
...@@ -179,22 +179,22 @@ Linked fragment stage: ...@@ -179,22 +179,22 @@ Linked fragment stage:
Store 10(color) 13 Store 10(color) 13
Branch 14 Branch 14
14: Label 14: Label
16: 17(bool) Phi 18 5 58 50 58 65 17: 18(bool) Phi 19 5 58 50 58 65
LoopMerge 15 None LoopMerge 15 None
Branch 19 Branch 20
19: Label 20: Label
SelectionMerge 20 None SelectionMerge 16 None
BranchConditional 16 20 21 BranchConditional 17 16 21
21: Label 21: Label
22: 8(fvec4) Load 10(color) 22: 8(fvec4) Load 10(color)
23: 7(float) CompositeExtract 22 2 23: 7(float) CompositeExtract 22 2
26: 7(float) Load 25(d4) 26: 7(float) Load 25(d4)
27: 17(bool) FOrdLessThan 23 26 27: 18(bool) FOrdLessThan 23 26
SelectionMerge 28 None SelectionMerge 28 None
BranchConditional 27 28 15 BranchConditional 27 28 15
28: Label 28: Label
Branch 20 Branch 16
20: Label 16: Label
31: 8(fvec4) Load 30(bigColor4) 31: 8(fvec4) Load 30(bigColor4)
32: 8(fvec4) Load 10(color) 32: 8(fvec4) Load 10(color)
33: 8(fvec4) FAdd 32 31 33: 8(fvec4) FAdd 32 31
...@@ -202,7 +202,7 @@ Linked fragment stage: ...@@ -202,7 +202,7 @@ Linked fragment stage:
34: 8(fvec4) Load 10(color) 34: 8(fvec4) Load 10(color)
35: 7(float) CompositeExtract 34 0 35: 7(float) CompositeExtract 34 0
36: 7(float) Load 25(d4) 36: 7(float) Load 25(d4)
37: 17(bool) FOrdLessThan 35 36 37: 18(bool) FOrdLessThan 35 36
SelectionMerge 39 None SelectionMerge 39 None
BranchConditional 37 38 39 BranchConditional 37 38 39
38: Label 38: Label
...@@ -215,7 +215,7 @@ Linked fragment stage: ...@@ -215,7 +215,7 @@ Linked fragment stage:
46: 8(fvec4) Load 10(color) 46: 8(fvec4) Load 10(color)
47: 7(float) CompositeExtract 46 2 47: 7(float) CompositeExtract 46 2
48: 7(float) Load 25(d4) 48: 7(float) Load 25(d4)
49: 17(bool) FOrdLessThan 47 48 49: 18(bool) FOrdLessThan 47 48
SelectionMerge 51 None SelectionMerge 51 None
BranchConditional 49 50 51 BranchConditional 49 50 51
50: Label 50: Label
...@@ -232,7 +232,7 @@ Linked fragment stage: ...@@ -232,7 +232,7 @@ Linked fragment stage:
60: 8(fvec4) Load 10(color) 60: 8(fvec4) Load 10(color)
61: 7(float) CompositeExtract 60 1 61: 7(float) CompositeExtract 60 1
62: 7(float) Load 25(d4) 62: 7(float) Load 25(d4)
63: 17(bool) FOrdLessThan 61 62 63: 18(bool) FOrdLessThan 61 62
SelectionMerge 65 None SelectionMerge 65 None
BranchConditional 63 64 72 BranchConditional 63 64 72
64: Label 64: Label
...@@ -258,17 +258,17 @@ Linked fragment stage: ...@@ -258,17 +258,17 @@ Linked fragment stage:
15: Label 15: Label
Branch 79 Branch 79
79: Label 79: Label
81: 8(fvec4) Load 10(color) 82: 8(fvec4) Load 10(color)
82: 7(float) CompositeExtract 81 3 83: 7(float) CompositeExtract 82 3
84: 7(float) Load 83(d13) 85: 7(float) Load 84(d13)
85: 17(bool) FOrdLessThan 82 84 86: 18(bool) FOrdLessThan 83 85
LoopMerge 80 None LoopMerge 80 None
BranchConditional 85 86 80 BranchConditional 86 81 80
86: Label 81: Label
87: 8(fvec4) Load 10(color) 87: 8(fvec4) Load 10(color)
88: 7(float) CompositeExtract 87 2 88: 7(float) CompositeExtract 87 2
89: 7(float) Load 83(d13) 89: 7(float) Load 84(d13)
90: 17(bool) FOrdLessThan 88 89 90: 18(bool) FOrdLessThan 88 89
SelectionMerge 92 None SelectionMerge 92 None
BranchConditional 90 91 96 BranchConditional 90 91 96
91: Label 91: Label
...@@ -291,7 +291,7 @@ Linked fragment stage: ...@@ -291,7 +291,7 @@ Linked fragment stage:
103: 8(fvec4) Load 10(color) 103: 8(fvec4) Load 10(color)
104: 7(float) CompositeExtract 103 0 104: 7(float) CompositeExtract 103 0
105: 7(float) Load 25(d4) 105: 7(float) Load 25(d4)
106: 17(bool) FOrdLessThan 104 105 106: 18(bool) FOrdLessThan 104 105
SelectionMerge 108 None SelectionMerge 108 None
BranchConditional 106 107 108 BranchConditional 106 107 108
107: Label 107: Label
...@@ -304,7 +304,7 @@ Linked fragment stage: ...@@ -304,7 +304,7 @@ Linked fragment stage:
114: 8(fvec4) Load 10(color) 114: 8(fvec4) Load 10(color)
115: 7(float) CompositeExtract 114 2 115: 7(float) CompositeExtract 114 2
116: 7(float) Load 25(d4) 116: 7(float) Load 25(d4)
117: 17(bool) FOrdLessThan 115 116 117: 18(bool) FOrdLessThan 115 116
SelectionMerge 119 None SelectionMerge 119 None
BranchConditional 117 118 119 BranchConditional 117 118 119
118: Label 118: Label
...@@ -321,7 +321,7 @@ Linked fragment stage: ...@@ -321,7 +321,7 @@ Linked fragment stage:
126: 8(fvec4) Load 10(color) 126: 8(fvec4) Load 10(color)
127: 7(float) CompositeExtract 126 1 127: 7(float) CompositeExtract 126 1
128: 7(float) Load 25(d4) 128: 7(float) Load 25(d4)
129: 17(bool) FOrdLessThan 127 128 129: 18(bool) FOrdLessThan 127 128
SelectionMerge 131 None SelectionMerge 131 None
BranchConditional 129 130 138 BranchConditional 129 130 138
130: Label 130: Label
......
...@@ -70,10 +70,10 @@ Linked fragment stage: ...@@ -70,10 +70,10 @@ Linked fragment stage:
74(x): 73(ptr) Variable Input 74(x): 73(ptr) Variable Input
128(d): 60(ptr) Variable UniformConstant 128(d): 60(ptr) Variable UniformConstant
155: 10(int) Constant 0 155: 10(int) Constant 0
159: 10(int) Constant 10 160: 10(int) Constant 10
160: TypeBool 161: TypeBool
173: 10(int) Constant 20 173: 10(int) Constant 20
177: 10(int) Constant 30 178: 10(int) Constant 30
183: 7(float) Constant 1120429670 183: 7(float) Constant 1120429670
203: 7(float) Constant 1079739679 203: 7(float) Constant 1079739679
221: TypePointer Output 7(float) 221: TypePointer Output 7(float)
...@@ -214,11 +214,11 @@ Linked fragment stage: ...@@ -214,11 +214,11 @@ Linked fragment stage:
Store 154(i) 155 Store 154(i) 155
Branch 156 Branch 156
156: Label 156: Label
158: 10(int) Load 154(i) 159: 10(int) Load 154(i)
161: 160(bool) SLessThan 158 159 162: 161(bool) SLessThan 159 160
LoopMerge 157 None LoopMerge 157 None
BranchConditional 161 162 157 BranchConditional 162 158 157
162: Label 158: Label
163: 10(int) Load 61(c) 163: 10(int) Load 61(c)
SelectionMerge 167 None SelectionMerge 167 None
Switch 163 166 Switch 163 166
...@@ -233,16 +233,16 @@ Linked fragment stage: ...@@ -233,16 +233,16 @@ Linked fragment stage:
Store 172(j) 173 Store 172(j) 173
Branch 174 Branch 174
174: Label 174: Label
176: 10(int) Load 172(j) 177: 10(int) Load 172(j)
178: 160(bool) SLessThan 176 177 179: 161(bool) SLessThan 177 178
LoopMerge 175 None LoopMerge 175 None
BranchConditional 178 179 175 BranchConditional 179 176 175
179: Label 176: Label
180: 7(float) Load 72(f) 180: 7(float) Load 72(f)
181: 7(float) FAdd 180 48 181: 7(float) FAdd 180 48
Store 72(f) 181 Store 72(f) 181
182: 7(float) Load 72(f) 182: 7(float) Load 72(f)
184: 160(bool) FOrdLessThan 182 183 184: 161(bool) FOrdLessThan 182 183
SelectionMerge 186 None SelectionMerge 186 None
BranchConditional 184 185 186 BranchConditional 184 185 186
185: Label 185: Label
...@@ -270,7 +270,7 @@ Linked fragment stage: ...@@ -270,7 +270,7 @@ Linked fragment stage:
Branch 167 Branch 167
167: Label 167: Label
202: 7(float) Load 72(f) 202: 7(float) Load 72(f)
204: 160(bool) FOrdLessThan 202 203 204: 161(bool) FOrdLessThan 202 203
SelectionMerge 206 None SelectionMerge 206 None
BranchConditional 204 205 206 BranchConditional 204 205 206
205: Label 205: Label
......
...@@ -35,8 +35,8 @@ Linked vertex stage: ...@@ -35,8 +35,8 @@ Linked vertex stage:
7: TypeInt 32 1 7: TypeInt 32 1
8: TypePointer Function 7(int) 8: TypePointer Function 7(int)
10: 7(int) Constant 0 10: 7(int) Constant 0
14: 7(int) Constant 10 15: 7(int) Constant 10
15: TypeBool 16: TypeBool
19: 7(int) Constant 1 19: 7(int) Constant 1
21: 7(int) Constant 2 21: 7(int) Constant 2
30: 7(int) Constant 5 30: 7(int) Constant 5
...@@ -54,15 +54,15 @@ Linked vertex stage: ...@@ -54,15 +54,15 @@ Linked vertex stage:
Store 9(i) 10 Store 9(i) 10
Branch 11 Branch 11
11: Label 11: Label
13: 7(int) Load 9(i) 14: 7(int) Load 9(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 12 None LoopMerge 12 None
BranchConditional 16 17 12 BranchConditional 17 13 12
17: Label 13: Label
Store 18(A) 19 Store 18(A) 19
20: 7(int) Load 9(i) 20: 7(int) Load 9(i)
22: 7(int) SMod 20 21 22: 7(int) SMod 20 21
23: 15(bool) IEqual 22 10 23: 16(bool) IEqual 22 10
SelectionMerge 25 None SelectionMerge 25 None
BranchConditional 23 24 25 BranchConditional 23 24 25
24: Label 24: Label
...@@ -74,7 +74,7 @@ Linked vertex stage: ...@@ -74,7 +74,7 @@ Linked vertex stage:
25: Label 25: Label
29: 7(int) Load 9(i) 29: 7(int) Load 9(i)
31: 7(int) SMod 29 30 31: 7(int) SMod 29 30
32: 15(bool) IEqual 31 10 32: 16(bool) IEqual 31 10
SelectionMerge 34 None SelectionMerge 34 None
BranchConditional 32 33 34 BranchConditional 32 33 34
33: Label 33: Label
......
...@@ -27,8 +27,8 @@ Linked vertex stage: ...@@ -27,8 +27,8 @@ Linked vertex stage:
7: TypeInt 32 1 7: TypeInt 32 1
8: TypePointer Function 7(int) 8: TypePointer Function 7(int)
10: 7(int) Constant 0 10: 7(int) Constant 0
14: 7(int) Constant 10 15: 7(int) Constant 10
15: TypeBool 16: TypeBool
19: 7(int) Constant 1 19: 7(int) Constant 1
21: TypePointer Input 7(int) 21: TypePointer Input 7(int)
22(gl_VertexID): 21(ptr) Variable Input 22(gl_VertexID): 21(ptr) Variable Input
...@@ -39,11 +39,11 @@ Linked vertex stage: ...@@ -39,11 +39,11 @@ Linked vertex stage:
Store 9(i) 10 Store 9(i) 10
Branch 11 Branch 11
11: Label 11: Label
13: 7(int) Load 9(i) 14: 7(int) Load 9(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 12 None LoopMerge 12 None
BranchConditional 16 17 12 BranchConditional 17 13 12
17: Label 13: Label
18: 7(int) Load 9(i) 18: 7(int) Load 9(i)
20: 7(int) IAdd 18 19 20: 7(int) IAdd 18 19
Store 9(i) 20 Store 9(i) 20
......
...@@ -14,7 +14,7 @@ Linked fragment stage: ...@@ -14,7 +14,7 @@ Linked fragment stage:
Name 4 "main" Name 4 "main"
Name 10 "color" Name 10 "color"
Name 12 "BaseColor" Name 12 "BaseColor"
Name 19 "d" Name 20 "d"
Name 25 "bigColor" Name 25 "bigColor"
Name 30 "gl_FragColor" Name 30 "gl_FragColor"
Decorate 12(BaseColor) Smooth Decorate 12(BaseColor) Smooth
...@@ -26,9 +26,9 @@ Linked fragment stage: ...@@ -26,9 +26,9 @@ Linked fragment stage:
9: TypePointer Function 8(fvec4) 9: TypePointer Function 8(fvec4)
11: TypePointer Input 8(fvec4) 11: TypePointer Input 8(fvec4)
12(BaseColor): 11(ptr) Variable Input 12(BaseColor): 11(ptr) Variable Input
18: TypePointer UniformConstant 7(float) 19: TypePointer UniformConstant 7(float)
19(d): 18(ptr) Variable UniformConstant 20(d): 19(ptr) Variable UniformConstant
21: TypeBool 22: TypeBool
24: TypePointer UniformConstant 8(fvec4) 24: TypePointer UniformConstant 8(fvec4)
25(bigColor): 24(ptr) Variable UniformConstant 25(bigColor): 24(ptr) Variable UniformConstant
29: TypePointer Output 8(fvec4) 29: TypePointer Output 8(fvec4)
...@@ -40,13 +40,13 @@ Linked fragment stage: ...@@ -40,13 +40,13 @@ Linked fragment stage:
Store 10(color) 13 Store 10(color) 13
Branch 14 Branch 14
14: Label 14: Label
16: 8(fvec4) Load 10(color) 17: 8(fvec4) Load 10(color)
17: 7(float) CompositeExtract 16 0 18: 7(float) CompositeExtract 17 0
20: 7(float) Load 19(d) 21: 7(float) Load 20(d)
22: 21(bool) FOrdLessThan 17 20 23: 22(bool) FOrdLessThan 18 21
LoopMerge 15 None LoopMerge 15 None
BranchConditional 22 23 15 BranchConditional 23 16 15
23: Label 16: Label
26: 8(fvec4) Load 25(bigColor) 26: 8(fvec4) Load 25(bigColor)
27: 8(fvec4) Load 10(color) 27: 8(fvec4) Load 10(color)
28: 8(fvec4) FAdd 27 26 28: 8(fvec4) FAdd 27 26
......
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