From 9c6734c8dfc2708cbb7311b68fc7c6040681486b Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Sun, 10 Jan 2016 12:15:13 -0500 Subject: [PATCH 1/7] First cut at new loop codegen. Change-Id: Id3bdf8b7a5606e7ce5d856ef225d5ddbe59a584b --- SPIRV/GlslangToSpv.cpp | 62 +++++++++++++++--------- SPIRV/SpvBuilder.cpp | 13 +++++ SPIRV/SpvBuilder.h | 16 ++++-- Test/baseResults/spv.for-simple.vert.out | 54 +++++++++++---------- 4 files changed, 93 insertions(+), 52 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 0fff30e9..769cf50b 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1342,33 +1342,51 @@ void TGlslangToSpvTraverser::visitConstantUnion(glslang::TIntermConstantUnion* n bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIntermLoop* node) { - // body emission needs to know what the for-loop terminal is when it sees a "continue" - loopTerminal.push(node->getTerminal()); + auto blocks = builder.makeNewLoop(); + if (node->testFirst() && node->getTest()) { + spv::Block& head = builder.makeNewBlock(); + builder.createBranch(&head); - builder.makeNewLoop(node->testFirst()); - - if (node->getTest()) { + builder.setBuildPoint(&head); node->getTest()->traverse(this); - // the AST only contained the test computation, not the branch, we have to add it - spv::Id condition = builder.accessChainLoad(convertGlslangToSpvType(node->getTest()->getType())); - builder.createLoopTestBranch(condition); + spv::Id condition = + builder.accessChainLoad(convertGlslangToSpvType(node->getTest()->getType())); + builder.createLoopMerge(&blocks.merge, &blocks.continue_target, spv::LoopControlMaskNone); + builder.createConditionalBranch(condition, &blocks.body, &blocks.merge); + + builder.setBuildPoint(&blocks.body); + if (node->getBody()) + node->getBody()->traverse(this); // continue->cont, break->exit + builder.createBranch(&blocks.continue_target); + + builder.setBuildPoint(&blocks.continue_target); + if (node->getTerminal()) + node->getTerminal()->traverse(this); + builder.createBranch(&head); } else { - builder.createBranchToBody(); + builder.createBranch(&blocks.body); + + builder.setBuildPoint(&blocks.body); + if (node->getBody()) + node->getBody()->traverse(this); // continue->cont, break->exit + builder.createBranch(&blocks.continue_target); + + builder.setBuildPoint(&blocks.continue_target); + if (node->getTerminal()) + node->getTerminal()->traverse(this); + if (node->getTest()) { + node->getTest()->traverse(this); + spv::Id condition = + builder.accessChainLoad(convertGlslangToSpvType(node->getTest()->getType())); + builder.createLoopMerge(&blocks.merge, &blocks.continue_target, + spv::LoopControlMaskNone); + builder.createConditionalBranch(condition, &blocks.body, &blocks.merge); + } else { + builder.createBranch(&blocks.body); + } } - if (node->getBody()) { - breakForLoop.push(true); - node->getBody()->traverse(this); - breakForLoop.pop(); - } - - if (loopTerminal.top()) - loopTerminal.top()->traverse(this); - - builder.closeLoop(); - - loopTerminal.pop(); - + builder.setBuildPoint(&blocks.merge); return false; } diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index a46c924b..57e27e0d 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1753,6 +1753,19 @@ void Builder::endSwitch(std::vector& /*segmentBlock*/) switchMerges.pop(); } +Block& Builder::makeNewBlock() +{ + Function& function = buildPoint->getParent(); + auto block = new Block(getUniqueId(), function); + function.addBlock(block); + return *block; +} + +Builder::LoopBlocks Builder::makeNewLoop() +{ + return {makeNewBlock(), makeNewBlock(), makeNewBlock()}; +} + // Comments in header void Builder::makeNewLoop(bool loopTestFirst) { diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index 5750b00f..d3e7ad98 100755 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -378,6 +378,13 @@ public: // The loopTestFirst parameter is true when the loop test executes before // the body. (It is false for do-while loops.) void makeNewLoop(bool loopTestFirst); + struct LoopBlocks { + Block &body, &merge, &continue_target; + }; + LoopBlocks makeNewLoop(); + + // Create a new block in the function containing the build point. + Block& makeNewBlock(); // Add the branch for the loop test, based on the given condition. // The true branch goes to the first block in the loop body, and @@ -494,7 +501,11 @@ public: void dump(std::vector&) const; -protected: + void createBranch(Block* block); + void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); + void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control); + + protected: Id makeIntConstant(Id typeId, unsigned value, bool specConstant); Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const; Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const; @@ -503,10 +514,7 @@ protected: void transferAccessChainSwizzle(bool dynamic); void simplifyAccessChainSwizzle(); void createAndSetNoPredecessorBlock(const char*); - void createBranch(Block* block); void createSelectionMerge(Block* mergeBlock, unsigned int control); - void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control); - void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); void dumpInstructions(std::vector&, const std::vector&) const; struct Loop; // Defined below. diff --git a/Test/baseResults/spv.for-simple.vert.out b/Test/baseResults/spv.for-simple.vert.out index 95ca758d..3dd4fc36 100755 --- a/Test/baseResults/spv.for-simple.vert.out +++ b/Test/baseResults/spv.for-simple.vert.out @@ -5,49 +5,51 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 25 +// Id's are bound by 26 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 23 24 + EntryPoint Vertex 4 "main" 24 25 Source ESSL 300 Name 4 "main" Name 8 "i" - Name 17 "j" - Name 23 "gl_VertexID" - Name 24 "gl_InstanceID" - Decorate 23(gl_VertexID) BuiltIn VertexId - Decorate 24(gl_InstanceID) BuiltIn InstanceId + Name 18 "j" + Name 24 "gl_VertexID" + Name 25 "gl_InstanceID" + Decorate 24(gl_VertexID) BuiltIn VertexId + Decorate 25(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 0 - 14: 6(int) Constant 10 - 15: TypeBool - 18: 6(int) Constant 12 - 20: 6(int) Constant 1 - 22: TypePointer Input 6(int) - 23(gl_VertexID): 22(ptr) Variable Input -24(gl_InstanceID): 22(ptr) Variable Input + 15: 6(int) Constant 10 + 16: TypeBool + 19: 6(int) Constant 12 + 21: 6(int) Constant 1 + 23: TypePointer Input 6(int) + 24(gl_VertexID): 23(ptr) Variable Input +25(gl_InstanceID): 23(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function - 17(j): 7(ptr) Variable Function + 18(j): 7(ptr) Variable Function Store 8(i) 9 - Branch 10 + Branch 13 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - Store 17(j) 18 - 19: 6(int) Load 8(i) - 21: 6(int) IAdd 19 20 - Store 8(i) 21 - Branch 10 + Store 18(j) 19 + Branch 12 11: Label Return + 12: Label + 20: 6(int) Load 8(i) + 22: 6(int) IAdd 20 21 + Store 8(i) 22 + Branch 13 + 13: Label + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 11 12 None + BranchConditional 17 10 11 FunctionEnd From e537b8b48840be891c12d7ab8c7c4f3b98eefde5 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Sun, 10 Jan 2016 19:37:00 -0500 Subject: [PATCH 2/7] Fix unreachable-block removal. Add a test for loop without a condition. Change-Id: Idd7fc462218a84b1e745207e2975a3f2897d30a0 --- SPIRV/GlslangToSpv.cpp | 4 +- SPIRV/SpvBuilder.cpp | 2 +- SPIRV/spvIR.h | 9 ++++- Test/baseResults/spv.for-notest.vert.out | 50 ++++++++++++++++++++++++ Test/spv.for-notest.vert | 6 +++ 5 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 Test/baseResults/spv.for-notest.vert.out create mode 100644 Test/spv.for-notest.vert diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 769cf50b..06ab0948 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1356,7 +1356,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn builder.setBuildPoint(&blocks.body); if (node->getBody()) - node->getBody()->traverse(this); // continue->cont, break->exit + node->getBody()->traverse(this); builder.createBranch(&blocks.continue_target); builder.setBuildPoint(&blocks.continue_target); @@ -1368,7 +1368,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn builder.setBuildPoint(&blocks.body); if (node->getBody()) - node->getBody()->traverse(this); // continue->cont, break->exit + node->getBody()->traverse(this); builder.createBranch(&blocks.continue_target); builder.setBuildPoint(&blocks.continue_target); diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 57e27e0d..8e023ea1 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -852,7 +852,7 @@ void Builder::leaveFunction() if (unreachable) { // Given that this block is at the end of a function, it must be right after an // explicit return, just remove it. - function.popBlock(block); + function.removeBlock(block); } else { // We'll add a return instruction at the end of the current block, // which for a non-void function is really error recovery (?), as the source diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 6736a13c..70f27f75 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -52,6 +52,7 @@ #include "spirv.hpp" +#include #include #include #include @@ -235,7 +236,13 @@ public: Id getParamId(int p) { return parameterInstructions[p]->getResultId(); } void addBlock(Block* block) { blocks.push_back(block); } - void popBlock(Block*) { blocks.pop_back(); } + void removeBlock(Block* block) + { + auto found = find(blocks.begin(), blocks.end(), block); + assert(found != blocks.end()); + blocks.erase(found); + delete block; + } Module& getParent() const { return parent; } Block* getEntryBlock() const { return blocks.front(); } diff --git a/Test/baseResults/spv.for-notest.vert.out b/Test/baseResults/spv.for-notest.vert.out new file mode 100644 index 00000000..e55ef9b6 --- /dev/null +++ b/Test/baseResults/spv.for-notest.vert.out @@ -0,0 +1,50 @@ +spv.for-notest.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 14 20 21 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 14 "r" + Name 20 "gl_VertexID" + Name 21 "gl_InstanceID" + Decorate 14(r) Location 0 + Decorate 20(gl_VertexID) BuiltIn VertexId + Decorate 21(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 13: TypePointer Output 6(int) + 14(r): 13(ptr) Variable Output + 17: 6(int) Constant 1 + 19: TypePointer Input 6(int) + 20(gl_VertexID): 19(ptr) Variable Input +21(gl_InstanceID): 19(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + 15: 6(int) Load 8(i) + Store 14(r) 15 + Branch 12 + 12: Label + 16: 6(int) Load 8(i) + 18: 6(int) IAdd 16 17 + Store 8(i) 18 + Branch 10 + FunctionEnd diff --git a/Test/spv.for-notest.vert b/Test/spv.for-notest.vert new file mode 100644 index 00000000..f40e6664 --- /dev/null +++ b/Test/spv.for-notest.vert @@ -0,0 +1,6 @@ +#version 450 +layout(location=0) out highp int r; +void main() { + int i; + for (i=0; ; i++) { r = i; } +} From 13228243b2be30ebc6377ddbbc59f0cc8d5da12a Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Sun, 10 Jan 2016 23:15:08 -0500 Subject: [PATCH 3/7] Test a for loop with no body. Change-Id: I5b53cc008349afad94b14500506fcab4d6e64d2e --- Test/baseResults/spv.for-nobody.vert.out | 59 ++++++++++++++++++++++++ Test/spv.for-nobody.vert | 7 +++ 2 files changed, 66 insertions(+) create mode 100644 Test/baseResults/spv.for-nobody.vert.out create mode 100644 Test/spv.for-nobody.vert diff --git a/Test/baseResults/spv.for-nobody.vert.out b/Test/baseResults/spv.for-nobody.vert.out new file mode 100644 index 00000000..1645c66a --- /dev/null +++ b/Test/baseResults/spv.for-nobody.vert.out @@ -0,0 +1,59 @@ +spv.for-nobody.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 22 25 26 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 22 "r" + Name 25 "gl_VertexID" + Name 26 "gl_InstanceID" + Decorate 22(r) Location 0 + Decorate 25(gl_VertexID) BuiltIn VertexId + Decorate 26(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 15: 6(int) Constant 10 + 16: TypeBool + 19: 6(int) Constant 1 + 21: TypePointer Output 6(int) + 22(r): 21(ptr) Variable Output + 24: TypePointer Input 6(int) + 25(gl_VertexID): 24(ptr) Variable Input +26(gl_InstanceID): 24(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 13 + 10: Label + Branch 12 + 11: Label + 23: 6(int) Load 8(i) + Store 22(r) 23 + Return + 12: Label + 18: 6(int) Load 8(i) + 20: 6(int) IAdd 18 19 + Store 8(i) 20 + Branch 13 + 13: Label + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 11 12 None + BranchConditional 17 10 11 + FunctionEnd diff --git a/Test/spv.for-nobody.vert b/Test/spv.for-nobody.vert new file mode 100644 index 00000000..99634761 --- /dev/null +++ b/Test/spv.for-nobody.vert @@ -0,0 +1,7 @@ +#version 450 +layout(location=0) out highp int r; +void main() { + int i; + for (i=0; i<10; i++); + r = i; +} From 7819bee82c5caafba1f2fdae2b8f1a9a9419bd67 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Mon, 11 Jan 2016 09:35:22 -0500 Subject: [PATCH 4/7] Switch loops stack to use LoopBlocks. Also remove dead code. Change-Id: I2c0177d8cab48b7d6f9442715aecb7951597f3c8 --- SPIRV/SpvBuilder.cpp | 154 ++----------------------------------------- SPIRV/SpvBuilder.h | 75 ++++----------------- 2 files changed, 16 insertions(+), 213 deletions(-) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 8e023ea1..eb8c4d37 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1761,155 +1761,31 @@ Block& Builder::makeNewBlock() return *block; } -Builder::LoopBlocks Builder::makeNewLoop() +Builder::LoopBlocks& Builder::makeNewLoop() { - return {makeNewBlock(), makeNewBlock(), makeNewBlock()}; -} - -// Comments in header -void Builder::makeNewLoop(bool loopTestFirst) -{ - loops.push(Loop(*this, loopTestFirst)); - const Loop& loop = loops.top(); - - // The loop test is always emitted before the loop body. - // But if the loop test executes at the bottom of the loop, then - // execute the test only on the second and subsequent iterations. - - // Remember the block that branches to the loop header. This - // is required for the test-after-body case. - Block* preheader = getBuildPoint(); - - // Branch into the loop - createBranch(loop.header); - - // Set ourselves inside the loop - loop.function->addBlock(loop.header); - setBuildPoint(loop.header); - - if (!loopTestFirst) { - // Generate code to defer the loop test until the second and - // subsequent iterations. - - // It's always the first iteration when coming from the preheader. - // All other branches to this loop header will need to indicate "false", - // but we don't yet know where they will come from. - loop.isFirstIteration->addIdOperand(makeBoolConstant(true)); - loop.isFirstIteration->addIdOperand(preheader->getId()); - getBuildPoint()->addInstruction(loop.isFirstIteration); - - // Mark the end of the structured loop. This must exist in the loop header block. - createLoopMerge(loop.merge, loop.header, LoopControlMaskNone); - - // Generate code to see if this is the first iteration of the loop. - // It needs to be in its own block, since the loop merge and - // the selection merge instructions can't both be in the same - // (header) block. - Block* firstIterationCheck = new Block(getUniqueId(), *loop.function); - createBranch(firstIterationCheck); - loop.function->addBlock(firstIterationCheck); - setBuildPoint(firstIterationCheck); - - // Control flow after this "if" normally reconverges at the loop body. - // However, the loop test has a "break branch" out of this selection - // construct because it can transfer control to the loop merge block. - createSelectionMerge(loop.body, SelectionControlMaskNone); - - Block* loopTest = new Block(getUniqueId(), *loop.function); - createConditionalBranch(loop.isFirstIteration->getResultId(), loop.body, loopTest); - - loop.function->addBlock(loopTest); - setBuildPoint(loopTest); - } -} - -void Builder::createLoopTestBranch(Id condition) -{ - const Loop& loop = loops.top(); - - // Generate the merge instruction. If the loop test executes before - // the body, then this is a loop merge. Otherwise the loop merge - // has already been generated and this is a conditional merge. - if (loop.testFirst) { - createLoopMerge(loop.merge, loop.header, LoopControlMaskNone); - // Branching to the "body" block will keep control inside - // the loop. - createConditionalBranch(condition, loop.body, loop.merge); - loop.function->addBlock(loop.body); - setBuildPoint(loop.body); - } else { - // The branch to the loop merge block is the allowed exception - // to the structured control flow. Otherwise, control flow will - // continue to loop.body block. Since that is already the target - // of a merge instruction, and a block can't be the target of more - // than one merge instruction, we need to make an intermediate block. - Block* stayInLoopBlock = new Block(getUniqueId(), *loop.function); - createSelectionMerge(stayInLoopBlock, SelectionControlMaskNone); - - // This is the loop test. - createConditionalBranch(condition, stayInLoopBlock, loop.merge); - - // The dummy block just branches to the real loop body. - loop.function->addBlock(stayInLoopBlock); - setBuildPoint(stayInLoopBlock); - createBranchToBody(); - } -} - -void Builder::createBranchToBody() -{ - const Loop& loop = loops.top(); - assert(loop.body); - - // This is a reconvergence of control flow, so no merge instruction - // is required. - createBranch(loop.body); - loop.function->addBlock(loop.body); - setBuildPoint(loop.body); + loops.push({makeNewBlock(), makeNewBlock(), makeNewBlock()}); + return loops.top(); } void Builder::createLoopContinue() { - createBranchToLoopHeaderFromInside(loops.top()); + createBranch(&loops.top().continue_target); // Set up a block for dead code. createAndSetNoPredecessorBlock("post-loop-continue"); } -// Add an exit (e.g. "break") for the innermost loop that you're in void Builder::createLoopExit() { - createBranch(loops.top().merge); + createBranch(&loops.top().merge); // Set up a block for dead code. createAndSetNoPredecessorBlock("post-loop-break"); } -// Close the innermost loop void Builder::closeLoop() { - const Loop& loop = loops.top(); - - // Branch back to the top - createBranchToLoopHeaderFromInside(loop); - - // Add the merge block and set the build point to it - loop.function->addBlock(loop.merge); - setBuildPoint(loop.merge); - loops.pop(); } -// Create a branch to the header of the given loop, from inside -// the loop body. -// Adjusts the phi node for the first-iteration value if needeed. -void Builder::createBranchToLoopHeaderFromInside(const Loop& loop) -{ - createBranch(loop.header); - if (loop.isFirstIteration) { - loop.isFirstIteration->addIdOperand(makeBoolConstant(false)); - loop.isFirstIteration->addIdOperand(getBuildPoint()->getId()); - } -} - void Builder::clearAccessChain() { accessChain.base = NoResult; @@ -2273,24 +2149,4 @@ void MissingFunctionality(const char* fun) exit(1); } -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(nullptr) -{ - if (!testFirst) - { -// You may be tempted to rewrite this as -// new Instruction(builder.getUniqueId(), builder.makeBoolType(), OpPhi); -// This will cause subtle test failures because builder.getUniqueId(), -// and builder.makeBoolType() can then get run in a compiler-specific -// order making tests fail for certain configurations. - Id instructionId = builder.getUniqueId(); - isFirstIteration = new Instruction(instructionId, builder.makeBoolType(), OpPhi); - } -} - }; // end spv namespace diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index d3e7ad98..a1ed84ca 100755 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -373,35 +373,24 @@ public: // Finish off the innermost switch. void endSwitch(std::vector& segmentBB); - // Start the beginning of a new loop, and prepare the builder to - // generate code for the loop test. - // The loopTestFirst parameter is true when the loop test executes before - // the body. (It is false for do-while loops.) - void makeNewLoop(bool loopTestFirst); struct LoopBlocks { Block &body, &merge, &continue_target; }; - LoopBlocks makeNewLoop(); - // Create a new block in the function containing the build point. + // Start a new loop and prepare the builder to generate code for it. Until + // closeLoop() is called for this loop, createLoopContinue() and + // createLoopExit() will target its corresponding blocks. + LoopBlocks& makeNewLoop(); + + // Create a new block in the function containing the build point. Memory is + // owned by the function object. Block& makeNewBlock(); - // Add the branch for the loop test, based on the given condition. - // The true branch goes to the first block in the loop body, and - // the false branch goes to the loop's merge block. The builder insertion - // point will be placed at the start of the body. - void createLoopTestBranch(Id condition); - - // Generate an unconditional branch to the loop body. The builder insertion - // point will be placed at the start of the body. Use this when there is - // no loop test. - void createBranchToBody(); - - // Add a branch to the test of the current (innermost) loop. - // The way we generate code, that's also the loop header. + // Add a branch to the continue_target of the current (innermost) loop. void createLoopContinue(); - // Add an exit (e.g. "break") for the innermost loop that you're in + // Add an exit (e.g. "break") from the innermost loop that we're currently + // in. void createLoopExit(); // Close the innermost loop that you're in @@ -517,9 +506,6 @@ public: void createSelectionMerge(Block* mergeBlock, unsigned int control); void dumpInstructions(std::vector&, const std::vector&) const; - struct Loop; // Defined below. - void createBranchToLoopHeaderFromInside(const Loop& loop); - SourceLanguage source; int sourceVersion; std::vector extensions; @@ -550,47 +536,8 @@ public: // stack of switches std::stack switchMerges; - // Data that needs to be kept in order to properly handle loops. - struct Loop { - // 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); - - // The function containing the loop. - Function* const function; - // The header is the first block generated for the loop. - // It dominates all the blocks in the loop, i.e. it is always - // executed before any others. - // If the loop test is executed before the body (as in "while" and - // "for" loops), then the header begins with the test code. - // Otherwise, the loop is a "do-while" loop and the header contains the - // start of the body of the loop (if the body exists). - Block* const header; - // 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 - // nested "break" is encountered. - Block* const merge; - // 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. - // This member is null until we generate code that references the loop - // body block. - Block* const body; - // True when the loop test executes before the body. - const bool testFirst; - // 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 - // the loop. Otherwise this is null. This is non-const because - // it has to be initialized outside of the initializer-list. - Instruction* isFirstIteration; - }; - // Our loop stack. - std::stack loops; + std::stack loops; }; // end Builder class // Use for non-fatal notes about what's not complete From c8fbbab419a68975d221562f96f8f6ae734f8004 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Mon, 11 Jan 2016 14:48:36 -0500 Subject: [PATCH 5/7] Update .out files with new loop SPIR-V. Also update breakForLoop and call builder.closeLoop() in code generation. Remove dead code. Change-Id: Ic8ce5b208530f8787989ef45a2efa405f1b45310 --- SPIRV/GlslangToSpv.cpp | 8 +- Test/baseResults/spv.dataOutIndirect.vert.out | 144 +- Test/baseResults/spv.do-simple.vert.out | 55 +- .../spv.do-while-continue-break.vert.out | 197 +- Test/baseResults/spv.doWhileLoop.frag.out | 135 +- .../spv.for-continue-break.vert.out | 193 +- Test/baseResults/spv.forLoop.frag.out | 398 +-- Test/baseResults/spv.localAggregates.frag.out | 432 ++-- Test/baseResults/spv.loops.frag.out | 2184 ++++++++--------- Test/baseResults/spv.loopsArtificial.frag.out | 607 +++-- Test/baseResults/spv.switch.frag.out | 804 +++--- .../spv.while-continue-break.vert.out | 174 +- Test/baseResults/spv.while-simple.vert.out | 100 +- Test/baseResults/spv.whileLoop.frag.out | 126 +- Test/test-spirv-list | 2 + 15 files changed, 2766 insertions(+), 2793 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 06ab0948..e5e2169b 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -142,7 +142,6 @@ protected: std::unordered_map structMap; std::unordered_map > memberRemapper; // for mapping glslang block indices to spv indices (e.g., due to hidden members) std::stack breakForLoop; // false means break for switch - std::stack 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.createConditionalBranch(condition, &blocks.body, &blocks.merge); + breakForLoop.push(true); builder.setBuildPoint(&blocks.body); if (node->getBody()) node->getBody()->traverse(this); builder.createBranch(&blocks.continue_target); + breakForLoop.pop(); builder.setBuildPoint(&blocks.continue_target); if (node->getTerminal()) @@ -1366,10 +1367,12 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn } else { builder.createBranch(&blocks.body); + breakForLoop.push(true); builder.setBuildPoint(&blocks.body); if (node->getBody()) node->getBody()->traverse(this); builder.createBranch(&blocks.continue_target); + breakForLoop.pop(); builder.setBuildPoint(&blocks.continue_target); if (node->getTerminal()) @@ -1387,6 +1390,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn } builder.setBuildPoint(&blocks.merge); + builder.closeLoop(); return false; } @@ -1406,8 +1410,6 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T builder.addSwitchBreak(); break; case glslang::EOpContinue: - if (loopTerminal.top()) - loopTerminal.top()->traverse(this); builder.createLoopContinue(); break; case glslang::EOpReturn: diff --git a/Test/baseResults/spv.dataOutIndirect.vert.out b/Test/baseResults/spv.dataOutIndirect.vert.out index 0b24b624..0efe6568 100755 --- a/Test/baseResults/spv.dataOutIndirect.vert.out +++ b/Test/baseResults/spv.dataOutIndirect.vert.out @@ -1,71 +1,73 @@ -spv.dataOutIndirect.vert -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 - - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 38 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 26 23 37 - Source GLSL 130 - Name 4 "main" - Name 8 "i" - Name 23 "colorOut" - Name 26 "color" - Name 32 "gl_Position" - Name 37 "gl_VertexID" - Decorate 32(gl_Position) BuiltIn Position - Decorate 37(gl_VertexID) BuiltIn VertexId - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 1 - 14: 6(int) Constant 5 - 15: TypeBool - 17: TypeFloat 32 - 18: TypeVector 17(float) 4 - 19: TypeInt 32 0 - 20: 19(int) Constant 6 - 21: TypeArray 18(fvec4) 20 - 22: TypePointer Output 21 - 23(colorOut): 22(ptr) Variable Output - 25: TypePointer Input 18(fvec4) - 26(color): 25(ptr) Variable Input - 28: TypePointer Output 18(fvec4) - 32(gl_Position): 28(ptr) Variable Output - 33: 6(int) Constant 2 - 36: TypePointer Input 6(int) - 37(gl_VertexID): 36(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 8(i): 7(ptr) Variable Function - Store 8(i) 9 - Branch 10 - 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - 24: 6(int) Load 8(i) - 27: 18(fvec4) Load 26(color) - 29: 28(ptr) AccessChain 23(colorOut) 24 - Store 29 27 - 30: 6(int) Load 8(i) - 31: 6(int) IAdd 30 9 - Store 8(i) 31 - Branch 10 - 11: Label - 34: 28(ptr) AccessChain 23(colorOut) 33 - 35: 18(fvec4) Load 34 - Store 32(gl_Position) 35 - Return - FunctionEnd +spv.dataOutIndirect.vert +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 + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 27 24 38 + Source GLSL 130 + Name 4 "main" + Name 8 "i" + Name 24 "colorOut" + Name 27 "color" + Name 33 "gl_Position" + Name 38 "gl_VertexID" + Decorate 33(gl_Position) BuiltIn Position + Decorate 38(gl_VertexID) BuiltIn VertexId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 1 + 15: 6(int) Constant 5 + 16: TypeBool + 18: TypeFloat 32 + 19: TypeVector 18(float) 4 + 20: TypeInt 32 0 + 21: 20(int) Constant 6 + 22: TypeArray 19(fvec4) 21 + 23: TypePointer Output 22 + 24(colorOut): 23(ptr) Variable Output + 26: TypePointer Input 19(fvec4) + 27(color): 26(ptr) Variable Input + 29: TypePointer Output 19(fvec4) + 33(gl_Position): 29(ptr) Variable Output + 34: 6(int) Constant 2 + 37: TypePointer Input 6(int) + 38(gl_VertexID): 37(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 13 + 10: Label + 25: 6(int) Load 8(i) + 28: 19(fvec4) Load 27(color) + 30: 29(ptr) AccessChain 24(colorOut) 25 + Store 30 28 + Branch 12 + 11: Label + 35: 29(ptr) AccessChain 24(colorOut) 34 + 36: 19(fvec4) Load 35 + Store 33(gl_Position) 36 + Return + 12: Label + 31: 6(int) Load 8(i) + 32: 6(int) IAdd 31 9 + Store 8(i) 32 + Branch 13 + 13: Label + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 11 12 None + BranchConditional 17 10 11 + FunctionEnd diff --git a/Test/baseResults/spv.do-simple.vert.out b/Test/baseResults/spv.do-simple.vert.out index 5da88276..694da83a 100755 --- a/Test/baseResults/spv.do-simple.vert.out +++ b/Test/baseResults/spv.do-simple.vert.out @@ -5,56 +5,45 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 29 +// Id's are bound by 23 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 27 28 + EntryPoint Vertex 4 "main" 21 22 Source ESSL 300 Name 4 "main" Name 8 "i" - Name 27 "gl_VertexID" - Name 28 "gl_InstanceID" - Decorate 27(gl_VertexID) BuiltIn VertexId - Decorate 28(gl_InstanceID) BuiltIn InstanceId + Name 21 "gl_VertexID" + Name 22 "gl_InstanceID" + Decorate 21(gl_VertexID) BuiltIn VertexId + Decorate 22(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 0 - 14: TypeBool - 15: 14(bool) ConstantTrue - 19: 6(int) Constant 10 - 23: 6(int) Constant 1 - 25: 14(bool) ConstantFalse - 26: TypePointer Input 6(int) - 27(gl_VertexID): 26(ptr) Variable Input -28(gl_InstanceID): 26(ptr) Variable Input + 14: 6(int) Constant 1 + 17: 6(int) Constant 10 + 18: TypeBool + 20: TypePointer Input 6(int) + 21(gl_VertexID): 20(ptr) Variable Input +22(gl_InstanceID): 20(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function Store 8(i) 9 Branch 10 10: Label - 13: 14(bool) Phi 15 5 25 12 - LoopMerge 11 10 None - Branch 16 - 16: Label - SelectionMerge 12 None - BranchConditional 13 12 17 - 17: Label - 18: 6(int) Load 8(i) - 20: 14(bool) SLessThan 18 19 - SelectionMerge 21 None - BranchConditional 20 21 11 - 21: Label - Branch 12 - 12: Label - 22: 6(int) Load 8(i) - 24: 6(int) IAdd 22 23 - Store 8(i) 24 - Branch 10 + 13: 6(int) Load 8(i) + 15: 6(int) IAdd 13 14 + Store 8(i) 15 + Branch 12 11: Label 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 diff --git a/Test/baseResults/spv.do-while-continue-break.vert.out b/Test/baseResults/spv.do-while-continue-break.vert.out index f148d51d..c70c28da 100755 --- a/Test/baseResults/spv.do-while-continue-break.vert.out +++ b/Test/baseResults/spv.do-while-continue-break.vert.out @@ -1,104 +1,93 @@ -spv.do-while-continue-break.vert - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 51 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 49 50 - Source ESSL 300 - Name 4 "main" - Name 8 "i" - Name 24 "A" - Name 30 "B" - Name 33 "C" - Name 39 "D" - Name 42 "E" - Name 44 "F" - Name 46 "G" - Name 49 "gl_VertexID" - Name 50 "gl_InstanceID" - Decorate 49(gl_VertexID) BuiltIn VertexId - Decorate 50(gl_InstanceID) BuiltIn InstanceId - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 0 - 14: TypeBool - 15: 14(bool) ConstantTrue - 19: 6(int) Constant 1 - 21: 6(int) Constant 19 - 26: 6(int) Constant 2 - 31: 14(bool) ConstantFalse - 35: 6(int) Constant 5 - 40: 6(int) Constant 3 - 43: 6(int) Constant 42 - 45: 6(int) Constant 99 - 47: 6(int) Constant 12 - 48: TypePointer Input 6(int) - 49(gl_VertexID): 48(ptr) Variable Input -50(gl_InstanceID): 48(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 8(i): 7(ptr) Variable Function - 24(A): 7(ptr) Variable Function - 30(B): 7(ptr) Variable Function - 33(C): 7(ptr) Variable Function - 39(D): 7(ptr) Variable Function - 42(E): 7(ptr) Variable Function - 44(F): 7(ptr) Variable Function - 46(G): 7(ptr) Variable Function - Store 8(i) 9 - Branch 10 - 10: Label - 13: 14(bool) Phi 15 5 31 28 31 38 - LoopMerge 11 10 None - Branch 16 - 16: Label - SelectionMerge 12 None - BranchConditional 13 12 17 - 17: Label - 18: 6(int) Load 8(i) - 20: 6(int) IAdd 18 19 - Store 8(i) 20 - 22: 14(bool) SLessThan 20 21 - SelectionMerge 23 None - BranchConditional 22 23 11 - 23: Label - Branch 12 - 12: Label - Store 24(A) 9 - 25: 6(int) Load 8(i) - 27: 14(bool) IEqual 25 26 - SelectionMerge 29 None - BranchConditional 27 28 29 - 28: Label - Store 30(B) 19 - Branch 10 - 32: Label - Store 33(C) 26 - Branch 29 - 29: Label - 34: 6(int) Load 8(i) - 36: 14(bool) IEqual 34 35 - SelectionMerge 38 None - BranchConditional 36 37 38 - 37: Label - Store 39(D) 40 - Branch 11 - 41: Label - Store 42(E) 43 - Branch 38 - 38: Label - Store 44(F) 45 - Branch 10 - 11: Label - Store 46(G) 47 - Return - FunctionEnd +spv.do-while-continue-break.vert + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 45 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 43 44 + Source ESSL 300 + Name 4 "main" + Name 8 "i" + Name 13 "A" + Name 20 "B" + Name 23 "C" + Name 29 "D" + Name 32 "E" + Name 34 "F" + Name 40 "G" + Name 43 "gl_VertexID" + Name 44 "gl_InstanceID" + Decorate 43(gl_VertexID) BuiltIn VertexId + Decorate 44(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 15: 6(int) Constant 2 + 16: TypeBool + 21: 6(int) Constant 1 + 25: 6(int) Constant 5 + 30: 6(int) Constant 3 + 33: 6(int) Constant 42 + 35: 6(int) Constant 99 + 38: 6(int) Constant 19 + 41: 6(int) Constant 12 + 42: TypePointer Input 6(int) + 43(gl_VertexID): 42(ptr) Variable Input +44(gl_InstanceID): 42(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 13(A): 7(ptr) Variable Function + 20(B): 7(ptr) Variable Function + 23(C): 7(ptr) Variable Function + 29(D): 7(ptr) Variable Function + 32(E): 7(ptr) Variable Function + 34(F): 7(ptr) Variable Function + 40(G): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + Store 13(A) 9 + 14: 6(int) Load 8(i) + 17: 16(bool) IEqual 14 15 + SelectionMerge 19 None + BranchConditional 17 18 19 + 11: Label + Store 40(G) 41 + Return + 12: Label + 36: 6(int) Load 8(i) + 37: 6(int) IAdd 36 21 + Store 8(i) 37 + 39: 16(bool) SLessThan 37 38 + LoopMerge 11 12 None + BranchConditional 39 10 11 + 18: Label + Store 20(B) 21 + Branch 12 + 22: Label + Store 23(C) 15 + Branch 19 + 19: Label + 24: 6(int) Load 8(i) + 26: 16(bool) IEqual 24 25 + SelectionMerge 28 None + BranchConditional 26 27 28 + 27: Label + Store 29(D) 30 + Branch 11 + 31: Label + Store 32(E) 33 + Branch 28 + 28: Label + Store 34(F) 35 + Branch 12 + FunctionEnd diff --git a/Test/baseResults/spv.doWhileLoop.frag.out b/Test/baseResults/spv.doWhileLoop.frag.out index d33fb8b1..64d05813 100755 --- a/Test/baseResults/spv.doWhileLoop.frag.out +++ b/Test/baseResults/spv.doWhileLoop.frag.out @@ -1,73 +1,62 @@ -spv.doWhileLoop.frag - -Linked fragment stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 40 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 - ExecutionMode 4 OriginLowerLeft - Source GLSL 110 - Name 4 "main" - Name 9 "color" - Name 11 "BaseColor" - Name 27 "d" - Name 32 "bigColor" - Name 38 "gl_FragColor" - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Function 7(fvec4) - 10: TypePointer Input 7(fvec4) - 11(BaseColor): 10(ptr) Variable Input - 17: TypeBool - 18: 17(bool) ConstantTrue - 21: TypeInt 32 0 - 22: 21(int) Constant 0 - 23: TypePointer Function 6(float) - 26: TypePointer UniformConstant 6(float) - 27(d): 26(ptr) Variable UniformConstant - 31: TypePointer UniformConstant 7(fvec4) - 32(bigColor): 31(ptr) Variable UniformConstant - 36: 17(bool) ConstantFalse - 37: TypePointer Output 7(fvec4) -38(gl_FragColor): 37(ptr) Variable Output - 4(main): 2 Function None 3 - 5: Label - 9(color): 8(ptr) Variable Function - 12: 7(fvec4) Load 11(BaseColor) - Store 9(color) 12 - Branch 13 - 13: Label - 16: 17(bool) Phi 18 5 36 15 - LoopMerge 14 13 None - Branch 19 - 19: Label - SelectionMerge 15 None - BranchConditional 16 15 20 - 20: Label - 24: 23(ptr) AccessChain 9(color) 22 - 25: 6(float) Load 24 - 28: 6(float) Load 27(d) - 29: 17(bool) FOrdLessThan 25 28 - SelectionMerge 30 None - BranchConditional 29 30 14 - 30: Label - Branch 15 - 15: Label - 33: 7(fvec4) Load 32(bigColor) - 34: 7(fvec4) Load 9(color) - 35: 7(fvec4) FAdd 34 33 - Store 9(color) 35 - Branch 13 - 14: Label - 39: 7(fvec4) Load 9(color) - Store 38(gl_FragColor) 39 - Return - FunctionEnd +spv.doWhileLoop.frag + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 34 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 + ExecutionMode 4 OriginLowerLeft + Source GLSL 110 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 17 "bigColor" + Name 27 "d" + Name 32 "gl_FragColor" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 16: TypePointer UniformConstant 7(fvec4) + 17(bigColor): 16(ptr) Variable UniformConstant + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 26: TypePointer UniformConstant 6(float) + 27(d): 26(ptr) Variable UniformConstant + 29: TypeBool + 31: TypePointer Output 7(fvec4) +32(gl_FragColor): 31(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Branch 13 + 13: Label + 18: 7(fvec4) Load 17(bigColor) + 19: 7(fvec4) Load 9(color) + 20: 7(fvec4) FAdd 19 18 + Store 9(color) 20 + Branch 15 + 14: Label + 33: 7(fvec4) Load 9(color) + Store 32(gl_FragColor) 33 + Return + 15: Label + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d) + 30: 29(bool) FOrdLessThan 25 28 + LoopMerge 14 15 None + BranchConditional 30 13 14 + FunctionEnd diff --git a/Test/baseResults/spv.for-continue-break.vert.out b/Test/baseResults/spv.for-continue-break.vert.out index eac3ddb8..df2acab4 100755 --- a/Test/baseResults/spv.for-continue-break.vert.out +++ b/Test/baseResults/spv.for-continue-break.vert.out @@ -1,97 +1,96 @@ -spv.for-continue-break.vert - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 48 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 46 47 - Source ESSL 300 - Name 4 "main" - Name 8 "i" - Name 17 "A" - Name 25 "B" - Name 29 "C" - Name 36 "D" - Name 38 "E" - Name 39 "F" - Name 43 "G" - Name 46 "gl_VertexID" - Name 47 "gl_InstanceID" - Decorate 46(gl_VertexID) BuiltIn VertexId - Decorate 47(gl_InstanceID) BuiltIn InstanceId - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 0 - 14: 6(int) Constant 10 - 15: TypeBool - 18: 6(int) Constant 1 - 20: 6(int) Constant 2 - 31: 6(int) Constant 3 - 40: 6(int) Constant 12 - 44: 6(int) Constant 99 - 45: TypePointer Input 6(int) - 46(gl_VertexID): 45(ptr) Variable Input -47(gl_InstanceID): 45(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 8(i): 7(ptr) Variable Function - 17(A): 7(ptr) Variable Function - 25(B): 7(ptr) Variable Function - 29(C): 7(ptr) Variable Function - 36(D): 7(ptr) Variable Function - 38(E): 7(ptr) Variable Function - 39(F): 7(ptr) Variable Function - 43(G): 7(ptr) Variable Function - Store 8(i) 9 - Branch 10 - 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - Store 17(A) 18 - 19: 6(int) Load 8(i) - 21: 6(int) SMod 19 20 - 22: 15(bool) IEqual 21 9 - SelectionMerge 24 None - BranchConditional 22 23 24 - 23: Label - Store 25(B) 18 - 26: 6(int) Load 8(i) - 27: 6(int) IAdd 26 18 - Store 8(i) 27 - Branch 10 - 28: Label - Store 29(C) 18 - Branch 24 - 24: Label - 30: 6(int) Load 8(i) - 32: 6(int) SMod 30 31 - 33: 15(bool) IEqual 32 9 - SelectionMerge 35 None - BranchConditional 33 34 35 - 34: Label - Store 36(D) 18 - Branch 11 - 37: Label - Store 38(E) 18 - Branch 35 - 35: Label - Store 39(F) 40 - 41: 6(int) Load 8(i) - 42: 6(int) IAdd 41 18 - Store 8(i) 42 - Branch 10 - 11: Label - Store 43(G) 44 - Return - FunctionEnd +spv.for-continue-break.vert + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 47 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 45 46 + Source ESSL 300 + Name 4 "main" + Name 8 "i" + Name 18 "A" + Name 26 "B" + Name 28 "C" + Name 35 "D" + Name 37 "E" + Name 38 "F" + Name 42 "G" + Name 45 "gl_VertexID" + Name 46 "gl_InstanceID" + Decorate 45(gl_VertexID) BuiltIn VertexId + Decorate 46(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 15: 6(int) Constant 10 + 16: TypeBool + 19: 6(int) Constant 1 + 21: 6(int) Constant 2 + 30: 6(int) Constant 3 + 39: 6(int) Constant 12 + 43: 6(int) Constant 99 + 44: TypePointer Input 6(int) + 45(gl_VertexID): 44(ptr) Variable Input +46(gl_InstanceID): 44(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 18(A): 7(ptr) Variable Function + 26(B): 7(ptr) Variable Function + 28(C): 7(ptr) Variable Function + 35(D): 7(ptr) Variable Function + 37(E): 7(ptr) Variable Function + 38(F): 7(ptr) Variable Function + 42(G): 7(ptr) Variable Function + Store 8(i) 9 + Branch 13 + 10: Label + Store 18(A) 19 + 20: 6(int) Load 8(i) + 22: 6(int) SMod 20 21 + 23: 16(bool) IEqual 22 9 + SelectionMerge 25 None + BranchConditional 23 24 25 + 11: Label + Store 42(G) 43 + Return + 12: Label + 40: 6(int) Load 8(i) + 41: 6(int) IAdd 40 19 + Store 8(i) 41 + Branch 13 + 13: Label + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 11 12 None + BranchConditional 17 10 11 + 24: Label + Store 26(B) 19 + Branch 12 + 27: Label + Store 28(C) 19 + Branch 25 + 25: Label + 29: 6(int) Load 8(i) + 31: 6(int) SMod 29 30 + 32: 16(bool) IEqual 31 9 + SelectionMerge 34 None + BranchConditional 32 33 34 + 33: Label + Store 35(D) 19 + Branch 11 + 36: Label + Store 37(E) 19 + Branch 34 + 34: Label + Store 38(F) 39 + Branch 12 + FunctionEnd diff --git a/Test/baseResults/spv.forLoop.frag.out b/Test/baseResults/spv.forLoop.frag.out index 1be209b4..3e4cb28a 100755 --- a/Test/baseResults/spv.forLoop.frag.out +++ b/Test/baseResults/spv.forLoop.frag.out @@ -1,194 +1,204 @@ -spv.forLoop.frag - -Linked fragment stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 122 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 97 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 - Name 4 "main" - Name 9 "color" - Name 11 "BaseColor" - Name 15 "i" - Name 22 "Count" - Name 27 "bigColor" - Name 35 "gl_FragColor" - Name 38 "sum" - Name 40 "i" - Name 50 "v4" - Name 60 "i" - Name 66 "tv4" - Name 83 "r" - Name 89 "i" - Name 97 "f" - Name 110 "i" - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Function 7(fvec4) - 10: TypePointer Input 7(fvec4) - 11(BaseColor): 10(ptr) Variable Input - 13: TypeInt 32 1 - 14: TypePointer Function 13(int) - 16: 13(int) Constant 0 - 21: TypePointer UniformConstant 13(int) - 22(Count): 21(ptr) Variable UniformConstant - 24: TypeBool - 26: TypePointer UniformConstant 7(fvec4) - 27(bigColor): 26(ptr) Variable UniformConstant - 32: 13(int) Constant 1 - 34: TypePointer Output 7(fvec4) -35(gl_FragColor): 34(ptr) Variable Output - 37: TypePointer Function 6(float) - 39: 6(float) Constant 0 - 45: 13(int) Constant 4 - 47: TypeInt 32 0 - 48: TypeVector 47(int) 4 - 49: TypePointer UniformConstant 48(ivec4) - 50(v4): 49(ptr) Variable UniformConstant - 52: TypePointer UniformConstant 47(int) - 71: 47(int) Constant 4 - 84: TypeVector 6(float) 3 - 96: TypePointer Input 6(float) - 97(f): 96(ptr) Variable Input - 99: 47(int) Constant 3 - 115: 13(int) Constant 16 - 4(main): 2 Function None 3 - 5: Label - 9(color): 8(ptr) Variable Function - 15(i): 14(ptr) Variable Function - 38(sum): 37(ptr) Variable Function - 40(i): 14(ptr) Variable Function - 60(i): 14(ptr) Variable Function - 66(tv4): 8(ptr) Variable Function - 83(r): 8(ptr) Variable Function - 89(i): 14(ptr) Variable Function - 110(i): 14(ptr) Variable Function - 12: 7(fvec4) Load 11(BaseColor) - Store 9(color) 12 - Store 15(i) 16 - Branch 17 - 17: Label - 20: 13(int) Load 15(i) - 23: 13(int) Load 22(Count) - 25: 24(bool) SLessThan 20 23 - LoopMerge 18 17 None - BranchConditional 25 19 18 - 19: Label - 28: 7(fvec4) Load 27(bigColor) - 29: 7(fvec4) Load 9(color) - 30: 7(fvec4) FAdd 29 28 - Store 9(color) 30 - 31: 13(int) Load 15(i) - 33: 13(int) IAdd 31 32 - Store 15(i) 33 - Branch 17 - 18: Label - 36: 7(fvec4) Load 9(color) - Store 35(gl_FragColor) 36 - Store 38(sum) 39 - Store 40(i) 16 - Branch 41 - 41: Label - 44: 13(int) Load 40(i) - 46: 24(bool) SLessThan 44 45 - LoopMerge 42 41 None - BranchConditional 46 43 42 - 43: Label - 51: 13(int) Load 40(i) - 53: 52(ptr) AccessChain 50(v4) 51 - 54: 47(int) Load 53 - 55: 6(float) ConvertUToF 54 - 56: 6(float) Load 38(sum) - 57: 6(float) FAdd 56 55 - Store 38(sum) 57 - 58: 13(int) Load 40(i) - 59: 13(int) IAdd 58 32 - Store 40(i) 59 - Branch 41 - 42: Label - Store 60(i) 16 - Branch 61 - 61: Label - 64: 13(int) Load 60(i) - 65: 24(bool) SLessThan 64 45 - LoopMerge 62 61 None - BranchConditional 65 63 62 - 63: Label - 67: 13(int) Load 60(i) - 68: 13(int) Load 60(i) - 69: 52(ptr) AccessChain 50(v4) 68 - 70: 47(int) Load 69 - 72: 47(int) IMul 70 71 - 73: 6(float) ConvertUToF 72 - 74: 37(ptr) AccessChain 66(tv4) 67 - Store 74 73 - 75: 13(int) Load 60(i) - 76: 13(int) IAdd 75 32 - Store 60(i) 76 - Branch 61 - 62: Label - 77: 6(float) Load 38(sum) - 78: 7(fvec4) CompositeConstruct 77 77 77 77 - 79: 7(fvec4) Load 66(tv4) - 80: 7(fvec4) FAdd 78 79 - 81: 7(fvec4) Load 35(gl_FragColor) - 82: 7(fvec4) FAdd 81 80 - Store 35(gl_FragColor) 82 - 85: 7(fvec4) Load 11(BaseColor) - 86: 84(fvec3) VectorShuffle 85 85 0 1 2 - 87: 7(fvec4) Load 83(r) - 88: 7(fvec4) VectorShuffle 87 86 4 5 6 3 - Store 83(r) 88 - Store 89(i) 16 - Branch 90 - 90: Label - 93: 13(int) Load 89(i) - 94: 13(int) Load 22(Count) - 95: 24(bool) SLessThan 93 94 - LoopMerge 91 90 None - BranchConditional 95 92 91 - 92: Label - 98: 6(float) Load 97(f) - 100: 37(ptr) AccessChain 83(r) 99 - Store 100 98 - 101: 13(int) Load 89(i) - 102: 13(int) IAdd 101 32 - Store 89(i) 102 - Branch 90 - 91: Label - 103: 7(fvec4) Load 83(r) - 104: 84(fvec3) VectorShuffle 103 103 0 1 2 - 105: 7(fvec4) Load 35(gl_FragColor) - 106: 84(fvec3) VectorShuffle 105 105 0 1 2 - 107: 84(fvec3) FAdd 106 104 - 108: 7(fvec4) Load 35(gl_FragColor) - 109: 7(fvec4) VectorShuffle 108 107 4 5 6 3 - Store 35(gl_FragColor) 109 - Store 110(i) 16 - Branch 111 - 111: Label - 114: 13(int) Load 110(i) - 116: 24(bool) SLessThan 114 115 - LoopMerge 112 111 None - BranchConditional 116 113 112 - 113: Label - 117: 6(float) Load 97(f) - 118: 7(fvec4) Load 35(gl_FragColor) - 119: 7(fvec4) VectorTimesScalar 118 117 - Store 35(gl_FragColor) 119 - 120: 13(int) Load 110(i) - 121: 13(int) IAdd 120 45 - Store 110(i) 121 - Branch 111 - 112: Label - Return - FunctionEnd +spv.forLoop.frag + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 127 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 101 + ExecutionMode 4 OriginLowerLeft + Source GLSL 130 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 15 "i" + Name 23 "Count" + Name 28 "bigColor" + Name 36 "gl_FragColor" + Name 39 "sum" + Name 41 "i" + Name 52 "v4" + Name 62 "i" + Name 69 "tv4" + Name 86 "r" + Name 92 "i" + Name 101 "f" + Name 114 "i" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 13: TypeInt 32 1 + 14: TypePointer Function 13(int) + 16: 13(int) Constant 0 + 22: TypePointer UniformConstant 13(int) + 23(Count): 22(ptr) Variable UniformConstant + 25: TypeBool + 27: TypePointer UniformConstant 7(fvec4) + 28(bigColor): 27(ptr) Variable UniformConstant + 33: 13(int) Constant 1 + 35: TypePointer Output 7(fvec4) +36(gl_FragColor): 35(ptr) Variable Output + 38: TypePointer Function 6(float) + 40: 6(float) Constant 0 + 47: 13(int) Constant 4 + 49: TypeInt 32 0 + 50: TypeVector 49(int) 4 + 51: TypePointer UniformConstant 50(ivec4) + 52(v4): 51(ptr) Variable UniformConstant + 54: TypePointer UniformConstant 49(int) + 74: 49(int) Constant 4 + 87: TypeVector 6(float) 3 + 100: TypePointer Input 6(float) + 101(f): 100(ptr) Variable Input + 103: 49(int) Constant 3 + 120: 13(int) Constant 16 + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 15(i): 14(ptr) Variable Function + 39(sum): 38(ptr) Variable Function + 41(i): 14(ptr) Variable Function + 62(i): 14(ptr) Variable Function + 69(tv4): 8(ptr) Variable Function + 86(r): 8(ptr) Variable Function + 92(i): 14(ptr) Variable Function + 114(i): 14(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Store 15(i) 16 + Branch 20 + 17: Label + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 19 + 18: Label + 37: 7(fvec4) Load 9(color) + Store 36(gl_FragColor) 37 + Store 39(sum) 40 + Store 41(i) 16 + Branch 45 + 19: Label + 32: 13(int) Load 15(i) + 34: 13(int) IAdd 32 33 + Store 15(i) 34 + Branch 20 + 20: Label + 21: 13(int) Load 15(i) + 24: 13(int) Load 23(Count) + 26: 25(bool) SLessThan 21 24 + LoopMerge 18 19 None + BranchConditional 26 17 18 + 42: Label + 53: 13(int) Load 41(i) + 55: 54(ptr) AccessChain 52(v4) 53 + 56: 49(int) Load 55 + 57: 6(float) ConvertUToF 56 + 58: 6(float) Load 39(sum) + 59: 6(float) FAdd 58 57 + Store 39(sum) 59 + Branch 44 + 43: Label + Store 62(i) 16 + Branch 66 + 44: Label + 60: 13(int) Load 41(i) + 61: 13(int) IAdd 60 33 + Store 41(i) 61 + Branch 45 + 45: Label + 46: 13(int) Load 41(i) + 48: 25(bool) SLessThan 46 47 + LoopMerge 43 44 None + BranchConditional 48 42 43 + 63: Label + 70: 13(int) Load 62(i) + 71: 13(int) Load 62(i) + 72: 54(ptr) AccessChain 52(v4) 71 + 73: 49(int) Load 72 + 75: 49(int) IMul 73 74 + 76: 6(float) ConvertUToF 75 + 77: 38(ptr) AccessChain 69(tv4) 70 + Store 77 76 + Branch 65 + 64: Label + 80: 6(float) Load 39(sum) + 81: 7(fvec4) CompositeConstruct 80 80 80 80 + 82: 7(fvec4) Load 69(tv4) + 83: 7(fvec4) FAdd 81 82 + 84: 7(fvec4) Load 36(gl_FragColor) + 85: 7(fvec4) FAdd 84 83 + Store 36(gl_FragColor) 85 + 88: 7(fvec4) Load 11(BaseColor) + 89: 87(fvec3) VectorShuffle 88 88 0 1 2 + 90: 7(fvec4) Load 86(r) + 91: 7(fvec4) VectorShuffle 90 89 4 5 6 3 + Store 86(r) 91 + Store 92(i) 16 + Branch 96 + 65: Label + 78: 13(int) Load 62(i) + 79: 13(int) IAdd 78 33 + Store 62(i) 79 + Branch 66 + 66: Label + 67: 13(int) Load 62(i) + 68: 25(bool) SLessThan 67 47 + LoopMerge 64 65 None + BranchConditional 68 63 64 + 93: Label + 102: 6(float) Load 101(f) + 104: 38(ptr) AccessChain 86(r) 103 + Store 104 102 + Branch 95 + 94: Label + 107: 7(fvec4) Load 86(r) + 108: 87(fvec3) VectorShuffle 107 107 0 1 2 + 109: 7(fvec4) Load 36(gl_FragColor) + 110: 87(fvec3) VectorShuffle 109 109 0 1 2 + 111: 87(fvec3) FAdd 110 108 + 112: 7(fvec4) Load 36(gl_FragColor) + 113: 7(fvec4) VectorShuffle 112 111 4 5 6 3 + Store 36(gl_FragColor) 113 + Store 114(i) 16 + Branch 118 + 95: Label + 105: 13(int) Load 92(i) + 106: 13(int) IAdd 105 33 + Store 92(i) 106 + Branch 96 + 96: Label + 97: 13(int) Load 92(i) + 98: 13(int) Load 23(Count) + 99: 25(bool) SLessThan 97 98 + LoopMerge 94 95 None + BranchConditional 99 93 94 + 115: Label + 122: 6(float) Load 101(f) + 123: 7(fvec4) Load 36(gl_FragColor) + 124: 7(fvec4) VectorTimesScalar 123 122 + Store 36(gl_FragColor) 124 + Branch 117 + 116: Label + Return + 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 diff --git a/Test/baseResults/spv.localAggregates.frag.out b/Test/baseResults/spv.localAggregates.frag.out index 721b5a8c..1f9cbce6 100755 --- a/Test/baseResults/spv.localAggregates.frag.out +++ b/Test/baseResults/spv.localAggregates.frag.out @@ -1,215 +1,217 @@ -spv.localAggregates.frag -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 - - -Linked fragment stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 136 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 40 96 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 - Name 4 "main" - Name 8 "s1" - MemberName 8(s1) 0 "i" - MemberName 8(s1) 1 "f" - Name 10 "s2" - MemberName 10(s2) 0 "i" - MemberName 10(s2) 1 "f" - MemberName 10(s2) 2 "s1_1" - MemberName 10(s2) 3 "bleh" - Name 12 "locals2" - Name 13 "s3" - MemberName 13(s3) 0 "s2_1" - MemberName 13(s3) 1 "i" - MemberName 13(s3) 2 "f" - MemberName 13(s3) 3 "s1_1" - Name 15 "foo3" - Name 36 "localFArray" - Name 40 "coord" - Name 49 "localIArray" - Name 68 "x" - Name 70 "localArray" - Name 75 "i" - Name 82 "a" - Name 88 "condition" - Name 96 "color" - Name 106 "gl_FragColor" - Name 126 "samp2D" - Name 132 "foo" - Name 133 "foo2" - Name 135 "uFloatArray" - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypeFloat 32 - 8(s1): TypeStruct 6(int) 7(float) - 9: TypeVector 7(float) 4 - 10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4) - 11: TypePointer Function 10(s2) - 13(s3): TypeStruct 10(s2) 6(int) 7(float) 8(s1) - 14: TypePointer UniformConstant 13(s3) - 15(foo3): 14(ptr) Variable UniformConstant - 16: 6(int) Constant 0 - 17: TypePointer UniformConstant 10(s2) - 20: TypePointer UniformConstant 6(int) - 23: TypeBool - 27: 6(int) Constant 2 - 28: 6(int) Constant 1 - 29: 7(float) Constant 1065353216 - 30: TypePointer Function 7(float) - 32: TypeInt 32 0 - 33: 32(int) Constant 16 - 34: TypeArray 7(float) 33 - 35: TypePointer Function 34 - 37: 6(int) Constant 4 - 38: TypeVector 7(float) 2 - 39: TypePointer Input 38(fvec2) - 40(coord): 39(ptr) Variable Input - 41: 32(int) Constant 0 - 42: TypePointer Input 7(float) - 46: 32(int) Constant 8 - 47: TypeArray 6(int) 46 - 48: TypePointer Function 47 - 52: TypePointer Function 6(int) - 69: 6(int) Constant 5 - 80: 6(int) Constant 16 - 84: 7(float) Constant 0 - 88(condition): 20(ptr) Variable UniformConstant - 94: 6(int) Constant 3 - 95: TypePointer Input 9(fvec4) - 96(color): 95(ptr) Variable Input - 98: TypePointer Function 9(fvec4) - 100: 32(int) Constant 1 - 103: 32(int) Constant 2 - 105: TypePointer Output 9(fvec4) -106(gl_FragColor): 105(ptr) Variable Output - 123: TypeImage 7(float) 2D sampled format:Unknown - 124: TypeSampledImage 123 - 125: TypePointer UniformConstant 124 - 126(samp2D): 125(ptr) Variable UniformConstant - 131: TypePointer UniformConstant 8(s1) - 132(foo): 131(ptr) Variable UniformConstant - 133(foo2): 17(ptr) Variable UniformConstant - 134: TypePointer UniformConstant 34 -135(uFloatArray): 134(ptr) Variable UniformConstant - 4(main): 2 Function None 3 - 5: Label - 12(locals2): 11(ptr) Variable Function - 36(localFArray): 35(ptr) Variable Function - 49(localIArray): 48(ptr) Variable Function - 68(x): 52(ptr) Variable Function - 70(localArray): 35(ptr) Variable Function - 75(i): 52(ptr) Variable Function - 82(a): 35(ptr) Variable Function - 18: 17(ptr) AccessChain 15(foo3) 16 - 19: 10(s2) Load 18 - Store 12(locals2) 19 - 21: 20(ptr) AccessChain 15(foo3) 16 16 - 22: 6(int) Load 21 - 24: 23(bool) SGreaterThan 22 16 - SelectionMerge 26 None - BranchConditional 24 25 54 - 25: Label - 31: 30(ptr) AccessChain 12(locals2) 27 28 - Store 31 29 - 43: 42(ptr) AccessChain 40(coord) 41 - 44: 7(float) Load 43 - 45: 30(ptr) AccessChain 36(localFArray) 37 - Store 45 44 - 50: 20(ptr) AccessChain 15(foo3) 16 16 - 51: 6(int) Load 50 - 53: 52(ptr) AccessChain 49(localIArray) 27 - Store 53 51 - Branch 26 - 54: Label - 55: 42(ptr) AccessChain 40(coord) 41 - 56: 7(float) Load 55 - 57: 30(ptr) AccessChain 12(locals2) 27 28 - Store 57 56 - 58: 30(ptr) AccessChain 36(localFArray) 37 - Store 58 29 - 59: 52(ptr) AccessChain 49(localIArray) 27 - Store 59 16 - Branch 26 - 26: Label - 60: 52(ptr) AccessChain 49(localIArray) 27 - 61: 6(int) Load 60 - 62: 23(bool) IEqual 61 16 - SelectionMerge 64 None - BranchConditional 62 63 64 - 63: Label - 65: 30(ptr) AccessChain 36(localFArray) 37 - 66: 7(float) Load 65 - 67: 7(float) FAdd 66 29 - Store 65 67 - Branch 64 - 64: Label - Store 68(x) 69 - 71: 6(int) Load 68(x) - 72: 42(ptr) AccessChain 40(coord) 41 - 73: 7(float) Load 72 - 74: 30(ptr) AccessChain 70(localArray) 71 - Store 74 73 - Store 75(i) 16 - Branch 76 - 76: Label - 79: 6(int) Load 75(i) - 81: 23(bool) SLessThan 79 80 - LoopMerge 77 76 None - BranchConditional 81 78 77 - 78: Label - 83: 6(int) Load 75(i) - 85: 30(ptr) AccessChain 82(a) 83 - Store 85 84 - 86: 6(int) Load 75(i) - 87: 6(int) IAdd 86 28 - Store 75(i) 87 - Branch 76 - 77: Label - 89: 6(int) Load 88(condition) - 90: 23(bool) IEqual 89 28 - SelectionMerge 92 None - BranchConditional 90 91 92 - 91: Label - 93: 34 Load 70(localArray) - Store 82(a) 93 - Branch 92 - 92: Label - 97: 9(fvec4) Load 96(color) - 99: 98(ptr) AccessChain 12(locals2) 94 - Store 99 97 - 101: 42(ptr) AccessChain 40(coord) 100 - 102: 7(float) Load 101 - 104: 30(ptr) AccessChain 12(locals2) 94 103 - Store 104 102 - 107: 98(ptr) AccessChain 12(locals2) 94 - 108: 9(fvec4) Load 107 - 109: 30(ptr) AccessChain 36(localFArray) 37 - 110: 7(float) Load 109 - 111: 30(ptr) AccessChain 12(locals2) 27 28 - 112: 7(float) Load 111 - 113: 7(float) FAdd 110 112 - 114: 6(int) Load 68(x) - 115: 30(ptr) AccessChain 70(localArray) 114 - 116: 7(float) Load 115 - 117: 7(float) FAdd 113 116 - 118: 6(int) Load 68(x) - 119: 30(ptr) AccessChain 82(a) 118 - 120: 7(float) Load 119 - 121: 7(float) FAdd 117 120 - 122: 9(fvec4) VectorTimesScalar 108 121 - 127: 124 Load 126(samp2D) - 128: 38(fvec2) Load 40(coord) - 129: 9(fvec4) ImageSampleImplicitLod 127 128 - 130: 9(fvec4) FMul 122 129 - Store 106(gl_FragColor) 130 - Return - FunctionEnd +spv.localAggregates.frag +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 + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 137 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 40 97 + ExecutionMode 4 OriginLowerLeft + Source GLSL 130 + Name 4 "main" + Name 8 "s1" + MemberName 8(s1) 0 "i" + MemberName 8(s1) 1 "f" + Name 10 "s2" + MemberName 10(s2) 0 "i" + MemberName 10(s2) 1 "f" + MemberName 10(s2) 2 "s1_1" + MemberName 10(s2) 3 "bleh" + Name 12 "locals2" + Name 13 "s3" + MemberName 13(s3) 0 "s2_1" + MemberName 13(s3) 1 "i" + MemberName 13(s3) 2 "f" + MemberName 13(s3) 3 "s1_1" + Name 15 "foo3" + Name 36 "localFArray" + Name 40 "coord" + Name 49 "localIArray" + Name 68 "x" + Name 70 "localArray" + Name 75 "i" + Name 83 "a" + Name 89 "condition" + Name 97 "color" + Name 107 "gl_FragColor" + Name 127 "samp2D" + Name 133 "foo" + Name 134 "foo2" + Name 136 "uFloatArray" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFloat 32 + 8(s1): TypeStruct 6(int) 7(float) + 9: TypeVector 7(float) 4 + 10(s2): TypeStruct 6(int) 7(float) 8(s1) 9(fvec4) + 11: TypePointer Function 10(s2) + 13(s3): TypeStruct 10(s2) 6(int) 7(float) 8(s1) + 14: TypePointer UniformConstant 13(s3) + 15(foo3): 14(ptr) Variable UniformConstant + 16: 6(int) Constant 0 + 17: TypePointer UniformConstant 10(s2) + 20: TypePointer UniformConstant 6(int) + 23: TypeBool + 27: 6(int) Constant 2 + 28: 6(int) Constant 1 + 29: 7(float) Constant 1065353216 + 30: TypePointer Function 7(float) + 32: TypeInt 32 0 + 33: 32(int) Constant 16 + 34: TypeArray 7(float) 33 + 35: TypePointer Function 34 + 37: 6(int) Constant 4 + 38: TypeVector 7(float) 2 + 39: TypePointer Input 38(fvec2) + 40(coord): 39(ptr) Variable Input + 41: 32(int) Constant 0 + 42: TypePointer Input 7(float) + 46: 32(int) Constant 8 + 47: TypeArray 6(int) 46 + 48: TypePointer Function 47 + 52: TypePointer Function 6(int) + 69: 6(int) Constant 5 + 81: 6(int) Constant 16 + 85: 7(float) Constant 0 + 89(condition): 20(ptr) Variable UniformConstant + 95: 6(int) Constant 3 + 96: TypePointer Input 9(fvec4) + 97(color): 96(ptr) Variable Input + 99: TypePointer Function 9(fvec4) + 101: 32(int) Constant 1 + 104: 32(int) Constant 2 + 106: TypePointer Output 9(fvec4) +107(gl_FragColor): 106(ptr) Variable Output + 124: TypeImage 7(float) 2D sampled format:Unknown + 125: TypeSampledImage 124 + 126: TypePointer UniformConstant 125 + 127(samp2D): 126(ptr) Variable UniformConstant + 132: TypePointer UniformConstant 8(s1) + 133(foo): 132(ptr) Variable UniformConstant + 134(foo2): 17(ptr) Variable UniformConstant + 135: TypePointer UniformConstant 34 +136(uFloatArray): 135(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 12(locals2): 11(ptr) Variable Function + 36(localFArray): 35(ptr) Variable Function + 49(localIArray): 48(ptr) Variable Function + 68(x): 52(ptr) Variable Function + 70(localArray): 35(ptr) Variable Function + 75(i): 52(ptr) Variable Function + 83(a): 35(ptr) Variable Function + 18: 17(ptr) AccessChain 15(foo3) 16 + 19: 10(s2) Load 18 + Store 12(locals2) 19 + 21: 20(ptr) AccessChain 15(foo3) 16 16 + 22: 6(int) Load 21 + 24: 23(bool) SGreaterThan 22 16 + SelectionMerge 26 None + BranchConditional 24 25 54 + 25: Label + 31: 30(ptr) AccessChain 12(locals2) 27 28 + Store 31 29 + 43: 42(ptr) AccessChain 40(coord) 41 + 44: 7(float) Load 43 + 45: 30(ptr) AccessChain 36(localFArray) 37 + Store 45 44 + 50: 20(ptr) AccessChain 15(foo3) 16 16 + 51: 6(int) Load 50 + 53: 52(ptr) AccessChain 49(localIArray) 27 + Store 53 51 + Branch 26 + 54: Label + 55: 42(ptr) AccessChain 40(coord) 41 + 56: 7(float) Load 55 + 57: 30(ptr) AccessChain 12(locals2) 27 28 + Store 57 56 + 58: 30(ptr) AccessChain 36(localFArray) 37 + Store 58 29 + 59: 52(ptr) AccessChain 49(localIArray) 27 + Store 59 16 + Branch 26 + 26: Label + 60: 52(ptr) AccessChain 49(localIArray) 27 + 61: 6(int) Load 60 + 62: 23(bool) IEqual 61 16 + SelectionMerge 64 None + BranchConditional 62 63 64 + 63: Label + 65: 30(ptr) AccessChain 36(localFArray) 37 + 66: 7(float) Load 65 + 67: 7(float) FAdd 66 29 + Store 65 67 + Branch 64 + 64: Label + Store 68(x) 69 + 71: 6(int) Load 68(x) + 72: 42(ptr) AccessChain 40(coord) 41 + 73: 7(float) Load 72 + 74: 30(ptr) AccessChain 70(localArray) 71 + Store 74 73 + Store 75(i) 16 + Branch 79 + 76: Label + 84: 6(int) Load 75(i) + 86: 30(ptr) AccessChain 83(a) 84 + Store 86 85 + Branch 78 + 77: Label + 90: 6(int) Load 89(condition) + 91: 23(bool) IEqual 90 28 + SelectionMerge 93 None + BranchConditional 91 92 93 + 78: Label + 87: 6(int) Load 75(i) + 88: 6(int) IAdd 87 28 + Store 75(i) 88 + Branch 79 + 79: Label + 80: 6(int) Load 75(i) + 82: 23(bool) SLessThan 80 81 + LoopMerge 77 78 None + BranchConditional 82 76 77 + 92: Label + 94: 34 Load 70(localArray) + Store 83(a) 94 + Branch 93 + 93: Label + 98: 9(fvec4) Load 97(color) + 100: 99(ptr) AccessChain 12(locals2) 95 + Store 100 98 + 102: 42(ptr) AccessChain 40(coord) 101 + 103: 7(float) Load 102 + 105: 30(ptr) AccessChain 12(locals2) 95 104 + Store 105 103 + 108: 99(ptr) AccessChain 12(locals2) 95 + 109: 9(fvec4) Load 108 + 110: 30(ptr) AccessChain 36(localFArray) 37 + 111: 7(float) Load 110 + 112: 30(ptr) AccessChain 12(locals2) 27 28 + 113: 7(float) Load 112 + 114: 7(float) FAdd 111 113 + 115: 6(int) Load 68(x) + 116: 30(ptr) AccessChain 70(localArray) 115 + 117: 7(float) Load 116 + 118: 7(float) FAdd 114 117 + 119: 6(int) Load 68(x) + 120: 30(ptr) AccessChain 83(a) 119 + 121: 7(float) Load 120 + 122: 7(float) FAdd 118 121 + 123: 9(fvec4) VectorTimesScalar 109 122 + 128: 125 Load 127(samp2D) + 129: 38(fvec2) Load 40(coord) + 130: 9(fvec4) ImageSampleImplicitLod 128 129 + 131: 9(fvec4) FMul 123 130 + Store 107(gl_FragColor) 131 + Return + FunctionEnd diff --git a/Test/baseResults/spv.loops.frag.out b/Test/baseResults/spv.loops.frag.out index 5602e080..d6ec0a99 100755 --- a/Test/baseResults/spv.loops.frag.out +++ b/Test/baseResults/spv.loops.frag.out @@ -1,1098 +1,1086 @@ -spv.loops.frag -WARNING: 0:14: varying deprecated in version 130; may be removed in future release - - -Linked fragment stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 718 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 - Name 4 "main" - Name 9 "color" - Name 11 "BaseColor" - Name 50 "d" - Name 54 "bigColor" - Name 66 "bigColor1_1" - Name 97 "d2" - Name 105 "d3" - Name 109 "bigColor1_2" - Name 120 "bigColor1_3" - Name 126 "d4" - Name 137 "i" - Name 144 "Count" - Name 147 "bigColor2" - Name 165 "bigColor3" - Name 170 "i" - Name 184 "i" - Name 218 "i" - Name 239 "i" - Name 264 "i" - Name 298 "bigColor4" - Name 334 "d5" - Name 338 "bigColor5" - Name 355 "d6" - Name 367 "bigColor6" - Name 401 "d7" - Name 434 "bigColor7" - Name 457 "d8" - Name 497 "d9" - Name 527 "d10" - Name 535 "d11" - Name 545 "d12" - Name 569 "bigColor8" - Name 596 "gl_FragColor" - Name 603 "d14" - Name 608 "d15" - Name 626 "d16" - Name 664 "d17" - Name 670 "d18" - Name 701 "d13" - Name 702 "d19" - Name 703 "d20" - Name 704 "d21" - Name 705 "d22" - Name 706 "d23" - Name 707 "d24" - Name 708 "d25" - Name 709 "d26" - Name 710 "d27" - Name 711 "d28" - Name 712 "d29" - Name 713 "d30" - Name 714 "d31" - Name 715 "d32" - Name 716 "d33" - Name 717 "d34" - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Function 7(fvec4) - 10: TypePointer Input 7(fvec4) - 11(BaseColor): 10(ptr) Variable Input - 16: TypeBool - 17: 16(bool) ConstantTrue - 18: TypeInt 32 0 - 19: 18(int) Constant 0 - 20: TypePointer Function 6(float) - 23: 6(float) Constant 1051260355 - 27: 7(fvec4) ConstantComposite 23 23 23 23 - 33: 6(float) Constant 1059648963 - 37: 7(fvec4) ConstantComposite 33 33 33 33 - 49: TypePointer UniformConstant 6(float) - 50(d): 49(ptr) Variable UniformConstant - 53: TypePointer UniformConstant 7(fvec4) - 54(bigColor): 53(ptr) Variable UniformConstant - 61: 18(int) Constant 2 - 66(bigColor1_1): 53(ptr) Variable UniformConstant - 70: 18(int) Constant 3 - 86: 6(float) Constant 1109917696 - 89: 6(float) Constant 1065353216 - 97(d2): 49(ptr) Variable UniformConstant - 102: 18(int) Constant 1 - 105(d3): 49(ptr) Variable UniformConstant -109(bigColor1_2): 53(ptr) Variable UniformConstant -120(bigColor1_3): 53(ptr) Variable UniformConstant - 126(d4): 49(ptr) Variable UniformConstant - 135: TypeInt 32 1 - 136: TypePointer Function 135(int) - 138: 135(int) Constant 0 - 143: TypePointer UniformConstant 135(int) - 144(Count): 143(ptr) Variable UniformConstant - 147(bigColor2): 53(ptr) Variable UniformConstant - 152: 135(int) Constant 1 - 165(bigColor3): 53(ptr) Variable UniformConstant - 169: 16(bool) ConstantFalse - 175: 135(int) Constant 42 - 189: 135(int) Constant 100 - 193: 6(float) Constant 1101004800 - 223: 135(int) Constant 120 - 298(bigColor4): 53(ptr) Variable UniformConstant - 334(d5): 49(ptr) Variable UniformConstant - 338(bigColor5): 53(ptr) Variable UniformConstant - 355(d6): 49(ptr) Variable UniformConstant - 367(bigColor6): 53(ptr) Variable UniformConstant - 401(d7): 49(ptr) Variable UniformConstant - 429: 6(float) Constant 0 - 434(bigColor7): 53(ptr) Variable UniformConstant - 457(d8): 49(ptr) Variable UniformConstant - 477: 6(float) Constant 1073741824 - 497(d9): 49(ptr) Variable UniformConstant - 513: 6(float) Constant 1084227584 - 527(d10): 49(ptr) Variable UniformConstant - 535(d11): 49(ptr) Variable UniformConstant - 545(d12): 49(ptr) Variable UniformConstant - 567: 6(float) Constant 1092616192 - 569(bigColor8): 53(ptr) Variable UniformConstant - 595: TypePointer Output 7(fvec4) -596(gl_FragColor): 595(ptr) Variable Output - 603(d14): 49(ptr) Variable UniformConstant - 608(d15): 49(ptr) Variable UniformConstant - 626(d16): 49(ptr) Variable UniformConstant - 664(d17): 49(ptr) Variable UniformConstant - 670(d18): 49(ptr) Variable UniformConstant - 701(d13): 49(ptr) Variable UniformConstant - 702(d19): 49(ptr) Variable UniformConstant - 703(d20): 49(ptr) Variable UniformConstant - 704(d21): 49(ptr) Variable UniformConstant - 705(d22): 49(ptr) Variable UniformConstant - 706(d23): 49(ptr) Variable UniformConstant - 707(d24): 49(ptr) Variable UniformConstant - 708(d25): 49(ptr) Variable UniformConstant - 709(d26): 49(ptr) Variable UniformConstant - 710(d27): 49(ptr) Variable UniformConstant - 711(d28): 49(ptr) Variable UniformConstant - 712(d29): 49(ptr) Variable UniformConstant - 713(d30): 49(ptr) Variable UniformConstant - 714(d31): 49(ptr) Variable UniformConstant - 715(d32): 49(ptr) Variable UniformConstant - 716(d33): 49(ptr) Variable UniformConstant - 717(d34): 49(ptr) Variable UniformConstant - 4(main): 2 Function None 3 - 5: Label - 9(color): 8(ptr) Variable Function - 137(i): 136(ptr) Variable Function - 170(i): 136(ptr) Variable Function - 184(i): 136(ptr) Variable Function - 218(i): 136(ptr) Variable Function - 239(i): 136(ptr) Variable Function - 264(i): 136(ptr) Variable Function - 12: 7(fvec4) Load 11(BaseColor) - Store 9(color) 12 - Branch 13 - 13: Label - LoopMerge 14 13 None - BranchConditional 17 15 14 - 15: Label - 21: 20(ptr) AccessChain 9(color) 19 - 22: 6(float) Load 21 - 24: 16(bool) FOrdLessThan 22 23 - SelectionMerge 26 None - BranchConditional 24 25 26 - 25: Label - 28: 7(fvec4) Load 9(color) - 29: 7(fvec4) FAdd 28 27 - Store 9(color) 29 - Branch 14 - 26: Label - 31: 20(ptr) AccessChain 9(color) 19 - 32: 6(float) Load 31 - 34: 16(bool) FOrdLessThan 32 33 - SelectionMerge 36 None - BranchConditional 34 35 36 - 35: Label - 38: 7(fvec4) Load 9(color) - 39: 7(fvec4) FAdd 38 37 - Store 9(color) 39 - Branch 14 - 36: Label - 41: 7(fvec4) Load 9(color) - 42: 7(fvec4) FAdd 41 27 - Store 9(color) 42 - Branch 14 - 14: Label - Branch 44 - 44: Label - 47: 20(ptr) AccessChain 9(color) 19 - 48: 6(float) Load 47 - 51: 6(float) Load 50(d) - 52: 16(bool) FOrdLessThan 48 51 - LoopMerge 45 44 None - BranchConditional 52 46 45 - 46: Label - 55: 7(fvec4) Load 54(bigColor) - 56: 7(fvec4) Load 9(color) - 57: 7(fvec4) FAdd 56 55 - Store 9(color) 57 - Branch 44 - 45: Label - Branch 58 - 58: Label - 62: 20(ptr) AccessChain 9(color) 61 - 63: 6(float) Load 62 - 64: 6(float) Load 50(d) - 65: 16(bool) FOrdLessThan 63 64 - LoopMerge 59 58 None - BranchConditional 65 60 59 - 60: Label - 67: 7(fvec4) Load 66(bigColor1_1) - 68: 7(fvec4) Load 9(color) - 69: 7(fvec4) FAdd 68 67 - Store 9(color) 69 - 71: 20(ptr) AccessChain 9(color) 70 - 72: 6(float) Load 71 - 73: 6(float) Load 50(d) - 74: 16(bool) FOrdLessThan 72 73 - SelectionMerge 76 None - BranchConditional 74 75 76 - 75: Label - Branch 58 - 76: Label - 78: 7(fvec4) Load 66(bigColor1_1) - 79: 7(fvec4) Load 9(color) - 80: 7(fvec4) FAdd 79 78 - Store 9(color) 80 - Branch 58 - 59: Label - Branch 81 - 81: Label - 84: 20(ptr) AccessChain 9(color) 19 - 85: 6(float) Load 84 - 87: 16(bool) FOrdLessThan 85 86 - LoopMerge 82 81 None - BranchConditional 87 83 82 - 83: Label - 88: 7(fvec4) Load 9(color) - 90: 7(fvec4) CompositeConstruct 89 89 89 89 - 91: 7(fvec4) FAdd 88 90 - Store 9(color) 91 - Branch 81 - 82: Label - Branch 92 - 92: Label - 95: 20(ptr) AccessChain 9(color) 70 - 96: 6(float) Load 95 - 98: 6(float) Load 97(d2) - 99: 16(bool) FOrdLessThan 96 98 - SelectionMerge 101 None - BranchConditional 99 100 101 - 100: Label - 103: 20(ptr) AccessChain 9(color) 102 - 104: 6(float) Load 103 - 106: 6(float) Load 105(d3) - 107: 16(bool) FOrdLessThan 104 106 - Branch 101 - 101: Label - 108: 16(bool) Phi 99 92 107 100 - LoopMerge 93 92 None - BranchConditional 108 94 93 - 94: Label - 110: 7(fvec4) Load 109(bigColor1_2) - 111: 7(fvec4) Load 9(color) - 112: 7(fvec4) FAdd 111 110 - Store 9(color) 112 - Branch 92 - 93: Label - Branch 113 - 113: Label - 116: 20(ptr) AccessChain 9(color) 61 - 117: 6(float) Load 116 - 118: 6(float) Load 105(d3) - 119: 16(bool) FOrdLessThan 117 118 - LoopMerge 114 113 None - BranchConditional 119 115 114 - 115: Label - 121: 7(fvec4) Load 120(bigColor1_3) - 122: 7(fvec4) Load 9(color) - 123: 7(fvec4) FAdd 122 121 - Store 9(color) 123 - 124: 20(ptr) AccessChain 9(color) 102 - 125: 6(float) Load 124 - 127: 6(float) Load 126(d4) - 128: 16(bool) FOrdLessThan 125 127 - SelectionMerge 130 None - BranchConditional 128 129 130 - 129: Label - Branch 114 - 130: Label - 132: 7(fvec4) Load 120(bigColor1_3) - 133: 7(fvec4) Load 9(color) - 134: 7(fvec4) FAdd 133 132 - Store 9(color) 134 - Branch 113 - 114: Label - Store 137(i) 138 - Branch 139 - 139: Label - 142: 135(int) Load 137(i) - 145: 135(int) Load 144(Count) - 146: 16(bool) SLessThan 142 145 - LoopMerge 140 139 None - BranchConditional 146 141 140 - 141: Label - 148: 7(fvec4) Load 147(bigColor2) - 149: 7(fvec4) Load 9(color) - 150: 7(fvec4) FAdd 149 148 - Store 9(color) 150 - 151: 135(int) Load 137(i) - 153: 135(int) IAdd 151 152 - Store 137(i) 153 - Branch 139 - 140: Label - Branch 154 - 154: Label - 157: 16(bool) Phi 17 140 169 156 - LoopMerge 155 154 None - Branch 158 - 158: Label - SelectionMerge 156 None - BranchConditional 157 156 159 - 159: Label - 160: 20(ptr) AccessChain 9(color) 19 - 161: 6(float) Load 160 - 162: 6(float) Load 97(d2) - 163: 16(bool) FOrdLessThan 161 162 - SelectionMerge 164 None - BranchConditional 163 164 155 - 164: Label - Branch 156 - 156: Label - 166: 7(fvec4) Load 165(bigColor3) - 167: 7(fvec4) Load 9(color) - 168: 7(fvec4) FAdd 167 166 - Store 9(color) 168 - Branch 154 - 155: Label - Store 170(i) 138 - Branch 171 - 171: Label - 174: 135(int) Load 170(i) - 176: 16(bool) SLessThan 174 175 - LoopMerge 172 171 None - BranchConditional 176 173 172 - 173: Label - 177: 6(float) Load 105(d3) - 178: 20(ptr) AccessChain 9(color) 61 - 179: 6(float) Load 178 - 180: 6(float) FAdd 179 177 - 181: 20(ptr) AccessChain 9(color) 61 - Store 181 180 - 182: 135(int) Load 170(i) - 183: 135(int) IAdd 182 152 - Store 170(i) 183 - Branch 171 - 172: Label - Store 184(i) 138 - Branch 185 - 185: Label - 188: 135(int) Load 184(i) - 190: 16(bool) SLessThan 188 189 - LoopMerge 186 185 None - BranchConditional 190 187 186 - 187: Label - 191: 20(ptr) AccessChain 9(color) 61 - 192: 6(float) Load 191 - 194: 16(bool) FOrdLessThan 192 193 - SelectionMerge 196 None - BranchConditional 194 195 200 - 195: Label - 197: 20(ptr) AccessChain 9(color) 19 - 198: 6(float) Load 197 - 199: 6(float) FAdd 198 89 - Store 197 199 - Branch 196 - 200: Label - 201: 20(ptr) AccessChain 9(color) 102 - 202: 6(float) Load 201 - 203: 6(float) FAdd 202 89 - Store 201 203 - Branch 196 - 196: Label - 204: 20(ptr) AccessChain 9(color) 70 - 205: 6(float) Load 204 - 206: 16(bool) FOrdLessThan 205 193 - SelectionMerge 208 None - BranchConditional 206 207 208 - 207: Label - 209: 20(ptr) AccessChain 9(color) 61 - 210: 6(float) Load 209 - 211: 20(ptr) AccessChain 9(color) 102 - 212: 6(float) Load 211 - 213: 16(bool) FOrdGreaterThan 210 212 - SelectionMerge 215 None - BranchConditional 213 214 215 - 214: Label - Branch 215 - 215: Label - Branch 208 - 208: Label - 216: 135(int) Load 184(i) - 217: 135(int) IAdd 216 152 - Store 184(i) 217 - Branch 185 - 186: Label - Store 218(i) 138 - Branch 219 - 219: Label - 222: 135(int) Load 218(i) - 224: 16(bool) SLessThan 222 223 - LoopMerge 220 219 None - BranchConditional 224 221 220 - 221: Label - 225: 20(ptr) AccessChain 9(color) 61 - 226: 6(float) Load 225 - 227: 16(bool) FOrdLessThan 226 193 - SelectionMerge 229 None - BranchConditional 227 228 233 - 228: Label - 230: 20(ptr) AccessChain 9(color) 19 - 231: 6(float) Load 230 - 232: 6(float) FAdd 231 89 - Store 230 232 - Branch 229 - 233: Label - 234: 20(ptr) AccessChain 9(color) 102 - 235: 6(float) Load 234 - 236: 6(float) FAdd 235 89 - Store 234 236 - Branch 229 - 229: Label - 237: 135(int) Load 218(i) - 238: 135(int) IAdd 237 152 - Store 218(i) 238 - Branch 219 - 220: Label - Store 239(i) 138 - Branch 240 - 240: Label - 243: 135(int) Load 239(i) - 244: 16(bool) SLessThan 243 175 - LoopMerge 241 240 None - BranchConditional 244 242 241 - 242: Label - 245: 6(float) Load 105(d3) - 246: 20(ptr) AccessChain 9(color) 61 - 247: 6(float) Load 246 - 248: 6(float) FAdd 247 245 - 249: 20(ptr) AccessChain 9(color) 61 - Store 249 248 - 250: 20(ptr) AccessChain 9(color) 19 - 251: 6(float) Load 250 - 252: 6(float) Load 126(d4) - 253: 16(bool) FOrdLessThan 251 252 - SelectionMerge 255 None - BranchConditional 253 254 255 - 254: Label - 256: 135(int) Load 239(i) - 257: 135(int) IAdd 256 152 - Store 239(i) 257 - Branch 240 - 255: Label - 259: 20(ptr) AccessChain 9(color) 70 - 260: 6(float) Load 259 - 261: 6(float) FAdd 260 89 - Store 259 261 - 262: 135(int) Load 239(i) - 263: 135(int) IAdd 262 152 - Store 239(i) 263 - Branch 240 - 241: Label - Store 264(i) 138 - Branch 265 - 265: Label - 268: 135(int) Load 264(i) - 269: 16(bool) SLessThan 268 175 - LoopMerge 266 265 None - BranchConditional 269 267 266 - 267: Label - 270: 6(float) Load 105(d3) - 271: 20(ptr) AccessChain 9(color) 61 - 272: 6(float) Load 271 - 273: 6(float) FAdd 272 270 - 274: 20(ptr) AccessChain 9(color) 61 - Store 274 273 - 275: 20(ptr) AccessChain 9(color) 19 - 276: 6(float) Load 275 - 277: 6(float) Load 126(d4) - 278: 16(bool) FOrdLessThan 276 277 - SelectionMerge 280 None - BranchConditional 278 279 280 - 279: Label - Branch 266 - 280: Label - 282: 20(ptr) AccessChain 9(color) 70 - 283: 6(float) Load 282 - 284: 6(float) FAdd 283 89 - Store 282 284 - 285: 135(int) Load 264(i) - 286: 135(int) IAdd 285 152 - Store 264(i) 286 - Branch 265 - 266: Label - Branch 287 - 287: Label - 290: 16(bool) Phi 17 266 169 306 169 314 - LoopMerge 288 287 None - Branch 291 - 291: Label - SelectionMerge 289 None - BranchConditional 290 289 292 - 292: Label - 293: 20(ptr) AccessChain 9(color) 61 - 294: 6(float) Load 293 - 295: 6(float) Load 126(d4) - 296: 16(bool) FOrdLessThan 294 295 - SelectionMerge 297 None - BranchConditional 296 297 288 - 297: Label - Branch 289 - 289: Label - 299: 7(fvec4) Load 298(bigColor4) - 300: 7(fvec4) Load 9(color) - 301: 7(fvec4) FAdd 300 299 - Store 9(color) 301 - 302: 20(ptr) AccessChain 9(color) 19 - 303: 6(float) Load 302 - 304: 6(float) Load 126(d4) - 305: 16(bool) FOrdLessThan 303 304 - SelectionMerge 307 None - BranchConditional 305 306 307 - 306: Label - Branch 287 - 307: Label - 309: 20(ptr) AccessChain 9(color) 102 - 310: 6(float) Load 309 - 311: 6(float) Load 126(d4) - 312: 16(bool) FOrdLessThan 310 311 - SelectionMerge 314 None - BranchConditional 312 313 320 - 313: Label - 315: 6(float) Load 126(d4) - 316: 20(ptr) AccessChain 9(color) 102 - 317: 6(float) Load 316 - 318: 6(float) FAdd 317 315 - 319: 20(ptr) AccessChain 9(color) 102 - Store 319 318 - Branch 314 - 320: Label - 321: 6(float) Load 126(d4) - 322: 20(ptr) AccessChain 9(color) 19 - 323: 6(float) Load 322 - 324: 6(float) FAdd 323 321 - 325: 20(ptr) AccessChain 9(color) 19 - Store 325 324 - Branch 314 - 314: Label - Branch 287 - 288: Label - Branch 326 - 326: Label - 329: 16(bool) Phi 17 288 169 347 - LoopMerge 327 326 None - Branch 330 - 330: Label - SelectionMerge 328 None - BranchConditional 329 328 331 - 331: Label - 332: 20(ptr) AccessChain 9(color) 19 - 333: 6(float) Load 332 - 335: 6(float) Load 334(d5) - 336: 16(bool) FOrdLessThan 333 335 - SelectionMerge 337 None - BranchConditional 336 337 327 - 337: Label - Branch 328 - 328: Label - 339: 7(fvec4) Load 338(bigColor5) - 340: 7(fvec4) Load 9(color) - 341: 7(fvec4) FAdd 340 339 - Store 9(color) 341 - 342: 20(ptr) AccessChain 9(color) 102 - 343: 6(float) Load 342 - 344: 6(float) Load 334(d5) - 345: 16(bool) FOrdLessThan 343 344 - SelectionMerge 347 None - BranchConditional 345 346 347 - 346: Label - 348: 6(float) Load 334(d5) - 349: 20(ptr) AccessChain 9(color) 102 - 350: 6(float) Load 349 - 351: 6(float) FAdd 350 348 - 352: 20(ptr) AccessChain 9(color) 102 - Store 352 351 - Branch 347 - 347: Label - Branch 326 - 327: Label - 353: 20(ptr) AccessChain 9(color) 19 - 354: 6(float) Load 353 - 356: 6(float) Load 355(d6) - 357: 16(bool) FOrdLessThan 354 356 - SelectionMerge 359 None - BranchConditional 357 358 371 - 358: Label - Branch 360 - 360: Label - 363: 20(ptr) AccessChain 9(color) 102 - 364: 6(float) Load 363 - 365: 6(float) Load 355(d6) - 366: 16(bool) FOrdLessThan 364 365 - LoopMerge 361 360 None - BranchConditional 366 362 361 - 362: Label - 368: 7(fvec4) Load 367(bigColor6) - 369: 7(fvec4) Load 9(color) - 370: 7(fvec4) FAdd 369 368 - Store 9(color) 370 - Branch 360 - 361: Label - Branch 359 - 371: Label - Branch 372 - 372: Label - 375: 20(ptr) AccessChain 9(color) 61 - 376: 6(float) Load 375 - 377: 6(float) Load 355(d6) - 378: 16(bool) FOrdLessThan 376 377 - LoopMerge 373 372 None - BranchConditional 378 374 373 - 374: Label - 379: 49(ptr) AccessChain 367(bigColor6) 61 - 380: 6(float) Load 379 - 381: 20(ptr) AccessChain 9(color) 61 - 382: 6(float) Load 381 - 383: 6(float) FAdd 382 380 - 384: 20(ptr) AccessChain 9(color) 61 - Store 384 383 - Branch 372 - 373: Label - Branch 359 - 359: Label - 385: 20(ptr) AccessChain 9(color) 19 - 386: 6(float) Load 385 - 387: 6(float) Load 355(d6) - 388: 16(bool) FOrdLessThan 386 387 - SelectionMerge 390 None - BranchConditional 388 389 407 - 389: Label - Branch 391 - 391: Label - 394: 20(ptr) AccessChain 9(color) 102 - 395: 6(float) Load 394 - 396: 6(float) Load 355(d6) - 397: 16(bool) FOrdLessThan 395 396 - LoopMerge 392 391 None - BranchConditional 397 393 392 - 393: Label - 398: 7(fvec4) Load 367(bigColor6) - 399: 7(fvec4) Load 9(color) - 400: 7(fvec4) FAdd 399 398 - Store 9(color) 400 - 402: 6(float) Load 401(d7) - 403: 16(bool) FOrdLessThan 402 89 - SelectionMerge 405 None - BranchConditional 403 404 405 - 404: Label - Branch 392 - 405: Label - Branch 391 - 392: Label - Branch 390 - 407: Label - Branch 408 - 408: Label - 411: 20(ptr) AccessChain 9(color) 61 - 412: 6(float) Load 411 - 413: 6(float) Load 355(d6) - 414: 16(bool) FOrdLessThan 412 413 - LoopMerge 409 408 None - BranchConditional 414 410 409 - 410: Label - 415: 49(ptr) AccessChain 367(bigColor6) 61 - 416: 6(float) Load 415 - 417: 20(ptr) AccessChain 9(color) 61 - 418: 6(float) Load 417 - 419: 6(float) FAdd 418 416 - 420: 20(ptr) AccessChain 9(color) 61 - Store 420 419 - Branch 408 - 409: Label - Branch 390 - 390: Label - Branch 421 - 421: Label - 424: 16(bool) Phi 17 390 169 441 - LoopMerge 422 421 None - Branch 425 - 425: Label - SelectionMerge 423 None - BranchConditional 424 423 426 - 426: Label - SelectionMerge 427 None - BranchConditional 17 427 422 - 427: Label - Branch 423 - 423: Label - 428: 6(float) Load 401(d7) - 430: 16(bool) FOrdLessThan 428 429 - SelectionMerge 432 None - BranchConditional 430 431 432 - 431: Label - Branch 422 - 432: Label - 435: 7(fvec4) Load 434(bigColor7) - 436: 7(fvec4) Load 9(color) - 437: 7(fvec4) FAdd 436 435 - Store 9(color) 437 - 438: 6(float) Load 401(d7) - 439: 16(bool) FOrdLessThan 438 89 - SelectionMerge 441 None - BranchConditional 439 440 441 - 440: Label - 442: 20(ptr) AccessChain 9(color) 61 - 443: 6(float) Load 442 - 444: 6(float) FAdd 443 89 - Store 442 444 - Branch 422 - 441: Label - 446: 7(fvec4) Load 11(BaseColor) - 447: 7(fvec4) Load 9(color) - 448: 7(fvec4) FAdd 447 446 - Store 9(color) 448 - Branch 421 - 422: Label - Branch 449 - 449: Label - 452: 16(bool) Phi 17 422 169 472 - LoopMerge 450 449 None - Branch 453 - 453: Label - SelectionMerge 451 None - BranchConditional 452 451 454 - 454: Label - 455: 20(ptr) AccessChain 9(color) 61 - 456: 6(float) Load 455 - 458: 6(float) Load 457(d8) - 459: 16(bool) FOrdLessThan 456 458 - SelectionMerge 460 None - BranchConditional 459 460 450 - 460: Label - Branch 451 - 451: Label - 461: 6(float) Load 457(d8) - 462: 16(bool) FOrdLessThan 461 429 - SelectionMerge 464 None - BranchConditional 462 463 464 - 463: Label - Branch 450 - 464: Label - 466: 7(fvec4) Load 434(bigColor7) - 467: 7(fvec4) Load 9(color) - 468: 7(fvec4) FAdd 467 466 - Store 9(color) 468 - 469: 6(float) Load 457(d8) - 470: 16(bool) FOrdLessThan 469 89 - SelectionMerge 472 None - BranchConditional 470 471 472 - 471: Label - 473: 20(ptr) AccessChain 9(color) 61 - 474: 6(float) Load 473 - 475: 6(float) FAdd 474 89 - Store 473 475 - 476: 6(float) Load 457(d8) - 478: 16(bool) FOrdLessThan 476 477 - SelectionMerge 480 None - BranchConditional 478 479 484 - 479: Label - 481: 20(ptr) AccessChain 9(color) 102 - 482: 6(float) Load 481 - 483: 6(float) FAdd 482 89 - Store 481 483 - Branch 480 - 484: Label - 485: 20(ptr) AccessChain 9(color) 19 - 486: 6(float) Load 485 - 487: 6(float) FAdd 486 89 - Store 485 487 - Branch 480 - 480: Label - Branch 450 - 472: Label - 489: 7(fvec4) Load 11(BaseColor) - 490: 7(fvec4) Load 9(color) - 491: 7(fvec4) FAdd 490 489 - Store 9(color) 491 - Branch 449 - 450: Label - Branch 492 - 492: Label - 495: 20(ptr) AccessChain 9(color) 70 - 496: 6(float) Load 495 - 498: 6(float) Load 497(d9) - 499: 16(bool) FOrdLessThan 496 498 - LoopMerge 493 492 None - BranchConditional 499 494 493 - 494: Label - 500: 6(float) Load 497(d9) - 501: 6(float) Load 457(d8) - 502: 16(bool) FOrdGreaterThan 500 501 - SelectionMerge 504 None - BranchConditional 502 503 504 - 503: Label - 505: 20(ptr) AccessChain 9(color) 19 - 506: 6(float) Load 505 - 507: 6(float) Load 401(d7) - 508: 16(bool) FOrdLessThanEqual 506 507 - SelectionMerge 510 None - BranchConditional 508 509 510 - 509: Label - 511: 20(ptr) AccessChain 9(color) 61 - 512: 6(float) Load 511 - 514: 16(bool) FOrdEqual 512 513 - SelectionMerge 516 None - BranchConditional 514 515 520 - 515: Label - 517: 20(ptr) AccessChain 9(color) 70 - 518: 6(float) Load 517 - 519: 6(float) FAdd 518 89 - Store 517 519 - Branch 516 - 520: Label - Branch 493 - 516: Label - Branch 510 - 510: Label - Branch 504 - 504: Label - Branch 492 - 493: Label - Branch 522 - 522: Label - 525: 20(ptr) AccessChain 9(color) 61 - 526: 6(float) Load 525 - 528: 6(float) Load 527(d10) - 529: 16(bool) FOrdLessThan 526 528 - LoopMerge 523 522 None - BranchConditional 529 524 523 - 524: Label - 530: 20(ptr) AccessChain 9(color) 102 - 531: 6(float) Load 530 - 532: 6(float) FAdd 531 89 - Store 530 532 - 533: 20(ptr) AccessChain 9(color) 102 - 534: 6(float) Load 533 - 536: 6(float) Load 535(d11) - 537: 16(bool) FOrdLessThan 534 536 - SelectionMerge 539 None - BranchConditional 537 538 539 - 538: Label - 540: 20(ptr) AccessChain 9(color) 61 - 541: 6(float) Load 540 - 542: 6(float) FAdd 541 89 - Store 540 542 - 543: 20(ptr) AccessChain 9(color) 70 - 544: 6(float) Load 543 - 546: 6(float) Load 545(d12) - 547: 16(bool) FOrdLessThan 544 546 - SelectionMerge 549 None - BranchConditional 547 548 553 - 548: Label - 550: 20(ptr) AccessChain 9(color) 70 - 551: 6(float) Load 550 - 552: 6(float) FAdd 551 89 - Store 550 552 - Branch 549 - 553: Label - 554: 20(ptr) AccessChain 9(color) 19 - 555: 6(float) Load 554 - 556: 6(float) FAdd 555 89 - Store 554 556 - Branch 549 - 549: Label - Branch 522 - 539: Label - 558: 7(fvec4) Load 9(color) - 559: 7(fvec4) CompositeConstruct 89 89 89 89 - 560: 7(fvec4) FAdd 558 559 - Store 9(color) 560 - Branch 523 - 523: Label - Branch 562 - 562: Label - 565: 20(ptr) AccessChain 9(color) 19 - 566: 6(float) Load 565 - 568: 16(bool) FOrdLessThan 566 567 - LoopMerge 563 562 None - BranchConditional 568 564 563 - 564: Label - 570: 7(fvec4) Load 569(bigColor8) - 571: 7(fvec4) Load 9(color) - 572: 7(fvec4) FAdd 571 570 - Store 9(color) 572 - 573: 20(ptr) AccessChain 9(color) 61 - 574: 6(float) Load 573 - 575: 6(float) Load 457(d8) - 576: 16(bool) FOrdLessThan 574 575 - SelectionMerge 578 None - BranchConditional 576 577 578 - 577: Label - 579: 20(ptr) AccessChain 9(color) 70 - 580: 6(float) Load 579 - 581: 6(float) Load 355(d6) - 582: 16(bool) FOrdLessThan 580 581 - SelectionMerge 584 None - BranchConditional 582 583 584 - 583: Label - Branch 562 - 584: Label - Branch 578 - 578: Label - 586: 49(ptr) AccessChain 569(bigColor8) 19 - 587: 6(float) Load 586 - 588: 20(ptr) AccessChain 9(color) 102 - 589: 6(float) Load 588 - 590: 6(float) FAdd 589 587 - 591: 20(ptr) AccessChain 9(color) 102 - Store 591 590 - Branch 562 - 563: Label - 592: 7(fvec4) Load 9(color) - 593: 7(fvec4) CompositeConstruct 89 89 89 89 - 594: 7(fvec4) FAdd 592 593 - Store 9(color) 594 - 597: 7(fvec4) Load 9(color) - Store 596(gl_FragColor) 597 - Branch 598 - 598: Label - 601: 20(ptr) AccessChain 9(color) 19 - 602: 6(float) Load 601 - 604: 6(float) Load 603(d14) - 605: 16(bool) FOrdLessThan 602 604 - LoopMerge 599 598 None - BranchConditional 605 600 599 - 600: Label - 606: 20(ptr) AccessChain 9(color) 102 - 607: 6(float) Load 606 - 609: 6(float) Load 608(d15) - 610: 16(bool) FOrdLessThan 607 609 - SelectionMerge 612 None - BranchConditional 610 611 614 - 611: Label - Return - 614: Label - 615: 7(fvec4) Load 9(color) - 616: 7(fvec4) CompositeConstruct 89 89 89 89 - 617: 7(fvec4) FAdd 615 616 - Store 9(color) 617 - Branch 612 - 612: Label - Branch 598 - 599: Label - 618: 7(fvec4) Load 9(color) - 619: 7(fvec4) CompositeConstruct 89 89 89 89 - 620: 7(fvec4) FAdd 618 619 - Store 9(color) 620 - Branch 621 - 621: Label - 624: 20(ptr) AccessChain 9(color) 70 - 625: 6(float) Load 624 - 627: 6(float) Load 626(d16) - 628: 16(bool) FOrdLessThan 625 627 - LoopMerge 622 621 None - BranchConditional 628 623 622 - 623: Label - 629: 20(ptr) AccessChain 9(color) 70 - 630: 6(float) Load 629 - 631: 6(float) FAdd 630 89 - Store 629 631 - Branch 621 - 622: Label - Branch 632 - 632: Label - 635: 20(ptr) AccessChain 9(color) 70 - 636: 6(float) Load 635 - 637: 6(float) Load 97(d2) - 638: 16(bool) FOrdLessThan 636 637 - SelectionMerge 640 None - BranchConditional 638 639 640 - 639: Label - 641: 20(ptr) AccessChain 9(color) 102 - 642: 6(float) Load 641 - 643: 6(float) Load 105(d3) - 644: 16(bool) FOrdLessThan 642 643 - Branch 640 - 640: Label - 645: 16(bool) Phi 638 632 644 639 - LoopMerge 633 632 None - BranchConditional 645 634 633 - 634: Label - 646: 7(fvec4) Load 109(bigColor1_2) - 647: 7(fvec4) Load 9(color) - 648: 7(fvec4) FAdd 647 646 - Store 9(color) 648 - 649: 20(ptr) AccessChain 9(color) 61 - 650: 6(float) Load 649 - 651: 6(float) Load 105(d3) - 652: 16(bool) FOrdLessThan 650 651 - SelectionMerge 654 None - BranchConditional 652 653 654 - 653: Label - Return - 654: Label - Branch 632 - 633: Label - Branch 656 - 656: Label - 659: 16(bool) Phi 17 633 169 674 - LoopMerge 657 656 None - Branch 660 - 660: Label - SelectionMerge 658 None - BranchConditional 659 658 661 - 661: Label - 662: 20(ptr) AccessChain 9(color) 19 - 663: 6(float) Load 662 - 665: 6(float) Load 664(d17) - 666: 16(bool) FOrdLessThan 663 665 - SelectionMerge 667 None - BranchConditional 666 667 657 - 667: Label - Branch 658 - 658: Label - 668: 20(ptr) AccessChain 9(color) 102 - 669: 6(float) Load 668 - 671: 6(float) Load 670(d18) - 672: 16(bool) FOrdLessThan 669 671 - SelectionMerge 674 None - BranchConditional 672 673 674 - 673: Label - Return - 674: Label - 676: 7(fvec4) Load 9(color) - 677: 7(fvec4) CompositeConstruct 89 89 89 89 - 678: 7(fvec4) FAdd 676 677 - Store 9(color) 678 - Branch 656 - 657: Label - Branch 679 - 679: Label - 682: 20(ptr) AccessChain 9(color) 102 - 683: 6(float) Load 682 - 684: 6(float) Load 626(d16) - 685: 16(bool) FOrdLessThan 683 684 - LoopMerge 680 679 None - BranchConditional 685 681 680 - 681: Label - 686: 20(ptr) AccessChain 9(color) 70 - 687: 6(float) Load 686 - 688: 6(float) Load 626(d16) - 689: 16(bool) FOrdLessThan 687 688 - SelectionMerge 691 None - BranchConditional 689 690 693 - 690: Label - Kill - 693: Label - 694: 7(fvec4) Load 9(color) - 695: 7(fvec4) CompositeConstruct 89 89 89 89 - 696: 7(fvec4) FAdd 694 695 - Store 9(color) 696 - Branch 691 - 691: Label - Branch 679 - 680: Label - 697: 7(fvec4) Load 9(color) - 698: 7(fvec4) CompositeConstruct 89 89 89 89 - 699: 7(fvec4) FAdd 697 698 - Store 9(color) 699 - 700: 7(fvec4) Load 9(color) - Store 596(gl_FragColor) 700 - Return - FunctionEnd +spv.loops.frag +WARNING: 0:14: varying deprecated in version 130; may be removed in future release + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 714 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 + ExecutionMode 4 OriginLowerLeft + Source GLSL 130 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 52 "d" + Name 56 "bigColor" + Name 69 "bigColor1_1" + Name 102 "d2" + Name 110 "d3" + Name 114 "bigColor1_2" + Name 126 "bigColor1_3" + Name 132 "d4" + Name 143 "i" + Name 151 "Count" + Name 154 "bigColor2" + Name 164 "bigColor3" + Name 172 "i" + Name 187 "i" + Name 222 "i" + Name 244 "i" + Name 268 "i" + Name 295 "bigColor4" + Name 330 "bigColor5" + Name 336 "d5" + Name 352 "d6" + Name 365 "bigColor6" + Name 401 "d7" + Name 431 "bigColor7" + Name 449 "d8" + Name 491 "d9" + Name 522 "d10" + Name 530 "d11" + Name 540 "d12" + Name 565 "bigColor8" + Name 592 "gl_FragColor" + Name 600 "d14" + Name 605 "d15" + Name 624 "d16" + Name 660 "d18" + Name 671 "d17" + Name 697 "d13" + Name 698 "d19" + Name 699 "d20" + Name 700 "d21" + Name 701 "d22" + Name 702 "d23" + Name 703 "d24" + Name 704 "d25" + Name 705 "d26" + Name 706 "d27" + Name 707 "d28" + Name 708 "d29" + Name 709 "d30" + Name 710 "d31" + Name 711 "d32" + Name 712 "d33" + Name 713 "d34" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 17: TypeBool + 18: 17(bool) ConstantTrue + 19: TypeInt 32 0 + 20: 19(int) Constant 0 + 21: TypePointer Function 6(float) + 24: 6(float) Constant 1051260355 + 28: 7(fvec4) ConstantComposite 24 24 24 24 + 34: 6(float) Constant 1059648963 + 38: 7(fvec4) ConstantComposite 34 34 34 34 + 51: TypePointer UniformConstant 6(float) + 52(d): 51(ptr) Variable UniformConstant + 55: TypePointer UniformConstant 7(fvec4) + 56(bigColor): 55(ptr) Variable UniformConstant + 64: 19(int) Constant 2 + 69(bigColor1_1): 55(ptr) Variable UniformConstant + 73: 19(int) Constant 3 + 90: 6(float) Constant 1109917696 + 93: 6(float) Constant 1065353216 + 102(d2): 51(ptr) Variable UniformConstant + 107: 19(int) Constant 1 + 110(d3): 51(ptr) Variable UniformConstant +114(bigColor1_2): 55(ptr) Variable UniformConstant +126(bigColor1_3): 55(ptr) Variable UniformConstant + 132(d4): 51(ptr) Variable UniformConstant + 141: TypeInt 32 1 + 142: TypePointer Function 141(int) + 144: 141(int) Constant 0 + 150: TypePointer UniformConstant 141(int) + 151(Count): 150(ptr) Variable UniformConstant + 154(bigColor2): 55(ptr) Variable UniformConstant + 159: 141(int) Constant 1 + 164(bigColor3): 55(ptr) Variable UniformConstant + 178: 141(int) Constant 42 + 193: 141(int) Constant 100 + 197: 6(float) Constant 1101004800 + 228: 141(int) Constant 120 + 295(bigColor4): 55(ptr) Variable UniformConstant + 330(bigColor5): 55(ptr) Variable UniformConstant + 336(d5): 51(ptr) Variable UniformConstant + 352(d6): 51(ptr) Variable UniformConstant + 365(bigColor6): 55(ptr) Variable UniformConstant + 401(d7): 51(ptr) Variable UniformConstant + 426: 6(float) Constant 0 + 431(bigColor7): 55(ptr) Variable UniformConstant + 449(d8): 51(ptr) Variable UniformConstant + 466: 6(float) Constant 1073741824 + 491(d9): 51(ptr) Variable UniformConstant + 507: 6(float) Constant 1084227584 + 522(d10): 51(ptr) Variable UniformConstant + 530(d11): 51(ptr) Variable UniformConstant + 540(d12): 51(ptr) Variable UniformConstant + 563: 6(float) Constant 1092616192 + 565(bigColor8): 55(ptr) Variable UniformConstant + 591: TypePointer Output 7(fvec4) +592(gl_FragColor): 591(ptr) Variable Output + 600(d14): 51(ptr) Variable UniformConstant + 605(d15): 51(ptr) Variable UniformConstant + 624(d16): 51(ptr) Variable UniformConstant + 660(d18): 51(ptr) Variable UniformConstant + 671(d17): 51(ptr) Variable UniformConstant + 697(d13): 51(ptr) Variable UniformConstant + 698(d19): 51(ptr) Variable UniformConstant + 699(d20): 51(ptr) Variable UniformConstant + 700(d21): 51(ptr) Variable UniformConstant + 701(d22): 51(ptr) Variable UniformConstant + 702(d23): 51(ptr) Variable UniformConstant + 703(d24): 51(ptr) Variable UniformConstant + 704(d25): 51(ptr) Variable UniformConstant + 705(d26): 51(ptr) Variable UniformConstant + 706(d27): 51(ptr) Variable UniformConstant + 707(d28): 51(ptr) Variable UniformConstant + 708(d29): 51(ptr) Variable UniformConstant + 709(d30): 51(ptr) Variable UniformConstant + 710(d31): 51(ptr) Variable UniformConstant + 711(d32): 51(ptr) Variable UniformConstant + 712(d33): 51(ptr) Variable UniformConstant + 713(d34): 51(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 143(i): 142(ptr) Variable Function + 172(i): 142(ptr) Variable Function + 187(i): 142(ptr) Variable Function + 222(i): 142(ptr) Variable Function + 244(i): 142(ptr) Variable Function + 268(i): 142(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Branch 16 + 13: Label + 22: 21(ptr) AccessChain 9(color) 20 + 23: 6(float) Load 22 + 25: 17(bool) FOrdLessThan 23 24 + SelectionMerge 27 None + BranchConditional 25 26 27 + 14: Label + Branch 48 + 15: Label + Branch 16 + 16: Label + LoopMerge 14 15 None + BranchConditional 18 13 14 + 26: Label + 29: 7(fvec4) Load 9(color) + 30: 7(fvec4) FAdd 29 28 + Store 9(color) 30 + Branch 14 + 27: Label + 32: 21(ptr) AccessChain 9(color) 20 + 33: 6(float) Load 32 + 35: 17(bool) FOrdLessThan 33 34 + SelectionMerge 37 None + BranchConditional 35 36 37 + 36: Label + 39: 7(fvec4) Load 9(color) + 40: 7(fvec4) FAdd 39 38 + Store 9(color) 40 + Branch 14 + 37: Label + 42: 7(fvec4) Load 9(color) + 43: 7(fvec4) FAdd 42 28 + Store 9(color) 43 + Branch 14 + 45: Label + 57: 7(fvec4) Load 56(bigColor) + 58: 7(fvec4) Load 9(color) + 59: 7(fvec4) FAdd 58 57 + Store 9(color) 59 + Branch 47 + 46: Label + Branch 63 + 47: Label + Branch 48 + 48: Label + 49: 21(ptr) AccessChain 9(color) 20 + 50: 6(float) Load 49 + 53: 6(float) Load 52(d) + 54: 17(bool) FOrdLessThan 50 53 + LoopMerge 46 47 None + BranchConditional 54 45 46 + 60: Label + 70: 7(fvec4) Load 69(bigColor1_1) + 71: 7(fvec4) Load 9(color) + 72: 7(fvec4) FAdd 71 70 + Store 9(color) 72 + 74: 21(ptr) AccessChain 9(color) 73 + 75: 6(float) Load 74 + 76: 6(float) Load 52(d) + 77: 17(bool) FOrdLessThan 75 76 + SelectionMerge 79 None + BranchConditional 77 78 79 + 61: Label + Branch 87 + 62: Label + Branch 63 + 63: Label + 65: 21(ptr) AccessChain 9(color) 64 + 66: 6(float) Load 65 + 67: 6(float) Load 52(d) + 68: 17(bool) FOrdLessThan 66 67 + LoopMerge 61 62 None + BranchConditional 68 60 61 + 78: Label + Branch 62 + 79: Label + 81: 7(fvec4) Load 69(bigColor1_1) + 82: 7(fvec4) Load 9(color) + 83: 7(fvec4) FAdd 82 81 + Store 9(color) 83 + Branch 62 + 84: Label + 92: 7(fvec4) Load 9(color) + 94: 7(fvec4) CompositeConstruct 93 93 93 93 + 95: 7(fvec4) FAdd 92 94 + Store 9(color) 95 + Branch 86 + 85: Label + Branch 99 + 86: Label + Branch 87 + 87: Label + 88: 21(ptr) AccessChain 9(color) 20 + 89: 6(float) Load 88 + 91: 17(bool) FOrdLessThan 89 90 + LoopMerge 85 86 None + BranchConditional 91 84 85 + 96: Label + 115: 7(fvec4) Load 114(bigColor1_2) + 116: 7(fvec4) Load 9(color) + 117: 7(fvec4) FAdd 116 115 + Store 9(color) 117 + Branch 98 + 97: Label + Branch 121 + 98: Label + Branch 99 + 99: Label + 100: 21(ptr) AccessChain 9(color) 73 + 101: 6(float) Load 100 + 103: 6(float) Load 102(d2) + 104: 17(bool) FOrdLessThan 101 103 + SelectionMerge 106 None + BranchConditional 104 105 106 + 105: Label + 108: 21(ptr) AccessChain 9(color) 107 + 109: 6(float) Load 108 + 111: 6(float) Load 110(d3) + 112: 17(bool) FOrdLessThan 109 111 + Branch 106 + 106: Label + 113: 17(bool) Phi 104 99 112 105 + LoopMerge 97 98 None + BranchConditional 113 96 97 + 118: Label + 127: 7(fvec4) Load 126(bigColor1_3) + 128: 7(fvec4) Load 9(color) + 129: 7(fvec4) FAdd 128 127 + Store 9(color) 129 + 130: 21(ptr) AccessChain 9(color) 107 + 131: 6(float) Load 130 + 133: 6(float) Load 132(d4) + 134: 17(bool) FOrdLessThan 131 133 + SelectionMerge 136 None + BranchConditional 134 135 136 + 119: Label + Store 143(i) 144 + Branch 148 + 120: Label + Branch 121 + 121: Label + 122: 21(ptr) AccessChain 9(color) 64 + 123: 6(float) Load 122 + 124: 6(float) Load 110(d3) + 125: 17(bool) FOrdLessThan 123 124 + LoopMerge 119 120 None + BranchConditional 125 118 119 + 135: Label + Branch 119 + 136: Label + 138: 7(fvec4) Load 126(bigColor1_3) + 139: 7(fvec4) Load 9(color) + 140: 7(fvec4) FAdd 139 138 + Store 9(color) 140 + Branch 120 + 145: Label + 155: 7(fvec4) Load 154(bigColor2) + 156: 7(fvec4) Load 9(color) + 157: 7(fvec4) FAdd 156 155 + Store 9(color) 157 + Branch 147 + 146: Label + Branch 161 + 147: Label + 158: 141(int) Load 143(i) + 160: 141(int) IAdd 158 159 + Store 143(i) 160 + Branch 148 + 148: Label + 149: 141(int) Load 143(i) + 152: 141(int) Load 151(Count) + 153: 17(bool) SLessThan 149 152 + LoopMerge 146 147 None + BranchConditional 153 145 146 + 161: Label + 165: 7(fvec4) Load 164(bigColor3) + 166: 7(fvec4) Load 9(color) + 167: 7(fvec4) FAdd 166 165 + Store 9(color) 167 + Branch 163 + 162: Label + Store 172(i) 144 + Branch 176 + 163: Label + 168: 21(ptr) AccessChain 9(color) 20 + 169: 6(float) Load 168 + 170: 6(float) Load 102(d2) + 171: 17(bool) FOrdLessThan 169 170 + LoopMerge 162 163 None + BranchConditional 171 161 162 + 173: Label + 180: 6(float) Load 110(d3) + 181: 21(ptr) AccessChain 9(color) 64 + 182: 6(float) Load 181 + 183: 6(float) FAdd 182 180 + 184: 21(ptr) AccessChain 9(color) 64 + Store 184 183 + Branch 175 + 174: Label + Store 187(i) 144 + Branch 191 + 175: Label + 185: 141(int) Load 172(i) + 186: 141(int) IAdd 185 159 + Store 172(i) 186 + Branch 176 + 176: Label + 177: 141(int) Load 172(i) + 179: 17(bool) SLessThan 177 178 + LoopMerge 174 175 None + BranchConditional 179 173 174 + 188: Label + 195: 21(ptr) AccessChain 9(color) 64 + 196: 6(float) Load 195 + 198: 17(bool) FOrdLessThan 196 197 + SelectionMerge 200 None + BranchConditional 198 199 204 + 189: Label + Store 222(i) 144 + Branch 226 + 190: Label + 220: 141(int) Load 187(i) + 221: 141(int) IAdd 220 159 + Store 187(i) 221 + Branch 191 + 191: Label + 192: 141(int) Load 187(i) + 194: 17(bool) SLessThan 192 193 + LoopMerge 189 190 None + BranchConditional 194 188 189 + 199: Label + 201: 21(ptr) AccessChain 9(color) 20 + 202: 6(float) Load 201 + 203: 6(float) FAdd 202 93 + Store 201 203 + Branch 200 + 204: Label + 205: 21(ptr) AccessChain 9(color) 107 + 206: 6(float) Load 205 + 207: 6(float) FAdd 206 93 + Store 205 207 + Branch 200 + 200: Label + 208: 21(ptr) AccessChain 9(color) 73 + 209: 6(float) Load 208 + 210: 17(bool) FOrdLessThan 209 197 + SelectionMerge 212 None + BranchConditional 210 211 212 + 211: Label + 213: 21(ptr) AccessChain 9(color) 64 + 214: 6(float) Load 213 + 215: 21(ptr) AccessChain 9(color) 107 + 216: 6(float) Load 215 + 217: 17(bool) FOrdGreaterThan 214 216 + SelectionMerge 219 None + BranchConditional 217 218 219 + 218: Label + Branch 219 + 219: Label + Branch 212 + 212: Label + Branch 190 + 223: Label + 230: 21(ptr) AccessChain 9(color) 64 + 231: 6(float) Load 230 + 232: 17(bool) FOrdLessThan 231 197 + SelectionMerge 234 None + BranchConditional 232 233 238 + 224: Label + Store 244(i) 144 + Branch 248 + 225: Label + 242: 141(int) Load 222(i) + 243: 141(int) IAdd 242 159 + Store 222(i) 243 + Branch 226 + 226: Label + 227: 141(int) Load 222(i) + 229: 17(bool) SLessThan 227 228 + LoopMerge 224 225 None + BranchConditional 229 223 224 + 233: Label + 235: 21(ptr) AccessChain 9(color) 20 + 236: 6(float) Load 235 + 237: 6(float) FAdd 236 93 + Store 235 237 + Branch 234 + 238: Label + 239: 21(ptr) AccessChain 9(color) 107 + 240: 6(float) Load 239 + 241: 6(float) FAdd 240 93 + Store 239 241 + Branch 234 + 234: Label + Branch 225 + 245: Label + 251: 6(float) Load 110(d3) + 252: 21(ptr) AccessChain 9(color) 64 + 253: 6(float) Load 252 + 254: 6(float) FAdd 253 251 + 255: 21(ptr) AccessChain 9(color) 64 + Store 255 254 + 256: 21(ptr) AccessChain 9(color) 20 + 257: 6(float) Load 256 + 258: 6(float) Load 132(d4) + 259: 17(bool) FOrdLessThan 257 258 + SelectionMerge 261 None + BranchConditional 259 260 261 + 246: Label + Store 268(i) 144 + Branch 272 + 247: Label + 266: 141(int) Load 244(i) + 267: 141(int) IAdd 266 159 + Store 244(i) 267 + Branch 248 + 248: Label + 249: 141(int) Load 244(i) + 250: 17(bool) SLessThan 249 178 + LoopMerge 246 247 None + BranchConditional 250 245 246 + 260: Label + Branch 247 + 261: Label + 263: 21(ptr) AccessChain 9(color) 73 + 264: 6(float) Load 263 + 265: 6(float) FAdd 264 93 + Store 263 265 + Branch 247 + 269: Label + 275: 6(float) Load 110(d3) + 276: 21(ptr) AccessChain 9(color) 64 + 277: 6(float) Load 276 + 278: 6(float) FAdd 277 275 + 279: 21(ptr) AccessChain 9(color) 64 + Store 279 278 + 280: 21(ptr) AccessChain 9(color) 20 + 281: 6(float) Load 280 + 282: 6(float) Load 132(d4) + 283: 17(bool) FOrdLessThan 281 282 + SelectionMerge 285 None + BranchConditional 283 284 285 + 270: Label + Branch 292 + 271: Label + 290: 141(int) Load 268(i) + 291: 141(int) IAdd 290 159 + Store 268(i) 291 + Branch 272 + 272: Label + 273: 141(int) Load 268(i) + 274: 17(bool) SLessThan 273 178 + LoopMerge 270 271 None + BranchConditional 274 269 270 + 284: Label + Branch 270 + 285: Label + 287: 21(ptr) AccessChain 9(color) 73 + 288: 6(float) Load 287 + 289: 6(float) FAdd 288 93 + Store 287 289 + Branch 271 + 292: Label + 296: 7(fvec4) Load 295(bigColor4) + 297: 7(fvec4) Load 9(color) + 298: 7(fvec4) FAdd 297 296 + Store 9(color) 298 + 299: 21(ptr) AccessChain 9(color) 20 + 300: 6(float) Load 299 + 301: 6(float) Load 132(d4) + 302: 17(bool) FOrdLessThan 300 301 + SelectionMerge 304 None + BranchConditional 302 303 304 + 293: Label + Branch 327 + 294: Label + 323: 21(ptr) AccessChain 9(color) 64 + 324: 6(float) Load 323 + 325: 6(float) Load 132(d4) + 326: 17(bool) FOrdLessThan 324 325 + LoopMerge 293 294 None + BranchConditional 326 292 293 + 303: Label + Branch 294 + 304: Label + 306: 21(ptr) AccessChain 9(color) 107 + 307: 6(float) Load 306 + 308: 6(float) Load 132(d4) + 309: 17(bool) FOrdLessThan 307 308 + SelectionMerge 311 None + BranchConditional 309 310 317 + 310: Label + 312: 6(float) Load 132(d4) + 313: 21(ptr) AccessChain 9(color) 107 + 314: 6(float) Load 313 + 315: 6(float) FAdd 314 312 + 316: 21(ptr) AccessChain 9(color) 107 + Store 316 315 + Branch 311 + 317: Label + 318: 6(float) Load 132(d4) + 319: 21(ptr) AccessChain 9(color) 20 + 320: 6(float) Load 319 + 321: 6(float) FAdd 320 318 + 322: 21(ptr) AccessChain 9(color) 20 + Store 322 321 + Branch 311 + 311: Label + Branch 294 + 327: Label + 331: 7(fvec4) Load 330(bigColor5) + 332: 7(fvec4) Load 9(color) + 333: 7(fvec4) FAdd 332 331 + Store 9(color) 333 + 334: 21(ptr) AccessChain 9(color) 107 + 335: 6(float) Load 334 + 337: 6(float) Load 336(d5) + 338: 17(bool) FOrdLessThan 335 337 + SelectionMerge 340 None + BranchConditional 338 339 340 + 328: Label + 350: 21(ptr) AccessChain 9(color) 20 + 351: 6(float) Load 350 + 353: 6(float) Load 352(d6) + 354: 17(bool) FOrdLessThan 351 353 + SelectionMerge 356 None + BranchConditional 354 355 369 + 329: Label + 346: 21(ptr) AccessChain 9(color) 20 + 347: 6(float) Load 346 + 348: 6(float) Load 336(d5) + 349: 17(bool) FOrdLessThan 347 348 + LoopMerge 328 329 None + BranchConditional 349 327 328 + 339: Label + 341: 6(float) Load 336(d5) + 342: 21(ptr) AccessChain 9(color) 107 + 343: 6(float) Load 342 + 344: 6(float) FAdd 343 341 + 345: 21(ptr) AccessChain 9(color) 107 + Store 345 344 + Branch 340 + 340: Label + Branch 329 + 355: Label + Branch 360 + 357: Label + 366: 7(fvec4) Load 365(bigColor6) + 367: 7(fvec4) Load 9(color) + 368: 7(fvec4) FAdd 367 366 + Store 9(color) 368 + Branch 359 + 358: Label + Branch 356 + 359: Label + Branch 360 + 360: Label + 361: 21(ptr) AccessChain 9(color) 107 + 362: 6(float) Load 361 + 363: 6(float) Load 352(d6) + 364: 17(bool) FOrdLessThan 362 363 + LoopMerge 358 359 None + BranchConditional 364 357 358 + 369: Label + Branch 373 + 370: Label + 378: 51(ptr) AccessChain 365(bigColor6) 64 + 379: 6(float) Load 378 + 380: 21(ptr) AccessChain 9(color) 64 + 381: 6(float) Load 380 + 382: 6(float) FAdd 381 379 + 383: 21(ptr) AccessChain 9(color) 64 + Store 383 382 + Branch 372 + 371: Label + Branch 356 + 372: Label + Branch 373 + 373: Label + 374: 21(ptr) AccessChain 9(color) 64 + 375: 6(float) Load 374 + 376: 6(float) Load 352(d6) + 377: 17(bool) FOrdLessThan 375 376 + LoopMerge 371 372 None + BranchConditional 377 370 371 + 356: Label + 384: 21(ptr) AccessChain 9(color) 20 + 385: 6(float) Load 384 + 386: 6(float) Load 352(d6) + 387: 17(bool) FOrdLessThan 385 386 + SelectionMerge 389 None + BranchConditional 387 388 407 + 388: Label + Branch 393 + 390: Label + 398: 7(fvec4) Load 365(bigColor6) + 399: 7(fvec4) Load 9(color) + 400: 7(fvec4) FAdd 399 398 + Store 9(color) 400 + 402: 6(float) Load 401(d7) + 403: 17(bool) FOrdLessThan 402 93 + SelectionMerge 405 None + BranchConditional 403 404 405 + 391: Label + Branch 389 + 392: Label + Branch 393 + 393: Label + 394: 21(ptr) AccessChain 9(color) 107 + 395: 6(float) Load 394 + 396: 6(float) Load 352(d6) + 397: 17(bool) FOrdLessThan 395 396 + LoopMerge 391 392 None + BranchConditional 397 390 391 + 404: Label + Branch 391 + 405: Label + Branch 392 + 407: Label + Branch 411 + 408: Label + 416: 51(ptr) AccessChain 365(bigColor6) 64 + 417: 6(float) Load 416 + 418: 21(ptr) AccessChain 9(color) 64 + 419: 6(float) Load 418 + 420: 6(float) FAdd 419 417 + 421: 21(ptr) AccessChain 9(color) 64 + Store 421 420 + Branch 410 + 409: Label + Branch 389 + 410: Label + Branch 411 + 411: Label + 412: 21(ptr) AccessChain 9(color) 64 + 413: 6(float) Load 412 + 414: 6(float) Load 352(d6) + 415: 17(bool) FOrdLessThan 413 414 + LoopMerge 409 410 None + BranchConditional 415 408 409 + 389: Label + Branch 422 + 422: Label + 425: 6(float) Load 401(d7) + 427: 17(bool) FOrdLessThan 425 426 + SelectionMerge 429 None + BranchConditional 427 428 429 + 423: Label + Branch 446 + 424: Label + LoopMerge 423 424 None + BranchConditional 18 422 423 + 428: Label + Branch 423 + 429: Label + 432: 7(fvec4) Load 431(bigColor7) + 433: 7(fvec4) Load 9(color) + 434: 7(fvec4) FAdd 433 432 + Store 9(color) 434 + 435: 6(float) Load 401(d7) + 436: 17(bool) FOrdLessThan 435 93 + SelectionMerge 438 None + BranchConditional 436 437 438 + 437: Label + 439: 21(ptr) AccessChain 9(color) 64 + 440: 6(float) Load 439 + 441: 6(float) FAdd 440 93 + Store 439 441 + Branch 423 + 438: Label + 443: 7(fvec4) Load 11(BaseColor) + 444: 7(fvec4) Load 9(color) + 445: 7(fvec4) FAdd 444 443 + Store 9(color) 445 + Branch 424 + 446: Label + 450: 6(float) Load 449(d8) + 451: 17(bool) FOrdLessThan 450 426 + SelectionMerge 453 None + BranchConditional 451 452 453 + 447: Label + Branch 488 + 448: Label + 481: 21(ptr) AccessChain 9(color) 64 + 482: 6(float) Load 481 + 483: 6(float) Load 449(d8) + 484: 17(bool) FOrdLessThan 482 483 + LoopMerge 447 448 None + BranchConditional 484 446 447 + 452: Label + Branch 447 + 453: Label + 455: 7(fvec4) Load 431(bigColor7) + 456: 7(fvec4) Load 9(color) + 457: 7(fvec4) FAdd 456 455 + Store 9(color) 457 + 458: 6(float) Load 449(d8) + 459: 17(bool) FOrdLessThan 458 93 + SelectionMerge 461 None + BranchConditional 459 460 461 + 460: Label + 462: 21(ptr) AccessChain 9(color) 64 + 463: 6(float) Load 462 + 464: 6(float) FAdd 463 93 + Store 462 464 + 465: 6(float) Load 449(d8) + 467: 17(bool) FOrdLessThan 465 466 + SelectionMerge 469 None + BranchConditional 467 468 473 + 468: Label + 470: 21(ptr) AccessChain 9(color) 107 + 471: 6(float) Load 470 + 472: 6(float) FAdd 471 93 + Store 470 472 + Branch 469 + 473: Label + 474: 21(ptr) AccessChain 9(color) 20 + 475: 6(float) Load 474 + 476: 6(float) FAdd 475 93 + Store 474 476 + Branch 469 + 469: Label + Branch 447 + 461: Label + 478: 7(fvec4) Load 11(BaseColor) + 479: 7(fvec4) Load 9(color) + 480: 7(fvec4) FAdd 479 478 + Store 9(color) 480 + Branch 448 + 485: Label + 494: 6(float) Load 491(d9) + 495: 6(float) Load 449(d8) + 496: 17(bool) FOrdGreaterThan 494 495 + SelectionMerge 498 None + BranchConditional 496 497 498 + 486: Label + Branch 519 + 487: Label + Branch 488 + 488: Label + 489: 21(ptr) AccessChain 9(color) 73 + 490: 6(float) Load 489 + 492: 6(float) Load 491(d9) + 493: 17(bool) FOrdLessThan 490 492 + LoopMerge 486 487 None + BranchConditional 493 485 486 + 497: Label + 499: 21(ptr) AccessChain 9(color) 20 + 500: 6(float) Load 499 + 501: 6(float) Load 401(d7) + 502: 17(bool) FOrdLessThanEqual 500 501 + SelectionMerge 504 None + BranchConditional 502 503 504 + 503: Label + 505: 21(ptr) AccessChain 9(color) 64 + 506: 6(float) Load 505 + 508: 17(bool) FOrdEqual 506 507 + SelectionMerge 510 None + BranchConditional 508 509 514 + 509: Label + 511: 21(ptr) AccessChain 9(color) 73 + 512: 6(float) Load 511 + 513: 6(float) FAdd 512 93 + Store 511 513 + Branch 510 + 514: Label + Branch 486 + 510: Label + Branch 504 + 504: Label + Branch 498 + 498: Label + Branch 487 + 516: Label + 525: 21(ptr) AccessChain 9(color) 107 + 526: 6(float) Load 525 + 527: 6(float) FAdd 526 93 + Store 525 527 + 528: 21(ptr) AccessChain 9(color) 107 + 529: 6(float) Load 528 + 531: 6(float) Load 530(d11) + 532: 17(bool) FOrdLessThan 529 531 + SelectionMerge 534 None + BranchConditional 532 533 534 + 517: Label + Branch 560 + 518: Label + Branch 519 + 519: Label + 520: 21(ptr) AccessChain 9(color) 64 + 521: 6(float) Load 520 + 523: 6(float) Load 522(d10) + 524: 17(bool) FOrdLessThan 521 523 + LoopMerge 517 518 None + BranchConditional 524 516 517 + 533: Label + 535: 21(ptr) AccessChain 9(color) 64 + 536: 6(float) Load 535 + 537: 6(float) FAdd 536 93 + Store 535 537 + 538: 21(ptr) AccessChain 9(color) 73 + 539: 6(float) Load 538 + 541: 6(float) Load 540(d12) + 542: 17(bool) FOrdLessThan 539 541 + SelectionMerge 544 None + BranchConditional 542 543 548 + 543: Label + 545: 21(ptr) AccessChain 9(color) 73 + 546: 6(float) Load 545 + 547: 6(float) FAdd 546 93 + Store 545 547 + Branch 544 + 548: Label + 549: 21(ptr) AccessChain 9(color) 20 + 550: 6(float) Load 549 + 551: 6(float) FAdd 550 93 + Store 549 551 + Branch 544 + 544: Label + Branch 518 + 534: Label + 553: 7(fvec4) Load 9(color) + 554: 7(fvec4) CompositeConstruct 93 93 93 93 + 555: 7(fvec4) FAdd 553 554 + Store 9(color) 555 + Branch 517 + 557: Label + 566: 7(fvec4) Load 565(bigColor8) + 567: 7(fvec4) Load 9(color) + 568: 7(fvec4) FAdd 567 566 + Store 9(color) 568 + 569: 21(ptr) AccessChain 9(color) 64 + 570: 6(float) Load 569 + 571: 6(float) Load 449(d8) + 572: 17(bool) FOrdLessThan 570 571 + SelectionMerge 574 None + BranchConditional 572 573 574 + 558: Label + 588: 7(fvec4) Load 9(color) + 589: 7(fvec4) CompositeConstruct 93 93 93 93 + 590: 7(fvec4) FAdd 588 589 + Store 9(color) 590 + 593: 7(fvec4) Load 9(color) + Store 592(gl_FragColor) 593 + Branch 597 + 559: Label + Branch 560 + 560: Label + 561: 21(ptr) AccessChain 9(color) 20 + 562: 6(float) Load 561 + 564: 17(bool) FOrdLessThan 562 563 + LoopMerge 558 559 None + BranchConditional 564 557 558 + 573: Label + 575: 21(ptr) AccessChain 9(color) 73 + 576: 6(float) Load 575 + 577: 6(float) Load 352(d6) + 578: 17(bool) FOrdLessThan 576 577 + SelectionMerge 580 None + BranchConditional 578 579 580 + 579: Label + Branch 559 + 580: Label + Branch 574 + 574: Label + 582: 51(ptr) AccessChain 565(bigColor8) 20 + 583: 6(float) Load 582 + 584: 21(ptr) AccessChain 9(color) 107 + 585: 6(float) Load 584 + 586: 6(float) FAdd 585 583 + 587: 21(ptr) AccessChain 9(color) 107 + Store 587 586 + Branch 559 + 594: Label + 603: 21(ptr) AccessChain 9(color) 107 + 604: 6(float) Load 603 + 606: 6(float) Load 605(d15) + 607: 17(bool) FOrdLessThan 604 606 + SelectionMerge 609 None + BranchConditional 607 608 611 + 595: Label + 615: 7(fvec4) Load 9(color) + 616: 7(fvec4) CompositeConstruct 93 93 93 93 + 617: 7(fvec4) FAdd 615 616 + Store 9(color) 617 + Branch 621 + 596: Label + Branch 597 + 597: Label + 598: 21(ptr) AccessChain 9(color) 20 + 599: 6(float) Load 598 + 601: 6(float) Load 600(d14) + 602: 17(bool) FOrdLessThan 599 601 + LoopMerge 595 596 None + BranchConditional 602 594 595 + 608: Label + Return + 611: Label + 612: 7(fvec4) Load 9(color) + 613: 7(fvec4) CompositeConstruct 93 93 93 93 + 614: 7(fvec4) FAdd 612 613 + Store 9(color) 614 + Branch 609 + 609: Label + Branch 596 + 618: Label + 627: 21(ptr) AccessChain 9(color) 73 + 628: 6(float) Load 627 + 629: 6(float) FAdd 628 93 + Store 627 629 + Branch 620 + 619: Label + Branch 633 + 620: Label + Branch 621 + 621: Label + 622: 21(ptr) AccessChain 9(color) 73 + 623: 6(float) Load 622 + 625: 6(float) Load 624(d16) + 626: 17(bool) FOrdLessThan 623 625 + LoopMerge 619 620 None + BranchConditional 626 618 619 + 630: Label + 645: 7(fvec4) Load 114(bigColor1_2) + 646: 7(fvec4) Load 9(color) + 647: 7(fvec4) FAdd 646 645 + Store 9(color) 647 + 648: 21(ptr) AccessChain 9(color) 64 + 649: 6(float) Load 648 + 650: 6(float) Load 110(d3) + 651: 17(bool) FOrdLessThan 649 650 + SelectionMerge 653 None + BranchConditional 651 652 653 + 631: Label + Branch 655 + 632: Label + Branch 633 + 633: Label + 634: 21(ptr) AccessChain 9(color) 73 + 635: 6(float) Load 634 + 636: 6(float) Load 102(d2) + 637: 17(bool) FOrdLessThan 635 636 + SelectionMerge 639 None + BranchConditional 637 638 639 + 638: Label + 640: 21(ptr) AccessChain 9(color) 107 + 641: 6(float) Load 640 + 642: 6(float) Load 110(d3) + 643: 17(bool) FOrdLessThan 641 642 + Branch 639 + 639: Label + 644: 17(bool) Phi 637 633 643 638 + LoopMerge 631 632 None + BranchConditional 644 630 631 + 652: Label + Return + 653: Label + Branch 632 + 655: Label + 658: 21(ptr) AccessChain 9(color) 107 + 659: 6(float) Load 658 + 661: 6(float) Load 660(d18) + 662: 17(bool) FOrdLessThan 659 661 + SelectionMerge 664 None + BranchConditional 662 663 664 + 656: Label + Branch 677 + 657: Label + 669: 21(ptr) AccessChain 9(color) 20 + 670: 6(float) Load 669 + 672: 6(float) Load 671(d17) + 673: 17(bool) FOrdLessThan 670 672 + LoopMerge 656 657 None + BranchConditional 673 655 656 + 663: Label + Return + 664: Label + 666: 7(fvec4) Load 9(color) + 667: 7(fvec4) CompositeConstruct 93 93 93 93 + 668: 7(fvec4) FAdd 666 667 + Store 9(color) 668 + Branch 657 + 674: Label + 682: 21(ptr) AccessChain 9(color) 73 + 683: 6(float) Load 682 + 684: 6(float) Load 624(d16) + 685: 17(bool) FOrdLessThan 683 684 + SelectionMerge 687 None + BranchConditional 685 686 689 + 675: Label + 693: 7(fvec4) Load 9(color) + 694: 7(fvec4) CompositeConstruct 93 93 93 93 + 695: 7(fvec4) FAdd 693 694 + Store 9(color) 695 + 696: 7(fvec4) Load 9(color) + Store 592(gl_FragColor) 696 + Return + 676: Label + Branch 677 + 677: Label + 678: 21(ptr) AccessChain 9(color) 107 + 679: 6(float) Load 678 + 680: 6(float) Load 624(d16) + 681: 17(bool) FOrdLessThan 679 680 + LoopMerge 675 676 None + BranchConditional 681 674 675 + 686: Label + Kill + 689: Label + 690: 7(fvec4) Load 9(color) + 691: 7(fvec4) CompositeConstruct 93 93 93 93 + 692: 7(fvec4) FAdd 690 691 + Store 9(color) 692 + Branch 687 + 687: Label + Branch 676 + FunctionEnd diff --git a/Test/baseResults/spv.loopsArtificial.frag.out b/Test/baseResults/spv.loopsArtificial.frag.out index 314a9691..ff7a8f2f 100755 --- a/Test/baseResults/spv.loopsArtificial.frag.out +++ b/Test/baseResults/spv.loopsArtificial.frag.out @@ -1,308 +1,299 @@ -spv.loopsArtificial.frag -WARNING: 0:14: varying deprecated in version 130; may be removed in future release - - -Linked fragment stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 191 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 - ExecutionMode 4 OriginLowerLeft - Source GLSL 130 - Name 4 "main" - Name 9 "color" - Name 11 "BaseColor" - Name 27 "d4" - Name 32 "bigColor4" - Name 84 "d13" - Name 144 "gl_FragColor" - Name 146 "bigColor" - Name 147 "bigColor1_1" - Name 148 "bigColor1_2" - Name 149 "bigColor1_3" - Name 150 "bigColor2" - Name 151 "bigColor3" - Name 152 "bigColor5" - Name 153 "bigColor6" - Name 154 "bigColor7" - Name 155 "bigColor8" - Name 156 "d" - Name 157 "d2" - Name 158 "d3" - Name 159 "d5" - Name 160 "d6" - Name 161 "d7" - Name 162 "d8" - Name 163 "d9" - Name 164 "d10" - Name 165 "d11" - Name 166 "d12" - Name 167 "d14" - Name 168 "d15" - Name 169 "d16" - Name 170 "d17" - Name 171 "d18" - Name 172 "d19" - Name 173 "d20" - Name 174 "d21" - Name 175 "d22" - Name 176 "d23" - Name 177 "d24" - Name 178 "d25" - Name 179 "d26" - Name 180 "d27" - Name 181 "d28" - Name 182 "d29" - Name 183 "d30" - Name 184 "d31" - Name 185 "d32" - Name 186 "d33" - Name 187 "d34" - Name 190 "Count" - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Function 7(fvec4) - 10: TypePointer Input 7(fvec4) - 11(BaseColor): 10(ptr) Variable Input - 17: TypeBool - 18: 17(bool) ConstantTrue - 21: TypeInt 32 0 - 22: 21(int) Constant 2 - 23: TypePointer Function 6(float) - 26: TypePointer UniformConstant 6(float) - 27(d4): 26(ptr) Variable UniformConstant - 31: TypePointer UniformConstant 7(fvec4) - 32(bigColor4): 31(ptr) Variable UniformConstant - 36: 21(int) Constant 0 - 43: 6(float) Constant 1073741824 - 56: 6(float) Constant 1065353216 - 58: 17(bool) ConstantFalse - 60: 21(int) Constant 1 - 81: 21(int) Constant 3 - 84(d13): 26(ptr) Variable UniformConstant - 143: TypePointer Output 7(fvec4) -144(gl_FragColor): 143(ptr) Variable Output - 146(bigColor): 31(ptr) Variable UniformConstant -147(bigColor1_1): 31(ptr) Variable UniformConstant -148(bigColor1_2): 31(ptr) Variable UniformConstant -149(bigColor1_3): 31(ptr) Variable UniformConstant - 150(bigColor2): 31(ptr) Variable UniformConstant - 151(bigColor3): 31(ptr) Variable UniformConstant - 152(bigColor5): 31(ptr) Variable UniformConstant - 153(bigColor6): 31(ptr) Variable UniformConstant - 154(bigColor7): 31(ptr) Variable UniformConstant - 155(bigColor8): 31(ptr) Variable UniformConstant - 156(d): 26(ptr) Variable UniformConstant - 157(d2): 26(ptr) Variable UniformConstant - 158(d3): 26(ptr) Variable UniformConstant - 159(d5): 26(ptr) Variable UniformConstant - 160(d6): 26(ptr) Variable UniformConstant - 161(d7): 26(ptr) Variable UniformConstant - 162(d8): 26(ptr) Variable UniformConstant - 163(d9): 26(ptr) Variable UniformConstant - 164(d10): 26(ptr) Variable UniformConstant - 165(d11): 26(ptr) Variable UniformConstant - 166(d12): 26(ptr) Variable UniformConstant - 167(d14): 26(ptr) Variable UniformConstant - 168(d15): 26(ptr) Variable UniformConstant - 169(d16): 26(ptr) Variable UniformConstant - 170(d17): 26(ptr) Variable UniformConstant - 171(d18): 26(ptr) Variable UniformConstant - 172(d19): 26(ptr) Variable UniformConstant - 173(d20): 26(ptr) Variable UniformConstant - 174(d21): 26(ptr) Variable UniformConstant - 175(d22): 26(ptr) Variable UniformConstant - 176(d23): 26(ptr) Variable UniformConstant - 177(d24): 26(ptr) Variable UniformConstant - 178(d25): 26(ptr) Variable UniformConstant - 179(d26): 26(ptr) Variable UniformConstant - 180(d27): 26(ptr) Variable UniformConstant - 181(d28): 26(ptr) Variable UniformConstant - 182(d29): 26(ptr) Variable UniformConstant - 183(d30): 26(ptr) Variable UniformConstant - 184(d31): 26(ptr) Variable UniformConstant - 185(d32): 26(ptr) Variable UniformConstant - 186(d33): 26(ptr) Variable UniformConstant - 187(d34): 26(ptr) Variable UniformConstant - 188: TypeInt 32 1 - 189: TypePointer UniformConstant 188(int) - 190(Count): 189(ptr) Variable UniformConstant - 4(main): 2 Function None 3 - 5: Label - 9(color): 8(ptr) Variable Function - 12: 7(fvec4) Load 11(BaseColor) - Store 9(color) 12 - Branch 13 - 13: Label - 16: 17(bool) Phi 18 5 58 52 58 66 - LoopMerge 14 13 None - Branch 19 - 19: Label - SelectionMerge 15 None - BranchConditional 16 15 20 - 20: Label - 24: 23(ptr) AccessChain 9(color) 22 - 25: 6(float) Load 24 - 28: 6(float) Load 27(d4) - 29: 17(bool) FOrdLessThan 25 28 - SelectionMerge 30 None - BranchConditional 29 30 14 - 30: Label - Branch 15 - 15: Label - 33: 7(fvec4) Load 32(bigColor4) - 34: 7(fvec4) Load 9(color) - 35: 7(fvec4) FAdd 34 33 - Store 9(color) 35 - 37: 23(ptr) AccessChain 9(color) 36 - 38: 6(float) Load 37 - 39: 6(float) Load 27(d4) - 40: 17(bool) FOrdLessThan 38 39 - SelectionMerge 42 None - BranchConditional 40 41 42 - 41: Label - 44: 23(ptr) AccessChain 9(color) 22 - 45: 6(float) Load 44 - 46: 6(float) FAdd 45 43 - 47: 23(ptr) AccessChain 9(color) 22 - Store 47 46 - 48: 23(ptr) AccessChain 9(color) 22 - 49: 6(float) Load 48 - 50: 6(float) Load 27(d4) - 51: 17(bool) FOrdLessThan 49 50 - SelectionMerge 53 None - BranchConditional 51 52 53 - 52: Label - 54: 23(ptr) AccessChain 9(color) 36 - 55: 6(float) Load 54 - 57: 6(float) FAdd 55 56 - Store 54 57 - Branch 13 - 53: Label - Branch 42 - 42: Label - 61: 23(ptr) AccessChain 9(color) 60 - 62: 6(float) Load 61 - 63: 6(float) Load 27(d4) - 64: 17(bool) FOrdLessThan 62 63 - SelectionMerge 66 None - BranchConditional 64 65 72 - 65: Label - 67: 6(float) Load 27(d4) - 68: 23(ptr) AccessChain 9(color) 60 - 69: 6(float) Load 68 - 70: 6(float) FAdd 69 67 - 71: 23(ptr) AccessChain 9(color) 60 - Store 71 70 - Branch 66 - 72: Label - 73: 6(float) Load 27(d4) - 74: 23(ptr) AccessChain 9(color) 36 - 75: 6(float) Load 74 - 76: 6(float) FAdd 75 73 - 77: 23(ptr) AccessChain 9(color) 36 - Store 77 76 - Branch 66 - 66: Label - Branch 13 - 14: Label - Branch 78 - 78: Label - 82: 23(ptr) AccessChain 9(color) 81 - 83: 6(float) Load 82 - 85: 6(float) Load 84(d13) - 86: 17(bool) FOrdLessThan 83 85 - LoopMerge 79 78 None - BranchConditional 86 80 79 - 80: Label - 87: 23(ptr) AccessChain 9(color) 22 - 88: 6(float) Load 87 - 89: 6(float) Load 84(d13) - 90: 17(bool) FOrdLessThan 88 89 - SelectionMerge 92 None - BranchConditional 90 91 96 - 91: Label - 93: 7(fvec4) Load 9(color) - 94: 7(fvec4) CompositeConstruct 56 56 56 56 - 95: 7(fvec4) FAdd 93 94 - Store 9(color) 95 - Branch 92 - 96: Label - 97: 7(fvec4) Load 9(color) - 98: 7(fvec4) CompositeConstruct 56 56 56 56 - 99: 7(fvec4) FSub 97 98 - Store 9(color) 99 - Branch 92 - 92: Label - 100: 7(fvec4) Load 32(bigColor4) - 101: 7(fvec4) Load 9(color) - 102: 7(fvec4) FAdd 101 100 - Store 9(color) 102 - 103: 23(ptr) AccessChain 9(color) 36 - 104: 6(float) Load 103 - 105: 6(float) Load 27(d4) - 106: 17(bool) FOrdLessThan 104 105 - SelectionMerge 108 None - BranchConditional 106 107 108 - 107: Label - 109: 23(ptr) AccessChain 9(color) 22 - 110: 6(float) Load 109 - 111: 6(float) FAdd 110 43 - 112: 23(ptr) AccessChain 9(color) 22 - Store 112 111 - 113: 23(ptr) AccessChain 9(color) 22 - 114: 6(float) Load 113 - 115: 6(float) Load 27(d4) - 116: 17(bool) FOrdLessThan 114 115 - SelectionMerge 118 None - BranchConditional 116 117 118 - 117: Label - 119: 23(ptr) AccessChain 9(color) 36 - 120: 6(float) Load 119 - 121: 6(float) FAdd 120 56 - Store 119 121 - Branch 78 - 118: Label - Branch 108 - 108: Label - 123: 23(ptr) AccessChain 9(color) 60 - 124: 6(float) Load 123 - 125: 6(float) Load 27(d4) - 126: 17(bool) FOrdLessThan 124 125 - SelectionMerge 128 None - BranchConditional 126 127 134 - 127: Label - 129: 6(float) Load 27(d4) - 130: 23(ptr) AccessChain 9(color) 60 - 131: 6(float) Load 130 - 132: 6(float) FAdd 131 129 - 133: 23(ptr) AccessChain 9(color) 60 - Store 133 132 - Branch 128 - 134: Label - 135: 6(float) Load 27(d4) - 136: 23(ptr) AccessChain 9(color) 36 - 137: 6(float) Load 136 - 138: 6(float) FAdd 137 135 - 139: 23(ptr) AccessChain 9(color) 36 - Store 139 138 - Branch 128 - 128: Label - Branch 78 - 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 +spv.loopsArtificial.frag +WARNING: 0:14: varying deprecated in version 130; may be removed in future release + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 186 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 + ExecutionMode 4 OriginLowerLeft + Source GLSL 130 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 17 "bigColor4" + Name 27 "d4" + Name 79 "d13" + Name 139 "gl_FragColor" + Name 141 "bigColor" + Name 142 "bigColor1_1" + Name 143 "bigColor1_2" + Name 144 "bigColor1_3" + Name 145 "bigColor2" + Name 146 "bigColor3" + Name 147 "bigColor5" + Name 148 "bigColor6" + Name 149 "bigColor7" + Name 150 "bigColor8" + Name 151 "d" + Name 152 "d2" + Name 153 "d3" + Name 154 "d5" + Name 155 "d6" + Name 156 "d7" + Name 157 "d8" + Name 158 "d9" + Name 159 "d10" + Name 160 "d11" + Name 161 "d12" + Name 162 "d14" + Name 163 "d15" + Name 164 "d16" + Name 165 "d17" + Name 166 "d18" + Name 167 "d19" + Name 168 "d20" + Name 169 "d21" + Name 170 "d22" + Name 171 "d23" + Name 172 "d24" + Name 173 "d25" + Name 174 "d26" + Name 175 "d27" + Name 176 "d28" + Name 177 "d29" + Name 178 "d30" + Name 179 "d31" + Name 180 "d32" + Name 181 "d33" + Name 182 "d34" + Name 185 "Count" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 16: TypePointer UniformConstant 7(fvec4) + 17(bigColor4): 16(ptr) Variable UniformConstant + 21: TypeInt 32 0 + 22: 21(int) Constant 0 + 23: TypePointer Function 6(float) + 26: TypePointer UniformConstant 6(float) + 27(d4): 26(ptr) Variable UniformConstant + 29: TypeBool + 33: 6(float) Constant 1073741824 + 34: 21(int) Constant 2 + 47: 6(float) Constant 1065353216 + 50: 21(int) Constant 1 + 76: 21(int) Constant 3 + 79(d13): 26(ptr) Variable UniformConstant + 138: TypePointer Output 7(fvec4) +139(gl_FragColor): 138(ptr) Variable Output + 141(bigColor): 16(ptr) Variable UniformConstant +142(bigColor1_1): 16(ptr) Variable UniformConstant +143(bigColor1_2): 16(ptr) Variable UniformConstant +144(bigColor1_3): 16(ptr) Variable UniformConstant + 145(bigColor2): 16(ptr) Variable UniformConstant + 146(bigColor3): 16(ptr) Variable UniformConstant + 147(bigColor5): 16(ptr) Variable UniformConstant + 148(bigColor6): 16(ptr) Variable UniformConstant + 149(bigColor7): 16(ptr) Variable UniformConstant + 150(bigColor8): 16(ptr) Variable UniformConstant + 151(d): 26(ptr) Variable UniformConstant + 152(d2): 26(ptr) Variable UniformConstant + 153(d3): 26(ptr) Variable UniformConstant + 154(d5): 26(ptr) Variable UniformConstant + 155(d6): 26(ptr) Variable UniformConstant + 156(d7): 26(ptr) Variable UniformConstant + 157(d8): 26(ptr) Variable UniformConstant + 158(d9): 26(ptr) Variable UniformConstant + 159(d10): 26(ptr) Variable UniformConstant + 160(d11): 26(ptr) Variable UniformConstant + 161(d12): 26(ptr) Variable UniformConstant + 162(d14): 26(ptr) Variable UniformConstant + 163(d15): 26(ptr) Variable UniformConstant + 164(d16): 26(ptr) Variable UniformConstant + 165(d17): 26(ptr) Variable UniformConstant + 166(d18): 26(ptr) Variable UniformConstant + 167(d19): 26(ptr) Variable UniformConstant + 168(d20): 26(ptr) Variable UniformConstant + 169(d21): 26(ptr) Variable UniformConstant + 170(d22): 26(ptr) Variable UniformConstant + 171(d23): 26(ptr) Variable UniformConstant + 172(d24): 26(ptr) Variable UniformConstant + 173(d25): 26(ptr) Variable UniformConstant + 174(d26): 26(ptr) Variable UniformConstant + 175(d27): 26(ptr) Variable UniformConstant + 176(d28): 26(ptr) Variable UniformConstant + 177(d29): 26(ptr) Variable UniformConstant + 178(d30): 26(ptr) Variable UniformConstant + 179(d31): 26(ptr) Variable UniformConstant + 180(d32): 26(ptr) Variable UniformConstant + 181(d33): 26(ptr) Variable UniformConstant + 182(d34): 26(ptr) Variable UniformConstant + 183: TypeInt 32 1 + 184: TypePointer UniformConstant 183(int) + 185(Count): 184(ptr) Variable UniformConstant + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Branch 13 + 13: Label + 18: 7(fvec4) Load 17(bigColor4) + 19: 7(fvec4) Load 9(color) + 20: 7(fvec4) FAdd 19 18 + Store 9(color) 20 + 24: 23(ptr) AccessChain 9(color) 22 + 25: 6(float) Load 24 + 28: 6(float) Load 27(d4) + 30: 29(bool) FOrdLessThan 25 28 + SelectionMerge 32 None + BranchConditional 30 31 32 + 14: Label + Branch 75 + 15: Label + 68: 23(ptr) AccessChain 9(color) 34 + 69: 6(float) Load 68 + 70: 6(float) Load 27(d4) + 71: 29(bool) FOrdLessThan 69 70 + LoopMerge 14 15 None + BranchConditional 71 13 14 + 31: Label + 35: 23(ptr) AccessChain 9(color) 34 + 36: 6(float) Load 35 + 37: 6(float) FAdd 36 33 + 38: 23(ptr) AccessChain 9(color) 34 + Store 38 37 + 39: 23(ptr) AccessChain 9(color) 34 + 40: 6(float) Load 39 + 41: 6(float) Load 27(d4) + 42: 29(bool) FOrdLessThan 40 41 + SelectionMerge 44 None + BranchConditional 42 43 44 + 43: Label + 45: 23(ptr) AccessChain 9(color) 22 + 46: 6(float) Load 45 + 48: 6(float) FAdd 46 47 + Store 45 48 + Branch 15 + 44: Label + Branch 32 + 32: Label + 51: 23(ptr) AccessChain 9(color) 50 + 52: 6(float) Load 51 + 53: 6(float) Load 27(d4) + 54: 29(bool) FOrdLessThan 52 53 + SelectionMerge 56 None + BranchConditional 54 55 62 + 55: Label + 57: 6(float) Load 27(d4) + 58: 23(ptr) AccessChain 9(color) 50 + 59: 6(float) Load 58 + 60: 6(float) FAdd 59 57 + 61: 23(ptr) AccessChain 9(color) 50 + Store 61 60 + Branch 56 + 62: Label + 63: 6(float) Load 27(d4) + 64: 23(ptr) AccessChain 9(color) 22 + 65: 6(float) Load 64 + 66: 6(float) FAdd 65 63 + 67: 23(ptr) AccessChain 9(color) 22 + Store 67 66 + Branch 56 + 56: Label + Branch 15 + 72: Label + 82: 23(ptr) AccessChain 9(color) 34 + 83: 6(float) Load 82 + 84: 6(float) Load 79(d13) + 85: 29(bool) FOrdLessThan 83 84 + SelectionMerge 87 None + BranchConditional 85 86 91 + 73: Label + 135: 7(fvec4) Load 9(color) + 136: 7(fvec4) CompositeConstruct 47 47 47 47 + 137: 7(fvec4) FAdd 135 136 + Store 9(color) 137 + 140: 7(fvec4) Load 9(color) + Store 139(gl_FragColor) 140 + Return + 74: Label + Branch 75 + 75: Label + 77: 23(ptr) AccessChain 9(color) 76 + 78: 6(float) Load 77 + 80: 6(float) Load 79(d13) + 81: 29(bool) FOrdLessThan 78 80 + LoopMerge 73 74 None + BranchConditional 81 72 73 + 86: Label + 88: 7(fvec4) Load 9(color) + 89: 7(fvec4) CompositeConstruct 47 47 47 47 + 90: 7(fvec4) FAdd 88 89 + Store 9(color) 90 + Branch 87 + 91: Label + 92: 7(fvec4) Load 9(color) + 93: 7(fvec4) CompositeConstruct 47 47 47 47 + 94: 7(fvec4) FSub 92 93 + Store 9(color) 94 + Branch 87 + 87: Label + 95: 7(fvec4) Load 17(bigColor4) + 96: 7(fvec4) Load 9(color) + 97: 7(fvec4) FAdd 96 95 + Store 9(color) 97 + 98: 23(ptr) AccessChain 9(color) 22 + 99: 6(float) Load 98 + 100: 6(float) Load 27(d4) + 101: 29(bool) FOrdLessThan 99 100 + SelectionMerge 103 None + BranchConditional 101 102 103 + 102: Label + 104: 23(ptr) AccessChain 9(color) 34 + 105: 6(float) Load 104 + 106: 6(float) FAdd 105 33 + 107: 23(ptr) AccessChain 9(color) 34 + Store 107 106 + 108: 23(ptr) AccessChain 9(color) 34 + 109: 6(float) Load 108 + 110: 6(float) Load 27(d4) + 111: 29(bool) FOrdLessThan 109 110 + SelectionMerge 113 None + BranchConditional 111 112 113 + 112: Label + 114: 23(ptr) AccessChain 9(color) 22 + 115: 6(float) Load 114 + 116: 6(float) FAdd 115 47 + Store 114 116 + Branch 74 + 113: Label + Branch 103 + 103: Label + 118: 23(ptr) AccessChain 9(color) 50 + 119: 6(float) Load 118 + 120: 6(float) Load 27(d4) + 121: 29(bool) FOrdLessThan 119 120 + SelectionMerge 123 None + BranchConditional 121 122 129 + 122: Label + 124: 6(float) Load 27(d4) + 125: 23(ptr) AccessChain 9(color) 50 + 126: 6(float) Load 125 + 127: 6(float) FAdd 126 124 + 128: 23(ptr) AccessChain 9(color) 50 + Store 128 127 + Branch 123 + 129: Label + 130: 6(float) Load 27(d4) + 131: 23(ptr) AccessChain 9(color) 22 + 132: 6(float) Load 131 + 133: 6(float) FAdd 132 130 + 134: 23(ptr) AccessChain 9(color) 22 + Store 134 133 + Branch 123 + 123: Label + Branch 74 + FunctionEnd diff --git a/Test/baseResults/spv.switch.frag.out b/Test/baseResults/spv.switch.frag.out index 97cbcf91..bc91acc5 100755 --- a/Test/baseResults/spv.switch.frag.out +++ b/Test/baseResults/spv.switch.frag.out @@ -1,400 +1,404 @@ -spv.switch.frag -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:134: 'switch' : last case/default label not followed by statements -WARNING: 0:139: 'switch' : last case/default label not followed by statements - - -Linked fragment stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 263 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 73 221 - ExecutionMode 4 OriginLowerLeft - Source ESSL 310 - Name 4 "main" - Name 15 "foo1(vf4;vf4;i1;" - Name 12 "v1" - Name 13 "v2" - Name 14 "i1" - Name 20 "foo2(vf4;vf4;i1;" - Name 17 "v1" - Name 18 "v2" - Name 19 "i1" - Name 58 "local" - Name 60 "c" - Name 71 "f" - Name 73 "x" - Name 127 "d" - Name 153 "i" - Name 171 "j" - Name 221 "color" - Name 227 "v" - Name 228 "param" - Name 230 "param" - Name 232 "param" - Name 240 "param" - Name 242 "param" - Name 244 "param" - Decorate 58(local) RelaxedPrecision - Decorate 60(c) RelaxedPrecision - Decorate 71(f) RelaxedPrecision - Decorate 73(x) RelaxedPrecision - Decorate 127(d) RelaxedPrecision - Decorate 153(i) RelaxedPrecision - Decorate 171(j) RelaxedPrecision - Decorate 221(color) RelaxedPrecision - Decorate 227(v) RelaxedPrecision - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Function 7(fvec4) - 9: TypeInt 32 1 - 10: TypePointer Function 9(int) - 11: TypeFunction 7(fvec4) 8(ptr) 8(ptr) 10(ptr) - 36: 6(float) Constant 0 - 37: 7(fvec4) ConstantComposite 36 36 36 36 - 47: 6(float) Constant 1065353216 - 48: 7(fvec4) ConstantComposite 47 47 47 47 - 59: TypePointer UniformConstant 9(int) - 60(c): 59(ptr) Variable UniformConstant - 63: 9(int) Constant 1 - 70: TypePointer Function 6(float) - 72: TypePointer Input 6(float) - 73(x): 72(ptr) Variable Input - 127(d): 59(ptr) Variable UniformConstant - 154: 9(int) Constant 0 - 159: 9(int) Constant 10 - 160: TypeBool - 172: 9(int) Constant 20 - 177: 9(int) Constant 30 - 182: 6(float) Constant 1120429670 - 202: 6(float) Constant 1079739679 - 220: TypePointer Output 6(float) - 221(color): 220(ptr) Variable Output - 226: TypePointer UniformConstant 7(fvec4) - 227(v): 226(ptr) Variable UniformConstant - 235: TypeInt 32 0 - 236: 235(int) Constant 1 - 247: 235(int) Constant 2 - 4(main): 2 Function None 3 - 5: Label - 58(local): 10(ptr) Variable Function - 71(f): 70(ptr) Variable Function - 153(i): 10(ptr) Variable Function - 171(j): 10(ptr) Variable Function - 228(param): 8(ptr) Variable Function - 230(param): 8(ptr) Variable Function - 232(param): 10(ptr) Variable Function - 240(param): 8(ptr) Variable Function - 242(param): 8(ptr) Variable Function - 244(param): 10(ptr) Variable Function - 61: 9(int) Load 60(c) - Store 58(local) 61 - 62: 9(int) Load 58(local) - 64: 9(int) IAdd 62 63 - Store 58(local) 64 - 65: 9(int) Load 60(c) - SelectionMerge 69 None - Switch 65 68 - case 1: 66 - case 2: 67 - 66: Label - 74: 6(float) Load 73(x) - 75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74 - Store 71(f) 75 - Branch 69 - 67: Label - 77: 6(float) Load 73(x) - 78: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 77 - Store 71(f) 78 - Branch 69 - 68: Label - 80: 6(float) Load 73(x) - 81: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 80 - Store 71(f) 81 - Branch 69 - 69: Label - 83: 9(int) Load 60(c) - SelectionMerge 87 None - Switch 83 86 - case 1: 84 - case 2: 85 - 84: Label - 88: 6(float) Load 73(x) - 89: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 88 - 90: 6(float) Load 71(f) - 91: 6(float) FAdd 90 89 - Store 71(f) 91 - Branch 85 - 85: Label - 92: 6(float) Load 73(x) - 93: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 92 - 94: 6(float) Load 71(f) - 95: 6(float) FAdd 94 93 - Store 71(f) 95 - Branch 87 - 86: Label - 97: 6(float) Load 73(x) - 98: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 97 - 99: 6(float) Load 71(f) - 100: 6(float) FAdd 99 98 - Store 71(f) 100 - Branch 87 - 87: Label - 102: 9(int) Load 60(c) - SelectionMerge 105 None - Switch 102 105 - case 1: 103 - case 2: 104 - 103: Label - 106: 6(float) Load 73(x) - 107: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 106 - 108: 6(float) Load 71(f) - 109: 6(float) FAdd 108 107 - Store 71(f) 109 - Branch 105 - 104: Label - 111: 6(float) Load 73(x) - 112: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 111 - 113: 6(float) Load 71(f) - 114: 6(float) FAdd 113 112 - Store 71(f) 114 - Branch 105 - 105: Label - 117: 9(int) Load 60(c) - SelectionMerge 121 None - Switch 117 120 - case 1: 118 - case 2: 119 - 118: Label - 122: 6(float) Load 73(x) - 123: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 122 - 124: 6(float) Load 71(f) - 125: 6(float) FAdd 124 123 - Store 71(f) 125 - Branch 121 - 119: Label - 128: 9(int) Load 127(d) - SelectionMerge 131 None - Switch 128 131 - case 1: 129 - case 2: 130 - 129: Label - 132: 6(float) Load 73(x) - 133: 6(float) Load 73(x) - 134: 6(float) FMul 132 133 - 135: 6(float) Load 73(x) - 136: 6(float) FMul 134 135 - 137: 6(float) Load 71(f) - 138: 6(float) FAdd 137 136 - Store 71(f) 138 - Branch 131 - 130: Label - 140: 6(float) Load 73(x) - 141: 6(float) Load 73(x) - 142: 6(float) FMul 140 141 - 143: 6(float) Load 71(f) - 144: 6(float) FAdd 143 142 - Store 71(f) 144 - Branch 131 - 131: Label - Branch 121 - 120: Label - 148: 6(float) Load 73(x) - 149: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 148 - 150: 6(float) Load 71(f) - 151: 6(float) FAdd 150 149 - Store 71(f) 151 - Branch 121 - 121: Label - Store 153(i) 154 - Branch 155 - 155: Label - 158: 9(int) Load 153(i) - 161: 160(bool) SLessThan 158 159 - LoopMerge 156 155 None - BranchConditional 161 157 156 - 157: Label - 162: 9(int) Load 60(c) - SelectionMerge 166 None - Switch 162 165 - case 1: 163 - case 2: 164 - 163: Label - 167: 6(float) Load 73(x) - 168: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 167 - 169: 6(float) Load 71(f) - 170: 6(float) FAdd 169 168 - Store 71(f) 170 - Store 171(j) 172 - Branch 173 - 173: Label - 176: 9(int) Load 171(j) - 178: 160(bool) SLessThan 176 177 - LoopMerge 174 173 None - BranchConditional 178 175 174 - 175: Label - 179: 6(float) Load 71(f) - 180: 6(float) FAdd 179 47 - Store 71(f) 180 - 181: 6(float) Load 71(f) - 183: 160(bool) FOrdLessThan 181 182 - SelectionMerge 185 None - BranchConditional 183 184 185 - 184: Label - Branch 174 - 185: Label - 187: 9(int) Load 171(j) - 188: 9(int) IAdd 187 63 - Store 171(j) 188 - Branch 173 - 174: Label - Branch 166 - 164: Label - 190: 6(float) Load 73(x) - 191: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 190 - 192: 6(float) Load 71(f) - 193: 6(float) FAdd 192 191 - Store 71(f) 193 - Branch 166 - 165: Label - 196: 6(float) Load 73(x) - 197: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 196 - 198: 6(float) Load 71(f) - 199: 6(float) FAdd 198 197 - Store 71(f) 199 - Branch 166 - 166: Label - 201: 6(float) Load 71(f) - 203: 160(bool) FOrdLessThan 201 202 - SelectionMerge 205 None - BranchConditional 203 204 205 - 204: Label - Branch 156 - 205: Label - 207: 9(int) Load 153(i) - 208: 9(int) IAdd 207 63 - Store 153(i) 208 - Branch 155 - 156: Label - 209: 9(int) Load 60(c) - SelectionMerge 212 None - Switch 209 212 - case 1: 210 - case 2: 211 - 210: Label - 213: 6(float) Load 73(x) - 214: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 213 - 215: 6(float) Load 71(f) - 216: 6(float) FAdd 215 214 - Store 71(f) 216 - Branch 212 - 211: Label - Branch 212 - 212: Label - 222: 6(float) Load 71(f) - 223: 9(int) Load 58(local) - 224: 6(float) ConvertSToF 223 - 225: 6(float) FAdd 222 224 - Store 221(color) 225 - 229: 7(fvec4) Load 227(v) - Store 228(param) 229 - 231: 7(fvec4) Load 227(v) - Store 230(param) 231 - 233: 9(int) Load 60(c) - Store 232(param) 233 - 234: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 228(param) 230(param) 232(param) - 237: 6(float) CompositeExtract 234 1 - 238: 6(float) Load 221(color) - 239: 6(float) FAdd 238 237 - Store 221(color) 239 - 241: 7(fvec4) Load 227(v) - Store 240(param) 241 - 243: 7(fvec4) Load 227(v) - Store 242(param) 243 - 245: 9(int) Load 60(c) - Store 244(param) 245 - 246: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 240(param) 242(param) 244(param) - 248: 6(float) CompositeExtract 246 2 - 249: 6(float) Load 221(color) - 250: 6(float) FAdd 249 248 - Store 221(color) 250 - 251: 9(int) Load 60(c) - SelectionMerge 254 None - Switch 251 253 - case 0: 252 - 252: Label - Branch 254 - 253: Label - Branch 254 - 254: Label - 258: 9(int) Load 60(c) - SelectionMerge 260 None - Switch 258 259 - 259: Label - Branch 260 - 260: Label - Return - FunctionEnd -15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 - 12(v1): 8(ptr) FunctionParameter - 13(v2): 8(ptr) FunctionParameter - 14(i1): 10(ptr) FunctionParameter - 16: Label - 22: 9(int) Load 14(i1) - SelectionMerge 26 None - Switch 22 26 - case 0: 23 - case 2: 24 - case 1: 24 - case 3: 25 - 23: Label - 27: 7(fvec4) Load 12(v1) - ReturnValue 27 - 24: Label - 29: 7(fvec4) Load 13(v2) - ReturnValue 29 - 25: Label - 31: 7(fvec4) Load 12(v1) - 32: 7(fvec4) Load 13(v2) - 33: 7(fvec4) FMul 31 32 - ReturnValue 33 - 26: Label - ReturnValue 37 - FunctionEnd -20(foo2(vf4;vf4;i1;): 7(fvec4) Function None 11 - 17(v1): 8(ptr) FunctionParameter - 18(v2): 8(ptr) FunctionParameter - 19(i1): 10(ptr) FunctionParameter - 21: Label - 39: 9(int) Load 19(i1) - SelectionMerge 44 None - Switch 39 44 - case 0: 40 - case 2: 41 - case 1: 42 - case 3: 43 - 40: Label - 45: 7(fvec4) Load 17(v1) - ReturnValue 45 - 41: Label - ReturnValue 48 - 42: Label - 50: 7(fvec4) Load 18(v2) - ReturnValue 50 - 43: Label - 52: 7(fvec4) Load 17(v1) - 53: 7(fvec4) Load 18(v2) - 54: 7(fvec4) FMul 52 53 - ReturnValue 54 - 44: Label - ReturnValue 37 - FunctionEnd +spv.switch.frag +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:134: 'switch' : last case/default label not followed by statements +WARNING: 0:139: 'switch' : last case/default label not followed by statements + + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 265 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 73 223 + ExecutionMode 4 OriginLowerLeft + Source ESSL 310 + Name 4 "main" + Name 15 "foo1(vf4;vf4;i1;" + Name 12 "v1" + Name 13 "v2" + Name 14 "i1" + Name 20 "foo2(vf4;vf4;i1;" + Name 17 "v1" + Name 18 "v2" + Name 19 "i1" + Name 58 "local" + Name 60 "c" + Name 71 "f" + Name 73 "x" + Name 127 "d" + Name 153 "i" + Name 172 "j" + Name 223 "color" + Name 229 "v" + Name 230 "param" + Name 232 "param" + Name 234 "param" + Name 242 "param" + Name 244 "param" + Name 246 "param" + Decorate 58(local) RelaxedPrecision + Decorate 60(c) RelaxedPrecision + Decorate 71(f) RelaxedPrecision + Decorate 73(x) RelaxedPrecision + Decorate 127(d) RelaxedPrecision + Decorate 153(i) RelaxedPrecision + Decorate 172(j) RelaxedPrecision + Decorate 223(color) RelaxedPrecision + Decorate 229(v) RelaxedPrecision + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeInt 32 1 + 10: TypePointer Function 9(int) + 11: TypeFunction 7(fvec4) 8(ptr) 8(ptr) 10(ptr) + 36: 6(float) Constant 0 + 37: 7(fvec4) ConstantComposite 36 36 36 36 + 47: 6(float) Constant 1065353216 + 48: 7(fvec4) ConstantComposite 47 47 47 47 + 59: TypePointer UniformConstant 9(int) + 60(c): 59(ptr) Variable UniformConstant + 63: 9(int) Constant 1 + 70: TypePointer Function 6(float) + 72: TypePointer Input 6(float) + 73(x): 72(ptr) Variable Input + 127(d): 59(ptr) Variable UniformConstant + 154: 9(int) Constant 0 + 160: 9(int) Constant 10 + 161: TypeBool + 173: 9(int) Constant 20 + 179: 9(int) Constant 30 + 184: 6(float) Constant 1120429670 + 204: 6(float) Constant 1079739679 + 222: TypePointer Output 6(float) + 223(color): 222(ptr) Variable Output + 228: TypePointer UniformConstant 7(fvec4) + 229(v): 228(ptr) Variable UniformConstant + 237: TypeInt 32 0 + 238: 237(int) Constant 1 + 249: 237(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 58(local): 10(ptr) Variable Function + 71(f): 70(ptr) Variable Function + 153(i): 10(ptr) Variable Function + 172(j): 10(ptr) Variable Function + 230(param): 8(ptr) Variable Function + 232(param): 8(ptr) Variable Function + 234(param): 10(ptr) Variable Function + 242(param): 8(ptr) Variable Function + 244(param): 8(ptr) Variable Function + 246(param): 10(ptr) Variable Function + 61: 9(int) Load 60(c) + Store 58(local) 61 + 62: 9(int) Load 58(local) + 64: 9(int) IAdd 62 63 + Store 58(local) 64 + 65: 9(int) Load 60(c) + SelectionMerge 69 None + Switch 65 68 + case 1: 66 + case 2: 67 + 66: Label + 74: 6(float) Load 73(x) + 75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74 + Store 71(f) 75 + Branch 69 + 67: Label + 77: 6(float) Load 73(x) + 78: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 77 + Store 71(f) 78 + Branch 69 + 68: Label + 80: 6(float) Load 73(x) + 81: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 80 + Store 71(f) 81 + Branch 69 + 69: Label + 83: 9(int) Load 60(c) + SelectionMerge 87 None + Switch 83 86 + case 1: 84 + case 2: 85 + 84: Label + 88: 6(float) Load 73(x) + 89: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 88 + 90: 6(float) Load 71(f) + 91: 6(float) FAdd 90 89 + Store 71(f) 91 + Branch 85 + 85: Label + 92: 6(float) Load 73(x) + 93: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 92 + 94: 6(float) Load 71(f) + 95: 6(float) FAdd 94 93 + Store 71(f) 95 + Branch 87 + 86: Label + 97: 6(float) Load 73(x) + 98: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 97 + 99: 6(float) Load 71(f) + 100: 6(float) FAdd 99 98 + Store 71(f) 100 + Branch 87 + 87: Label + 102: 9(int) Load 60(c) + SelectionMerge 105 None + Switch 102 105 + case 1: 103 + case 2: 104 + 103: Label + 106: 6(float) Load 73(x) + 107: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 106 + 108: 6(float) Load 71(f) + 109: 6(float) FAdd 108 107 + Store 71(f) 109 + Branch 105 + 104: Label + 111: 6(float) Load 73(x) + 112: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 111 + 113: 6(float) Load 71(f) + 114: 6(float) FAdd 113 112 + Store 71(f) 114 + Branch 105 + 105: Label + 117: 9(int) Load 60(c) + SelectionMerge 121 None + Switch 117 120 + case 1: 118 + case 2: 119 + 118: Label + 122: 6(float) Load 73(x) + 123: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 122 + 124: 6(float) Load 71(f) + 125: 6(float) FAdd 124 123 + Store 71(f) 125 + Branch 121 + 119: Label + 128: 9(int) Load 127(d) + SelectionMerge 131 None + Switch 128 131 + case 1: 129 + case 2: 130 + 129: Label + 132: 6(float) Load 73(x) + 133: 6(float) Load 73(x) + 134: 6(float) FMul 132 133 + 135: 6(float) Load 73(x) + 136: 6(float) FMul 134 135 + 137: 6(float) Load 71(f) + 138: 6(float) FAdd 137 136 + Store 71(f) 138 + Branch 131 + 130: Label + 140: 6(float) Load 73(x) + 141: 6(float) Load 73(x) + 142: 6(float) FMul 140 141 + 143: 6(float) Load 71(f) + 144: 6(float) FAdd 143 142 + Store 71(f) 144 + Branch 131 + 131: Label + Branch 121 + 120: Label + 148: 6(float) Load 73(x) + 149: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 148 + 150: 6(float) Load 71(f) + 151: 6(float) FAdd 150 149 + Store 71(f) 151 + Branch 121 + 121: Label + Store 153(i) 154 + Branch 158 + 155: Label + 163: 9(int) Load 60(c) + SelectionMerge 167 None + Switch 163 166 + case 1: 164 + case 2: 165 + 156: Label + 211: 9(int) Load 60(c) + SelectionMerge 214 None + Switch 211 214 + case 1: 212 + case 2: 213 + 157: Label + 209: 9(int) Load 153(i) + 210: 9(int) IAdd 209 63 + Store 153(i) 210 + Branch 158 + 158: Label + 159: 9(int) Load 153(i) + 162: 161(bool) SLessThan 159 160 + LoopMerge 156 157 None + BranchConditional 162 155 156 + 164: Label + 168: 6(float) Load 73(x) + 169: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 168 + 170: 6(float) Load 71(f) + 171: 6(float) FAdd 170 169 + Store 71(f) 171 + Store 172(j) 173 + Branch 177 + 174: Label + 181: 6(float) Load 71(f) + 182: 6(float) FAdd 181 47 + Store 71(f) 182 + 183: 6(float) Load 71(f) + 185: 161(bool) FOrdLessThan 183 184 + SelectionMerge 187 None + BranchConditional 185 186 187 + 175: Label + Branch 167 + 176: Label + 189: 9(int) Load 172(j) + 190: 9(int) IAdd 189 63 + Store 172(j) 190 + Branch 177 + 177: Label + 178: 9(int) Load 172(j) + 180: 161(bool) SLessThan 178 179 + LoopMerge 175 176 None + BranchConditional 180 174 175 + 186: Label + Branch 175 + 187: Label + Branch 176 + 165: Label + 192: 6(float) Load 73(x) + 193: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 192 + 194: 6(float) Load 71(f) + 195: 6(float) FAdd 194 193 + Store 71(f) 195 + Branch 167 + 166: Label + 198: 6(float) Load 73(x) + 199: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 198 + 200: 6(float) Load 71(f) + 201: 6(float) FAdd 200 199 + Store 71(f) 201 + Branch 167 + 167: Label + 203: 6(float) Load 71(f) + 205: 161(bool) FOrdLessThan 203 204 + SelectionMerge 207 None + BranchConditional 205 206 207 + 206: Label + Branch 156 + 207: Label + Branch 157 + 212: Label + 215: 6(float) Load 73(x) + 216: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 215 + 217: 6(float) Load 71(f) + 218: 6(float) FAdd 217 216 + Store 71(f) 218 + Branch 214 + 213: Label + Branch 214 + 214: Label + 224: 6(float) Load 71(f) + 225: 9(int) Load 58(local) + 226: 6(float) ConvertSToF 225 + 227: 6(float) FAdd 224 226 + Store 223(color) 227 + 231: 7(fvec4) Load 229(v) + Store 230(param) 231 + 233: 7(fvec4) Load 229(v) + Store 232(param) 233 + 235: 9(int) Load 60(c) + Store 234(param) 235 + 236: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 230(param) 232(param) 234(param) + 239: 6(float) CompositeExtract 236 1 + 240: 6(float) Load 223(color) + 241: 6(float) FAdd 240 239 + Store 223(color) 241 + 243: 7(fvec4) Load 229(v) + Store 242(param) 243 + 245: 7(fvec4) Load 229(v) + Store 244(param) 245 + 247: 9(int) Load 60(c) + Store 246(param) 247 + 248: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 242(param) 244(param) 246(param) + 250: 6(float) CompositeExtract 248 2 + 251: 6(float) Load 223(color) + 252: 6(float) FAdd 251 250 + Store 223(color) 252 + 253: 9(int) Load 60(c) + SelectionMerge 256 None + Switch 253 255 + case 0: 254 + 254: Label + Branch 256 + 255: Label + Branch 256 + 256: Label + 260: 9(int) Load 60(c) + SelectionMerge 262 None + Switch 260 261 + 261: Label + Branch 262 + 262: Label + Return + FunctionEnd +15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 + 12(v1): 8(ptr) FunctionParameter + 13(v2): 8(ptr) FunctionParameter + 14(i1): 10(ptr) FunctionParameter + 16: Label + 22: 9(int) Load 14(i1) + SelectionMerge 26 None + Switch 22 26 + case 0: 23 + case 2: 24 + case 1: 24 + case 3: 25 + 23: Label + 27: 7(fvec4) Load 12(v1) + ReturnValue 27 + 24: Label + 29: 7(fvec4) Load 13(v2) + ReturnValue 29 + 25: Label + 31: 7(fvec4) Load 12(v1) + 32: 7(fvec4) Load 13(v2) + 33: 7(fvec4) FMul 31 32 + ReturnValue 33 + 26: Label + ReturnValue 37 + FunctionEnd +20(foo2(vf4;vf4;i1;): 7(fvec4) Function None 11 + 17(v1): 8(ptr) FunctionParameter + 18(v2): 8(ptr) FunctionParameter + 19(i1): 10(ptr) FunctionParameter + 21: Label + 39: 9(int) Load 19(i1) + SelectionMerge 44 None + Switch 39 44 + case 0: 40 + case 2: 41 + case 1: 42 + case 3: 43 + 40: Label + 45: 7(fvec4) Load 17(v1) + ReturnValue 45 + 41: Label + ReturnValue 48 + 42: Label + 50: 7(fvec4) Load 18(v2) + ReturnValue 50 + 43: Label + 52: 7(fvec4) Load 17(v1) + 53: 7(fvec4) Load 18(v2) + 54: 7(fvec4) FMul 52 53 + ReturnValue 54 + 44: Label + ReturnValue 37 + FunctionEnd diff --git a/Test/baseResults/spv.while-continue-break.vert.out b/Test/baseResults/spv.while-continue-break.vert.out index 5305b987..0938db43 100755 --- a/Test/baseResults/spv.while-continue-break.vert.out +++ b/Test/baseResults/spv.while-continue-break.vert.out @@ -1,86 +1,88 @@ -spv.while-continue-break.vert - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 42 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 40 41 - Source ESSL 300 - Name 4 "main" - Name 8 "i" - Name 17 "A" - Name 25 "B" - Name 27 "C" - Name 37 "D" - Name 40 "gl_VertexID" - Name 41 "gl_InstanceID" - Decorate 40(gl_VertexID) BuiltIn VertexId - Decorate 41(gl_InstanceID) BuiltIn InstanceId - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 0 - 14: 6(int) Constant 10 - 15: TypeBool - 18: 6(int) Constant 1 - 20: 6(int) Constant 2 - 29: 6(int) Constant 5 - 38: 6(int) Constant 3 - 39: TypePointer Input 6(int) - 40(gl_VertexID): 39(ptr) Variable Input -41(gl_InstanceID): 39(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 8(i): 7(ptr) Variable Function - 17(A): 7(ptr) Variable Function - 25(B): 7(ptr) Variable Function - 27(C): 7(ptr) Variable Function - 37(D): 7(ptr) Variable Function - Store 8(i) 9 - Branch 10 - 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - Store 17(A) 18 - 19: 6(int) Load 8(i) - 21: 6(int) SMod 19 20 - 22: 15(bool) IEqual 21 9 - SelectionMerge 24 None - BranchConditional 22 23 24 - 23: Label - Store 25(B) 20 - Branch 10 - 26: Label - Store 27(C) 20 - Branch 24 - 24: Label - 28: 6(int) Load 8(i) - 30: 6(int) SMod 28 29 - 31: 15(bool) IEqual 30 9 - SelectionMerge 33 None - BranchConditional 31 32 33 - 32: Label - Store 25(B) 20 - Branch 11 - 34: Label - Store 27(C) 20 - Branch 33 - 33: Label - 35: 6(int) Load 8(i) - 36: 6(int) IAdd 35 18 - Store 8(i) 36 - Branch 10 - 11: Label - Store 37(D) 38 - Return - FunctionEnd +spv.while-continue-break.vert + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 43 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 41 42 + Source ESSL 300 + Name 4 "main" + Name 8 "i" + Name 18 "A" + Name 26 "B" + Name 28 "C" + Name 38 "D" + Name 41 "gl_VertexID" + Name 42 "gl_InstanceID" + Decorate 41(gl_VertexID) BuiltIn VertexId + Decorate 42(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 15: 6(int) Constant 10 + 16: TypeBool + 19: 6(int) Constant 1 + 21: 6(int) Constant 2 + 30: 6(int) Constant 5 + 39: 6(int) Constant 3 + 40: TypePointer Input 6(int) + 41(gl_VertexID): 40(ptr) Variable Input +42(gl_InstanceID): 40(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 18(A): 7(ptr) Variable Function + 26(B): 7(ptr) Variable Function + 28(C): 7(ptr) Variable Function + 38(D): 7(ptr) Variable Function + Store 8(i) 9 + Branch 13 + 10: Label + Store 18(A) 19 + 20: 6(int) Load 8(i) + 22: 6(int) SMod 20 21 + 23: 16(bool) IEqual 22 9 + SelectionMerge 25 None + BranchConditional 23 24 25 + 11: Label + Store 38(D) 39 + Return + 12: Label + Branch 13 + 13: Label + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 11 12 None + BranchConditional 17 10 11 + 24: Label + Store 26(B) 21 + Branch 12 + 27: Label + Store 28(C) 21 + Branch 25 + 25: Label + 29: 6(int) Load 8(i) + 31: 6(int) SMod 29 30 + 32: 16(bool) IEqual 31 9 + SelectionMerge 34 None + BranchConditional 32 33 34 + 33: Label + Store 26(B) 21 + Branch 11 + 35: Label + Store 28(C) 21 + Branch 34 + 34: Label + 36: 6(int) Load 8(i) + 37: 6(int) IAdd 36 19 + Store 8(i) 37 + Branch 12 + FunctionEnd diff --git a/Test/baseResults/spv.while-simple.vert.out b/Test/baseResults/spv.while-simple.vert.out index 14d46dd3..3684101c 100755 --- a/Test/baseResults/spv.while-simple.vert.out +++ b/Test/baseResults/spv.while-simple.vert.out @@ -1,49 +1,51 @@ -spv.while-simple.vert - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 23 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 21 22 - Source ESSL 300 - Name 4 "main" - Name 8 "i" - Name 21 "gl_VertexID" - Name 22 "gl_InstanceID" - Decorate 21(gl_VertexID) BuiltIn VertexId - Decorate 22(gl_InstanceID) BuiltIn InstanceId - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 0 - 14: 6(int) Constant 10 - 15: TypeBool - 18: 6(int) Constant 1 - 20: TypePointer Input 6(int) - 21(gl_VertexID): 20(ptr) Variable Input -22(gl_InstanceID): 20(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 8(i): 7(ptr) Variable Function - Store 8(i) 9 - Branch 10 - 10: Label - 13: 6(int) Load 8(i) - 16: 15(bool) SLessThan 13 14 - LoopMerge 11 10 None - BranchConditional 16 12 11 - 12: Label - 17: 6(int) Load 8(i) - 19: 6(int) IAdd 17 18 - Store 8(i) 19 - Branch 10 - 11: Label - Return - FunctionEnd +spv.while-simple.vert + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 24 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 22 23 + Source ESSL 300 + Name 4 "main" + Name 8 "i" + Name 22 "gl_VertexID" + Name 23 "gl_InstanceID" + Decorate 22(gl_VertexID) BuiltIn VertexId + Decorate 23(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 15: 6(int) Constant 10 + 16: TypeBool + 19: 6(int) Constant 1 + 21: TypePointer Input 6(int) + 22(gl_VertexID): 21(ptr) Variable Input +23(gl_InstanceID): 21(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 13 + 10: Label + 18: 6(int) Load 8(i) + 20: 6(int) IAdd 18 19 + Store 8(i) 20 + Branch 12 + 11: Label + Return + 12: Label + Branch 13 + 13: Label + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 11 12 None + BranchConditional 17 10 11 + FunctionEnd diff --git a/Test/baseResults/spv.whileLoop.frag.out b/Test/baseResults/spv.whileLoop.frag.out index 591129cd..62279827 100755 --- a/Test/baseResults/spv.whileLoop.frag.out +++ b/Test/baseResults/spv.whileLoop.frag.out @@ -1,62 +1,64 @@ -spv.whileLoop.frag - -Linked fragment stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 34 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 - ExecutionMode 4 OriginLowerLeft - Source GLSL 110 - Name 4 "main" - Name 9 "color" - Name 11 "BaseColor" - Name 22 "d" - Name 27 "bigColor" - Name 32 "gl_FragColor" - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Function 7(fvec4) - 10: TypePointer Input 7(fvec4) - 11(BaseColor): 10(ptr) Variable Input - 16: TypeInt 32 0 - 17: 16(int) Constant 0 - 18: TypePointer Function 6(float) - 21: TypePointer UniformConstant 6(float) - 22(d): 21(ptr) Variable UniformConstant - 24: TypeBool - 26: TypePointer UniformConstant 7(fvec4) - 27(bigColor): 26(ptr) Variable UniformConstant - 31: TypePointer Output 7(fvec4) -32(gl_FragColor): 31(ptr) Variable Output - 4(main): 2 Function None 3 - 5: Label - 9(color): 8(ptr) Variable Function - 12: 7(fvec4) Load 11(BaseColor) - Store 9(color) 12 - Branch 13 - 13: Label - 19: 18(ptr) AccessChain 9(color) 17 - 20: 6(float) Load 19 - 23: 6(float) Load 22(d) - 25: 24(bool) FOrdLessThan 20 23 - LoopMerge 14 13 None - BranchConditional 25 15 14 - 15: Label - 28: 7(fvec4) Load 27(bigColor) - 29: 7(fvec4) Load 9(color) - 30: 7(fvec4) FAdd 29 28 - Store 9(color) 30 - Branch 13 - 14: Label - 33: 7(fvec4) Load 9(color) - Store 32(gl_FragColor) 33 - Return - FunctionEnd +spv.whileLoop.frag + +Linked fragment stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 35 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 11 + ExecutionMode 4 OriginLowerLeft + Source GLSL 110 + Name 4 "main" + Name 9 "color" + Name 11 "BaseColor" + Name 23 "d" + Name 28 "bigColor" + Name 33 "gl_FragColor" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 10: TypePointer Input 7(fvec4) + 11(BaseColor): 10(ptr) Variable Input + 17: TypeInt 32 0 + 18: 17(int) Constant 0 + 19: TypePointer Function 6(float) + 22: TypePointer UniformConstant 6(float) + 23(d): 22(ptr) Variable UniformConstant + 25: TypeBool + 27: TypePointer UniformConstant 7(fvec4) + 28(bigColor): 27(ptr) Variable UniformConstant + 32: TypePointer Output 7(fvec4) +33(gl_FragColor): 32(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 9(color): 8(ptr) Variable Function + 12: 7(fvec4) Load 11(BaseColor) + Store 9(color) 12 + Branch 16 + 13: Label + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 15 + 14: Label + 34: 7(fvec4) Load 9(color) + Store 33(gl_FragColor) 34 + Return + 15: Label + Branch 16 + 16: Label + 20: 19(ptr) AccessChain 9(color) 18 + 21: 6(float) Load 20 + 24: 6(float) Load 23(d) + 26: 25(bool) FOrdLessThan 21 24 + LoopMerge 14 15 None + BranchConditional 26 13 14 + FunctionEnd diff --git a/Test/test-spirv-list b/Test/test-spirv-list index 1efcfcb3..504ee6d3 100644 --- a/Test/test-spirv-list +++ b/Test/test-spirv-list @@ -5,6 +5,8 @@ spv.do-simple.vert spv.do-while-continue-break.vert spv.for-continue-break.vert spv.for-simple.vert +spv.for-notest.vert +spv.for-nobody.vert spv.while-continue-break.vert spv.while-simple.vert # vulkan-specific tests From 832c65c33b39a7b95d12fb569949241859469d6e Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Mon, 11 Jan 2016 15:57:11 -0500 Subject: [PATCH 6/7] Fix back-branch target for do-while loops. To ensure back branches always go to a header block, create a header block even for !testFirst loops. Then unify common code between the testFirst/!testFirst cases. Generate the header-block code first, so update golden files. Realize that certain infinite loops generate invalid SPIR-V, so put a TODO to instead abort code generation in such cases. Change-Id: I1e173c8f73daad186cfc666b7d72bd563ed7665d --- SPIRV/GlslangToSpv.cpp | 29 +- SPIRV/SpvBuilder.cpp | 2 +- SPIRV/SpvBuilder.h | 2 +- Test/baseResults/spv.dataOutIndirect.vert.out | 30 +- Test/baseResults/spv.do-simple.vert.out | 100 +- .../spv.do-while-continue-break.vert.out | 136 +- Test/baseResults/spv.doWhileLoop.frag.out | 58 +- .../spv.for-continue-break.vert.out | 70 +- Test/baseResults/spv.for-nobody.vert.out | 118 +- Test/baseResults/spv.for-notest.vert.out | 103 +- Test/baseResults/spv.for-simple.vert.out | 110 +- Test/baseResults/spv.forLoop.frag.out | 222 +- Test/baseResults/spv.localAggregates.frag.out | 96 +- Test/baseResults/spv.loops.frag.out | 2014 +++++++++-------- Test/baseResults/spv.loopsArtificial.frag.out | 530 ++--- Test/baseResults/spv.switch.frag.out | 342 +-- .../spv.while-continue-break.vert.out | 68 +- Test/baseResults/spv.while-simple.vert.out | 26 +- Test/baseResults/spv.whileLoop.frag.out | 32 +- Test/spv.for-notest.vert | 3 + 20 files changed, 2062 insertions(+), 2029 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index e5e2169b..00369d21 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1342,19 +1342,17 @@ void TGlslangToSpvTraverser::visitConstantUnion(glslang::TIntermConstantUnion* n bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIntermLoop* node) { auto blocks = builder.makeNewLoop(); + builder.createBranch(&blocks.head); if (node->testFirst() && node->getTest()) { - spv::Block& head = builder.makeNewBlock(); - builder.createBranch(&head); - - builder.setBuildPoint(&head); + builder.setBuildPoint(&blocks.head); node->getTest()->traverse(this); spv::Id condition = builder.accessChainLoad(convertGlslangToSpvType(node->getTest()->getType())); builder.createLoopMerge(&blocks.merge, &blocks.continue_target, spv::LoopControlMaskNone); builder.createConditionalBranch(condition, &blocks.body, &blocks.merge); - breakForLoop.push(true); builder.setBuildPoint(&blocks.body); + breakForLoop.push(true); if (node->getBody()) node->getBody()->traverse(this); builder.createBranch(&blocks.continue_target); @@ -1363,8 +1361,14 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn builder.setBuildPoint(&blocks.continue_target); if (node->getTerminal()) node->getTerminal()->traverse(this); - builder.createBranch(&head); + builder.createBranch(&blocks.head); } else { + // Spec requires back edges to target header blocks, and every header + // block must dominate its merge block. Create an empty header block + // here to ensure these conditions are met even when body contains + // non-trivial control flow. + builder.setBuildPoint(&blocks.head); + builder.createLoopMerge(&blocks.merge, &blocks.continue_target, spv::LoopControlMaskNone); builder.createBranch(&blocks.body); breakForLoop.push(true); @@ -1381,14 +1385,17 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn node->getTest()->traverse(this); spv::Id condition = builder.accessChainLoad(convertGlslangToSpvType(node->getTest()->getType())); - builder.createLoopMerge(&blocks.merge, &blocks.continue_target, - spv::LoopControlMaskNone); - builder.createConditionalBranch(condition, &blocks.body, &blocks.merge); + builder.createConditionalBranch(condition, &blocks.head, &blocks.merge); } else { - builder.createBranch(&blocks.body); + // TODO: unless there was a break instruction somewhere in the body, + // this is an infinite loop, so we should abort code generation with + // a warning. As it stands now, nothing will jump to the merge + // block, and it may be dropped as unreachable by the SPIR-V dumper. + // That, in turn, will result in a non-existing %ID in the LoopMerge + // above. + builder.createBranch(&blocks.head); } } - builder.setBuildPoint(&blocks.merge); builder.closeLoop(); return false; diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index eb8c4d37..f9c4ae6c 100755 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1763,7 +1763,7 @@ Block& Builder::makeNewBlock() Builder::LoopBlocks& Builder::makeNewLoop() { - loops.push({makeNewBlock(), makeNewBlock(), makeNewBlock()}); + loops.push({makeNewBlock(), makeNewBlock(), makeNewBlock(), makeNewBlock()}); return loops.top(); } diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index a1ed84ca..fa3600b6 100755 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -374,7 +374,7 @@ public: void endSwitch(std::vector& segmentBB); struct LoopBlocks { - Block &body, &merge, &continue_target; + Block &head, &body, &merge, &continue_target; }; // Start a new loop and prepare the builder to generate code for it. Until diff --git a/Test/baseResults/spv.dataOutIndirect.vert.out b/Test/baseResults/spv.dataOutIndirect.vert.out index 0efe6568..5cccee1d 100755 --- a/Test/baseResults/spv.dataOutIndirect.vert.out +++ b/Test/baseResults/spv.dataOutIndirect.vert.out @@ -48,26 +48,26 @@ Linked vertex stage: 5: Label 8(i): 7(ptr) Variable Function Store 8(i) 9 - Branch 13 + Branch 10 10: Label - 25: 6(int) Load 8(i) - 28: 19(fvec4) Load 27(color) - 30: 29(ptr) AccessChain 24(colorOut) 25 - Store 30 28 - Branch 12 - 11: Label + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 12 13 None + BranchConditional 17 11 12 + 11: Label + 25: 6(int) Load 8(i) + 28: 19(fvec4) Load 27(color) + 30: 29(ptr) AccessChain 24(colorOut) 25 + Store 30 28 + Branch 13 + 12: Label 35: 29(ptr) AccessChain 24(colorOut) 34 36: 19(fvec4) Load 35 Store 33(gl_Position) 36 Return - 12: Label + 13: Label 31: 6(int) Load 8(i) 32: 6(int) IAdd 31 9 Store 8(i) 32 - Branch 13 - 13: Label - 14: 6(int) Load 8(i) - 17: 16(bool) SLessThan 14 15 - LoopMerge 11 12 None - BranchConditional 17 10 11 - FunctionEnd + Branch 10 + FunctionEnd diff --git a/Test/baseResults/spv.do-simple.vert.out b/Test/baseResults/spv.do-simple.vert.out index 694da83a..e38c0f5a 100755 --- a/Test/baseResults/spv.do-simple.vert.out +++ b/Test/baseResults/spv.do-simple.vert.out @@ -1,49 +1,51 @@ -spv.do-simple.vert - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 23 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 21 22 - Source ESSL 300 - Name 4 "main" - Name 8 "i" - Name 21 "gl_VertexID" - Name 22 "gl_InstanceID" - Decorate 21(gl_VertexID) BuiltIn VertexId - Decorate 22(gl_InstanceID) BuiltIn InstanceId - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 0 - 14: 6(int) Constant 1 - 17: 6(int) Constant 10 - 18: TypeBool - 20: TypePointer Input 6(int) - 21(gl_VertexID): 20(ptr) Variable Input -22(gl_InstanceID): 20(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 8(i): 7(ptr) Variable Function - Store 8(i) 9 - Branch 10 - 10: Label - 13: 6(int) Load 8(i) - 15: 6(int) IAdd 13 14 - Store 8(i) 15 - Branch 12 - 11: Label - Return - 12: Label - 16: 6(int) Load 8(i) - 19: 18(bool) SLessThan 16 17 - LoopMerge 11 12 None - BranchConditional 19 10 11 - FunctionEnd +spv.do-simple.vert + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 24 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 22 23 + Source ESSL 300 + Name 4 "main" + Name 8 "i" + Name 22 "gl_VertexID" + Name 23 "gl_InstanceID" + Decorate 22(gl_VertexID) BuiltIn VertexId + Decorate 23(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 15: 6(int) Constant 1 + 18: 6(int) Constant 10 + 19: TypeBool + 21: TypePointer Input 6(int) + 22(gl_VertexID): 21(ptr) Variable Input +23(gl_InstanceID): 21(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 11 + 11: Label + 14: 6(int) Load 8(i) + 16: 6(int) IAdd 14 15 + Store 8(i) 16 + Branch 13 + 12: Label + Return + 13: Label + 17: 6(int) Load 8(i) + 20: 19(bool) SLessThan 17 18 + BranchConditional 20 10 12 + FunctionEnd diff --git a/Test/baseResults/spv.do-while-continue-break.vert.out b/Test/baseResults/spv.do-while-continue-break.vert.out index c70c28da..ec4d1009 100755 --- a/Test/baseResults/spv.do-while-continue-break.vert.out +++ b/Test/baseResults/spv.do-while-continue-break.vert.out @@ -5,89 +5,91 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 45 +// Id's are bound by 46 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 43 44 + EntryPoint Vertex 4 "main" 44 45 Source ESSL 300 Name 4 "main" Name 8 "i" - Name 13 "A" - Name 20 "B" - Name 23 "C" - Name 29 "D" - Name 32 "E" - Name 34 "F" - Name 40 "G" - Name 43 "gl_VertexID" - Name 44 "gl_InstanceID" - Decorate 43(gl_VertexID) BuiltIn VertexId - Decorate 44(gl_InstanceID) BuiltIn InstanceId + Name 14 "A" + Name 21 "B" + Name 24 "C" + Name 30 "D" + Name 33 "E" + Name 35 "F" + Name 41 "G" + Name 44 "gl_VertexID" + Name 45 "gl_InstanceID" + Decorate 44(gl_VertexID) BuiltIn VertexId + Decorate 45(gl_InstanceID) BuiltIn InstanceId 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 7: TypePointer Function 6(int) 9: 6(int) Constant 0 - 15: 6(int) Constant 2 - 16: TypeBool - 21: 6(int) Constant 1 - 25: 6(int) Constant 5 - 30: 6(int) Constant 3 - 33: 6(int) Constant 42 - 35: 6(int) Constant 99 - 38: 6(int) Constant 19 - 41: 6(int) Constant 12 - 42: TypePointer Input 6(int) - 43(gl_VertexID): 42(ptr) Variable Input -44(gl_InstanceID): 42(ptr) Variable Input + 16: 6(int) Constant 2 + 17: TypeBool + 22: 6(int) Constant 1 + 26: 6(int) Constant 5 + 31: 6(int) Constant 3 + 34: 6(int) Constant 42 + 36: 6(int) Constant 99 + 39: 6(int) Constant 19 + 42: 6(int) Constant 12 + 43: TypePointer Input 6(int) + 44(gl_VertexID): 43(ptr) Variable Input +45(gl_InstanceID): 43(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(i): 7(ptr) Variable Function - 13(A): 7(ptr) Variable Function - 20(B): 7(ptr) Variable Function - 23(C): 7(ptr) Variable Function - 29(D): 7(ptr) Variable Function - 32(E): 7(ptr) Variable Function - 34(F): 7(ptr) Variable Function - 40(G): 7(ptr) Variable Function + 14(A): 7(ptr) Variable Function + 21(B): 7(ptr) Variable Function + 24(C): 7(ptr) Variable Function + 30(D): 7(ptr) Variable Function + 33(E): 7(ptr) Variable Function + 35(F): 7(ptr) Variable Function + 41(G): 7(ptr) Variable Function Store 8(i) 9 Branch 10 10: Label - Store 13(A) 9 - 14: 6(int) Load 8(i) - 17: 16(bool) IEqual 14 15 - SelectionMerge 19 None - BranchConditional 17 18 19 - 11: Label - Store 40(G) 41 - Return + LoopMerge 12 13 None + Branch 11 + 11: Label + Store 14(A) 9 + 15: 6(int) Load 8(i) + 18: 17(bool) IEqual 15 16 + SelectionMerge 20 None + BranchConditional 18 19 20 12: Label - 36: 6(int) Load 8(i) - 37: 6(int) IAdd 36 21 - Store 8(i) 37 - 39: 16(bool) SLessThan 37 38 - LoopMerge 11 12 None - BranchConditional 39 10 11 - 18: Label - Store 20(B) 21 - Branch 12 - 22: Label - Store 23(C) 15 - Branch 19 - 19: Label - 24: 6(int) Load 8(i) - 26: 16(bool) IEqual 24 25 - SelectionMerge 28 None - BranchConditional 26 27 28 - 27: Label - Store 29(D) 30 - Branch 11 - 31: Label - Store 32(E) 33 - Branch 28 - 28: Label - Store 34(F) 35 - Branch 12 - FunctionEnd + Store 41(G) 42 + Return + 13: Label + 37: 6(int) Load 8(i) + 38: 6(int) IAdd 37 22 + Store 8(i) 38 + 40: 17(bool) SLessThan 38 39 + BranchConditional 40 10 12 + 19: Label + Store 21(B) 22 + Branch 13 + 23: Label + Store 24(C) 16 + Branch 20 + 20: Label + 25: 6(int) Load 8(i) + 27: 17(bool) IEqual 25 26 + SelectionMerge 29 None + BranchConditional 27 28 29 + 28: Label + Store 30(D) 31 + Branch 12 + 32: Label + Store 33(E) 34 + Branch 29 + 29: Label + Store 35(F) 36 + Branch 13 + FunctionEnd diff --git a/Test/baseResults/spv.doWhileLoop.frag.out b/Test/baseResults/spv.doWhileLoop.frag.out index 64d05813..5e01fc67 100755 --- a/Test/baseResults/spv.doWhileLoop.frag.out +++ b/Test/baseResults/spv.doWhileLoop.frag.out @@ -5,7 +5,7 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 34 +// Id's are bound by 35 Capability Shader 1: ExtInstImport "GLSL.std.450" @@ -16,9 +16,9 @@ Linked fragment stage: Name 4 "main" Name 9 "color" Name 11 "BaseColor" - Name 17 "bigColor" - Name 27 "d" - Name 32 "gl_FragColor" + Name 18 "bigColor" + Name 28 "d" + Name 33 "gl_FragColor" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -26,16 +26,16 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 16: TypePointer UniformConstant 7(fvec4) - 17(bigColor): 16(ptr) Variable UniformConstant - 21: TypeInt 32 0 - 22: 21(int) Constant 0 - 23: TypePointer Function 6(float) - 26: TypePointer UniformConstant 6(float) - 27(d): 26(ptr) Variable UniformConstant - 29: TypeBool - 31: TypePointer Output 7(fvec4) -32(gl_FragColor): 31(ptr) Variable Output + 17: TypePointer UniformConstant 7(fvec4) + 18(bigColor): 17(ptr) Variable UniformConstant + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Function 6(float) + 27: TypePointer UniformConstant 6(float) + 28(d): 27(ptr) Variable UniformConstant + 30: TypeBool + 32: TypePointer Output 7(fvec4) +33(gl_FragColor): 32(ptr) Variable Output 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -43,20 +43,22 @@ Linked fragment stage: Store 9(color) 12 Branch 13 13: Label - 18: 7(fvec4) Load 17(bigColor) - 19: 7(fvec4) Load 9(color) - 20: 7(fvec4) FAdd 19 18 - Store 9(color) 20 - Branch 15 + LoopMerge 15 16 None + Branch 14 14: Label - 33: 7(fvec4) Load 9(color) - Store 32(gl_FragColor) 33 - Return + 19: 7(fvec4) Load 18(bigColor) + 20: 7(fvec4) Load 9(color) + 21: 7(fvec4) FAdd 20 19 + Store 9(color) 21 + Branch 16 15: Label - 24: 23(ptr) AccessChain 9(color) 22 - 25: 6(float) Load 24 - 28: 6(float) Load 27(d) - 30: 29(bool) FOrdLessThan 25 28 - LoopMerge 14 15 None - BranchConditional 30 13 14 + 34: 7(fvec4) Load 9(color) + Store 33(gl_FragColor) 34 + Return + 16: Label + 25: 24(ptr) AccessChain 9(color) 23 + 26: 6(float) Load 25 + 29: 6(float) Load 28(d) + 31: 30(bool) FOrdLessThan 26 29 + BranchConditional 31 13 15 FunctionEnd diff --git a/Test/baseResults/spv.for-continue-break.vert.out b/Test/baseResults/spv.for-continue-break.vert.out index df2acab4..139d6274 100755 --- a/Test/baseResults/spv.for-continue-break.vert.out +++ b/Test/baseResults/spv.for-continue-break.vert.out @@ -51,46 +51,46 @@ Linked vertex stage: 38(F): 7(ptr) Variable Function 42(G): 7(ptr) Variable Function Store 8(i) 9 - Branch 13 + Branch 10 10: Label - Store 18(A) 19 - 20: 6(int) Load 8(i) - 22: 6(int) SMod 20 21 - 23: 16(bool) IEqual 22 9 - SelectionMerge 25 None - BranchConditional 23 24 25 + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 12 13 None + BranchConditional 17 11 12 11: Label - Store 42(G) 43 - Return - 12: Label - 40: 6(int) Load 8(i) - 41: 6(int) IAdd 40 19 - Store 8(i) 41 - Branch 13 - 13: Label - 14: 6(int) Load 8(i) - 17: 16(bool) SLessThan 14 15 - LoopMerge 11 12 None - BranchConditional 17 10 11 + Store 18(A) 19 + 20: 6(int) Load 8(i) + 22: 6(int) SMod 20 21 + 23: 16(bool) IEqual 22 9 + SelectionMerge 25 None + BranchConditional 23 24 25 + 12: Label + Store 42(G) 43 + Return + 13: Label + 40: 6(int) Load 8(i) + 41: 6(int) IAdd 40 19 + Store 8(i) 41 + Branch 10 24: Label Store 26(B) 19 - Branch 12 + Branch 13 27: Label Store 28(C) 19 Branch 25 - 25: Label - 29: 6(int) Load 8(i) - 31: 6(int) SMod 29 30 - 32: 16(bool) IEqual 31 9 - SelectionMerge 34 None - BranchConditional 32 33 34 - 33: Label - Store 35(D) 19 - Branch 11 - 36: Label - Store 37(E) 19 - Branch 34 - 34: Label - Store 38(F) 39 + 25: Label + 29: 6(int) Load 8(i) + 31: 6(int) SMod 29 30 + 32: 16(bool) IEqual 31 9 + SelectionMerge 34 None + BranchConditional 32 33 34 + 33: Label + Store 35(D) 19 Branch 12 - FunctionEnd + 36: Label + Store 37(E) 19 + Branch 34 + 34: Label + Store 38(F) 39 + Branch 13 + FunctionEnd diff --git a/Test/baseResults/spv.for-nobody.vert.out b/Test/baseResults/spv.for-nobody.vert.out index 1645c66a..3db2af64 100644 --- a/Test/baseResults/spv.for-nobody.vert.out +++ b/Test/baseResults/spv.for-nobody.vert.out @@ -1,59 +1,59 @@ -spv.for-nobody.vert -Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. - - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 27 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 22 25 26 - Source GLSL 450 - Name 4 "main" - Name 8 "i" - Name 22 "r" - Name 25 "gl_VertexID" - Name 26 "gl_InstanceID" - Decorate 22(r) Location 0 - Decorate 25(gl_VertexID) BuiltIn VertexId - Decorate 26(gl_InstanceID) BuiltIn InstanceId - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 0 - 15: 6(int) Constant 10 - 16: TypeBool - 19: 6(int) Constant 1 - 21: TypePointer Output 6(int) - 22(r): 21(ptr) Variable Output - 24: TypePointer Input 6(int) - 25(gl_VertexID): 24(ptr) Variable Input -26(gl_InstanceID): 24(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 8(i): 7(ptr) Variable Function - Store 8(i) 9 - Branch 13 - 10: Label - Branch 12 - 11: Label - 23: 6(int) Load 8(i) - Store 22(r) 23 - Return - 12: Label - 18: 6(int) Load 8(i) - 20: 6(int) IAdd 18 19 - Store 8(i) 20 - Branch 13 - 13: Label - 14: 6(int) Load 8(i) - 17: 16(bool) SLessThan 14 15 - LoopMerge 11 12 None - BranchConditional 17 10 11 - FunctionEnd +spv.for-nobody.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 27 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 22 25 26 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 22 "r" + Name 25 "gl_VertexID" + Name 26 "gl_InstanceID" + Decorate 22(r) Location 0 + Decorate 25(gl_VertexID) BuiltIn VertexId + Decorate 26(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 15: 6(int) Constant 10 + 16: TypeBool + 19: 6(int) Constant 1 + 21: TypePointer Output 6(int) + 22(r): 21(ptr) Variable Output + 24: TypePointer Input 6(int) + 25(gl_VertexID): 24(ptr) Variable Input +26(gl_InstanceID): 24(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 12 13 None + BranchConditional 17 11 12 + 11: Label + Branch 13 + 12: Label + 23: 6(int) Load 8(i) + Store 22(r) 23 + Return + 13: Label + 18: 6(int) Load 8(i) + 20: 6(int) IAdd 18 19 + Store 8(i) 20 + Branch 10 + FunctionEnd diff --git a/Test/baseResults/spv.for-notest.vert.out b/Test/baseResults/spv.for-notest.vert.out index e55ef9b6..0b77cb11 100644 --- a/Test/baseResults/spv.for-notest.vert.out +++ b/Test/baseResults/spv.for-notest.vert.out @@ -1,50 +1,53 @@ -spv.for-notest.vert -Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. - - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 22 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 14 20 21 - Source GLSL 450 - Name 4 "main" - Name 8 "i" - Name 14 "r" - Name 20 "gl_VertexID" - Name 21 "gl_InstanceID" - Decorate 14(r) Location 0 - Decorate 20(gl_VertexID) BuiltIn VertexId - Decorate 21(gl_InstanceID) BuiltIn InstanceId - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 0 - 13: TypePointer Output 6(int) - 14(r): 13(ptr) Variable Output - 17: 6(int) Constant 1 - 19: TypePointer Input 6(int) - 20(gl_VertexID): 19(ptr) Variable Input -21(gl_InstanceID): 19(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 8(i): 7(ptr) Variable Function - Store 8(i) 9 - Branch 10 - 10: Label - 15: 6(int) Load 8(i) - Store 14(r) 15 - Branch 12 - 12: Label - 16: 6(int) Load 8(i) - 18: 6(int) IAdd 16 17 - Store 8(i) 18 - Branch 10 - FunctionEnd +spv.for-notest.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 23 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 15 21 22 + Source GLSL 450 + Name 4 "main" + Name 8 "i" + Name 15 "r" + Name 21 "gl_VertexID" + Name 22 "gl_InstanceID" + Decorate 15(r) Location 0 + Decorate 21(gl_VertexID) BuiltIn VertexId + Decorate 22(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 14: TypePointer Output 6(int) + 15(r): 14(ptr) Variable Output + 18: 6(int) Constant 1 + 20: TypePointer Input 6(int) + 21(gl_VertexID): 20(ptr) Variable Input +22(gl_InstanceID): 20(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + LoopMerge 12 13 None + Branch 11 + 11: Label + 16: 6(int) Load 8(i) + Store 15(r) 16 + Branch 13 + 13: Label + 17: 6(int) Load 8(i) + 19: 6(int) IAdd 17 18 + Store 8(i) 19 + Branch 10 + FunctionEnd diff --git a/Test/baseResults/spv.for-simple.vert.out b/Test/baseResults/spv.for-simple.vert.out index 3dd4fc36..9f17ac1e 100755 --- a/Test/baseResults/spv.for-simple.vert.out +++ b/Test/baseResults/spv.for-simple.vert.out @@ -1,55 +1,55 @@ -spv.for-simple.vert - -Linked vertex stage: - - -// Module Version 10000 -// Generated by (magic number): 80001 -// Id's are bound by 26 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 24 25 - Source ESSL 300 - Name 4 "main" - Name 8 "i" - Name 18 "j" - Name 24 "gl_VertexID" - Name 25 "gl_InstanceID" - Decorate 24(gl_VertexID) BuiltIn VertexId - Decorate 25(gl_InstanceID) BuiltIn InstanceId - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 1 - 7: TypePointer Function 6(int) - 9: 6(int) Constant 0 - 15: 6(int) Constant 10 - 16: TypeBool - 19: 6(int) Constant 12 - 21: 6(int) Constant 1 - 23: TypePointer Input 6(int) - 24(gl_VertexID): 23(ptr) Variable Input -25(gl_InstanceID): 23(ptr) Variable Input - 4(main): 2 Function None 3 - 5: Label - 8(i): 7(ptr) Variable Function - 18(j): 7(ptr) Variable Function - Store 8(i) 9 - Branch 13 - 10: Label - Store 18(j) 19 - Branch 12 - 11: Label - Return - 12: Label - 20: 6(int) Load 8(i) - 22: 6(int) IAdd 20 21 - Store 8(i) 22 - Branch 13 - 13: Label - 14: 6(int) Load 8(i) - 17: 16(bool) SLessThan 14 15 - LoopMerge 11 12 None - BranchConditional 17 10 11 - FunctionEnd +spv.for-simple.vert + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 26 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 24 25 + Source ESSL 300 + Name 4 "main" + Name 8 "i" + Name 18 "j" + Name 24 "gl_VertexID" + Name 25 "gl_InstanceID" + Decorate 24(gl_VertexID) BuiltIn VertexId + Decorate 25(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 0 + 15: 6(int) Constant 10 + 16: TypeBool + 19: 6(int) Constant 12 + 21: 6(int) Constant 1 + 23: TypePointer Input 6(int) + 24(gl_VertexID): 23(ptr) Variable Input +25(gl_InstanceID): 23(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 8(i): 7(ptr) Variable Function + 18(j): 7(ptr) Variable Function + Store 8(i) 9 + Branch 10 + 10: Label + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 12 13 None + BranchConditional 17 11 12 + 11: Label + Store 18(j) 19 + Branch 13 + 12: Label + Return + 13: Label + 20: 6(int) Load 8(i) + 22: 6(int) IAdd 20 21 + Store 8(i) 22 + Branch 10 + FunctionEnd diff --git a/Test/baseResults/spv.forLoop.frag.out b/Test/baseResults/spv.forLoop.frag.out index 3e4cb28a..bba5fe0c 100755 --- a/Test/baseResults/spv.forLoop.frag.out +++ b/Test/baseResults/spv.forLoop.frag.out @@ -75,31 +75,36 @@ Linked fragment stage: 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 Store 15(i) 16 - Branch 20 + Branch 17 17: Label - 29: 7(fvec4) Load 28(bigColor) - 30: 7(fvec4) Load 9(color) - 31: 7(fvec4) FAdd 30 29 - Store 9(color) 31 - Branch 19 - 18: Label + 21: 13(int) Load 15(i) + 24: 13(int) Load 23(Count) + 26: 25(bool) SLessThan 21 24 + LoopMerge 19 20 None + BranchConditional 26 18 19 + 18: Label + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 20 + 19: Label 37: 7(fvec4) Load 9(color) Store 36(gl_FragColor) 37 Store 39(sum) 40 Store 41(i) 16 - Branch 45 - 19: Label + Branch 42 + 20: Label 32: 13(int) Load 15(i) 34: 13(int) IAdd 32 33 Store 15(i) 34 - Branch 20 - 20: Label - 21: 13(int) Load 15(i) - 24: 13(int) Load 23(Count) - 26: 25(bool) SLessThan 21 24 - LoopMerge 18 19 None - BranchConditional 26 17 18 - 42: Label + Branch 17 + 42: Label + 46: 13(int) Load 41(i) + 48: 25(bool) SLessThan 46 47 + LoopMerge 44 45 None + BranchConditional 48 43 44 + 43: Label 53: 13(int) Load 41(i) 55: 54(ptr) AccessChain 52(v4) 53 56: 49(int) Load 55 @@ -107,98 +112,93 @@ Linked fragment stage: 58: 6(float) Load 39(sum) 59: 6(float) FAdd 58 57 Store 39(sum) 59 - Branch 44 - 43: Label - Store 62(i) 16 - Branch 66 - 44: Label - 60: 13(int) Load 41(i) - 61: 13(int) IAdd 60 33 - Store 41(i) 61 Branch 45 - 45: Label - 46: 13(int) Load 41(i) - 48: 25(bool) SLessThan 46 47 - LoopMerge 43 44 None - BranchConditional 48 42 43 - 63: Label - 70: 13(int) Load 62(i) - 71: 13(int) Load 62(i) - 72: 54(ptr) AccessChain 52(v4) 71 - 73: 49(int) Load 72 - 75: 49(int) IMul 73 74 - 76: 6(float) ConvertUToF 75 - 77: 38(ptr) AccessChain 69(tv4) 70 - Store 77 76 - Branch 65 - 64: Label - 80: 6(float) Load 39(sum) - 81: 7(fvec4) CompositeConstruct 80 80 80 80 - 82: 7(fvec4) Load 69(tv4) - 83: 7(fvec4) FAdd 81 82 - 84: 7(fvec4) Load 36(gl_FragColor) - 85: 7(fvec4) FAdd 84 83 - Store 36(gl_FragColor) 85 - 88: 7(fvec4) Load 11(BaseColor) - 89: 87(fvec3) VectorShuffle 88 88 0 1 2 - 90: 7(fvec4) Load 86(r) - 91: 7(fvec4) VectorShuffle 90 89 4 5 6 3 - Store 86(r) 91 - Store 92(i) 16 - Branch 96 - 65: Label - 78: 13(int) Load 62(i) - 79: 13(int) IAdd 78 33 - Store 62(i) 79 - Branch 66 - 66: Label - 67: 13(int) Load 62(i) - 68: 25(bool) SLessThan 67 47 - LoopMerge 64 65 None - BranchConditional 68 63 64 - 93: Label - 102: 6(float) Load 101(f) - 104: 38(ptr) AccessChain 86(r) 103 - Store 104 102 - Branch 95 - 94: Label - 107: 7(fvec4) Load 86(r) - 108: 87(fvec3) VectorShuffle 107 107 0 1 2 - 109: 7(fvec4) Load 36(gl_FragColor) - 110: 87(fvec3) VectorShuffle 109 109 0 1 2 - 111: 87(fvec3) FAdd 110 108 - 112: 7(fvec4) Load 36(gl_FragColor) - 113: 7(fvec4) VectorShuffle 112 111 4 5 6 3 - Store 36(gl_FragColor) 113 - Store 114(i) 16 - Branch 118 - 95: Label - 105: 13(int) Load 92(i) - 106: 13(int) IAdd 105 33 - Store 92(i) 106 - Branch 96 - 96: Label - 97: 13(int) Load 92(i) - 98: 13(int) Load 23(Count) - 99: 25(bool) SLessThan 97 98 - LoopMerge 94 95 None - BranchConditional 99 93 94 - 115: Label - 122: 6(float) Load 101(f) - 123: 7(fvec4) Load 36(gl_FragColor) - 124: 7(fvec4) VectorTimesScalar 123 122 - Store 36(gl_FragColor) 124 - Branch 117 - 116: Label - Return - 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 + 44: Label + Store 62(i) 16 + Branch 63 + 45: Label + 60: 13(int) Load 41(i) + 61: 13(int) IAdd 60 33 + Store 41(i) 61 + Branch 42 + 63: Label + 67: 13(int) Load 62(i) + 68: 25(bool) SLessThan 67 47 + LoopMerge 65 66 None + BranchConditional 68 64 65 + 64: Label + 70: 13(int) Load 62(i) + 71: 13(int) Load 62(i) + 72: 54(ptr) AccessChain 52(v4) 71 + 73: 49(int) Load 72 + 75: 49(int) IMul 73 74 + 76: 6(float) ConvertUToF 75 + 77: 38(ptr) AccessChain 69(tv4) 70 + Store 77 76 + Branch 66 + 65: Label + 80: 6(float) Load 39(sum) + 81: 7(fvec4) CompositeConstruct 80 80 80 80 + 82: 7(fvec4) Load 69(tv4) + 83: 7(fvec4) FAdd 81 82 + 84: 7(fvec4) Load 36(gl_FragColor) + 85: 7(fvec4) FAdd 84 83 + Store 36(gl_FragColor) 85 + 88: 7(fvec4) Load 11(BaseColor) + 89: 87(fvec3) VectorShuffle 88 88 0 1 2 + 90: 7(fvec4) Load 86(r) + 91: 7(fvec4) VectorShuffle 90 89 4 5 6 3 + Store 86(r) 91 + Store 92(i) 16 + Branch 93 + 66: Label + 78: 13(int) Load 62(i) + 79: 13(int) IAdd 78 33 + Store 62(i) 79 + Branch 63 + 93: Label + 97: 13(int) Load 92(i) + 98: 13(int) Load 23(Count) + 99: 25(bool) SLessThan 97 98 + LoopMerge 95 96 None + BranchConditional 99 94 95 + 94: Label + 102: 6(float) Load 101(f) + 104: 38(ptr) AccessChain 86(r) 103 + Store 104 102 + Branch 96 + 95: Label + 107: 7(fvec4) Load 86(r) + 108: 87(fvec3) VectorShuffle 107 107 0 1 2 + 109: 7(fvec4) Load 36(gl_FragColor) + 110: 87(fvec3) VectorShuffle 109 109 0 1 2 + 111: 87(fvec3) FAdd 110 108 + 112: 7(fvec4) Load 36(gl_FragColor) + 113: 7(fvec4) VectorShuffle 112 111 4 5 6 3 + Store 36(gl_FragColor) 113 + Store 114(i) 16 + Branch 115 + 96: Label + 105: 13(int) Load 92(i) + 106: 13(int) IAdd 105 33 + Store 92(i) 106 + Branch 93 + 115: Label + 119: 13(int) Load 114(i) + 121: 25(bool) SLessThan 119 120 + LoopMerge 117 118 None + BranchConditional 121 116 117 + 116: Label + 122: 6(float) Load 101(f) + 123: 7(fvec4) Load 36(gl_FragColor) + 124: 7(fvec4) VectorTimesScalar 123 122 + Store 36(gl_FragColor) 124 + Branch 118 + 117: Label + Return + 118: Label + 125: 13(int) Load 114(i) + 126: 13(int) IAdd 125 47 + Store 114(i) 126 + Branch 115 + FunctionEnd diff --git a/Test/baseResults/spv.localAggregates.frag.out b/Test/baseResults/spv.localAggregates.frag.out index 1f9cbce6..5e71aa2e 100755 --- a/Test/baseResults/spv.localAggregates.frag.out +++ b/Test/baseResults/spv.localAggregates.frag.out @@ -159,59 +159,59 @@ Linked fragment stage: 74: 30(ptr) AccessChain 70(localArray) 71 Store 74 73 Store 75(i) 16 - Branch 79 + Branch 76 76: Label - 84: 6(int) Load 75(i) - 86: 30(ptr) AccessChain 83(a) 84 - Store 86 85 - Branch 78 - 77: Label + 80: 6(int) Load 75(i) + 82: 23(bool) SLessThan 80 81 + LoopMerge 78 79 None + BranchConditional 82 77 78 + 77: Label + 84: 6(int) Load 75(i) + 86: 30(ptr) AccessChain 83(a) 84 + Store 86 85 + Branch 79 + 78: Label 90: 6(int) Load 89(condition) 91: 23(bool) IEqual 90 28 SelectionMerge 93 None BranchConditional 91 92 93 - 78: Label + 79: Label 87: 6(int) Load 75(i) 88: 6(int) IAdd 87 28 Store 75(i) 88 - Branch 79 - 79: Label - 80: 6(int) Load 75(i) - 82: 23(bool) SLessThan 80 81 - LoopMerge 77 78 None - BranchConditional 82 76 77 - 92: Label - 94: 34 Load 70(localArray) - Store 83(a) 94 - Branch 93 - 93: Label - 98: 9(fvec4) Load 97(color) - 100: 99(ptr) AccessChain 12(locals2) 95 - Store 100 98 - 102: 42(ptr) AccessChain 40(coord) 101 - 103: 7(float) Load 102 - 105: 30(ptr) AccessChain 12(locals2) 95 104 - Store 105 103 - 108: 99(ptr) AccessChain 12(locals2) 95 - 109: 9(fvec4) Load 108 - 110: 30(ptr) AccessChain 36(localFArray) 37 - 111: 7(float) Load 110 - 112: 30(ptr) AccessChain 12(locals2) 27 28 - 113: 7(float) Load 112 - 114: 7(float) FAdd 111 113 - 115: 6(int) Load 68(x) - 116: 30(ptr) AccessChain 70(localArray) 115 - 117: 7(float) Load 116 - 118: 7(float) FAdd 114 117 - 119: 6(int) Load 68(x) - 120: 30(ptr) AccessChain 83(a) 119 - 121: 7(float) Load 120 - 122: 7(float) FAdd 118 121 - 123: 9(fvec4) VectorTimesScalar 109 122 - 128: 125 Load 127(samp2D) - 129: 38(fvec2) Load 40(coord) - 130: 9(fvec4) ImageSampleImplicitLod 128 129 - 131: 9(fvec4) FMul 123 130 - Store 107(gl_FragColor) 131 - Return - FunctionEnd + Branch 76 + 92: Label + 94: 34 Load 70(localArray) + Store 83(a) 94 + Branch 93 + 93: Label + 98: 9(fvec4) Load 97(color) + 100: 99(ptr) AccessChain 12(locals2) 95 + Store 100 98 + 102: 42(ptr) AccessChain 40(coord) 101 + 103: 7(float) Load 102 + 105: 30(ptr) AccessChain 12(locals2) 95 104 + Store 105 103 + 108: 99(ptr) AccessChain 12(locals2) 95 + 109: 9(fvec4) Load 108 + 110: 30(ptr) AccessChain 36(localFArray) 37 + 111: 7(float) Load 110 + 112: 30(ptr) AccessChain 12(locals2) 27 28 + 113: 7(float) Load 112 + 114: 7(float) FAdd 111 113 + 115: 6(int) Load 68(x) + 116: 30(ptr) AccessChain 70(localArray) 115 + 117: 7(float) Load 116 + 118: 7(float) FAdd 114 117 + 119: 6(int) Load 68(x) + 120: 30(ptr) AccessChain 83(a) 119 + 121: 7(float) Load 120 + 122: 7(float) FAdd 118 121 + 123: 9(fvec4) VectorTimesScalar 109 122 + 128: 125 Load 127(samp2D) + 129: 38(fvec2) Load 40(coord) + 130: 9(fvec4) ImageSampleImplicitLod 128 129 + 131: 9(fvec4) FMul 123 130 + Store 107(gl_FragColor) 131 + Return + FunctionEnd diff --git a/Test/baseResults/spv.loops.frag.out b/Test/baseResults/spv.loops.frag.out index d6ec0a99..5a8a7c2f 100755 --- a/Test/baseResults/spv.loops.frag.out +++ b/Test/baseResults/spv.loops.frag.out @@ -7,7 +7,7 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 714 +// Id's are bound by 720 Capability Shader 1: ExtInstImport "GLSL.std.450" @@ -29,48 +29,48 @@ Linked fragment stage: Name 143 "i" Name 151 "Count" Name 154 "bigColor2" - Name 164 "bigColor3" - Name 172 "i" - Name 187 "i" - Name 222 "i" - Name 244 "i" - Name 268 "i" - Name 295 "bigColor4" - Name 330 "bigColor5" - Name 336 "d5" - Name 352 "d6" - Name 365 "bigColor6" - Name 401 "d7" - Name 431 "bigColor7" - Name 449 "d8" - Name 491 "d9" - Name 522 "d10" - Name 530 "d11" - Name 540 "d12" - Name 565 "bigColor8" - Name 592 "gl_FragColor" - Name 600 "d14" - Name 605 "d15" - Name 624 "d16" - Name 660 "d18" - Name 671 "d17" - Name 697 "d13" - Name 698 "d19" - Name 699 "d20" - Name 700 "d21" - Name 701 "d22" - Name 702 "d23" - Name 703 "d24" - Name 704 "d25" - Name 705 "d26" - Name 706 "d27" - Name 707 "d28" - Name 708 "d29" - Name 709 "d30" - Name 710 "d31" - Name 711 "d32" - Name 712 "d33" - Name 713 "d34" + Name 165 "bigColor3" + Name 173 "i" + Name 188 "i" + Name 223 "i" + Name 245 "i" + Name 269 "i" + Name 297 "bigColor4" + Name 333 "bigColor5" + Name 339 "d5" + Name 355 "d6" + Name 368 "bigColor6" + Name 404 "d7" + Name 435 "bigColor7" + Name 454 "d8" + Name 496 "d9" + Name 527 "d10" + Name 535 "d11" + Name 545 "d12" + Name 570 "bigColor8" + Name 597 "gl_FragColor" + Name 605 "d14" + Name 610 "d15" + Name 629 "d16" + Name 666 "d18" + Name 677 "d17" + Name 703 "d13" + Name 704 "d19" + Name 705 "d20" + Name 706 "d21" + Name 707 "d22" + Name 708 "d23" + Name 709 "d24" + Name 710 "d25" + Name 711 "d26" + Name 712 "d27" + Name 713 "d28" + Name 714 "d29" + Name 715 "d30" + Name 716 "d31" + Name 717 "d32" + Name 718 "d33" + Name 719 "d34" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -109,978 +109,990 @@ Linked fragment stage: 151(Count): 150(ptr) Variable UniformConstant 154(bigColor2): 55(ptr) Variable UniformConstant 159: 141(int) Constant 1 - 164(bigColor3): 55(ptr) Variable UniformConstant - 178: 141(int) Constant 42 - 193: 141(int) Constant 100 - 197: 6(float) Constant 1101004800 - 228: 141(int) Constant 120 - 295(bigColor4): 55(ptr) Variable UniformConstant - 330(bigColor5): 55(ptr) Variable UniformConstant - 336(d5): 51(ptr) Variable UniformConstant - 352(d6): 51(ptr) Variable UniformConstant - 365(bigColor6): 55(ptr) Variable UniformConstant - 401(d7): 51(ptr) Variable UniformConstant - 426: 6(float) Constant 0 - 431(bigColor7): 55(ptr) Variable UniformConstant - 449(d8): 51(ptr) Variable UniformConstant - 466: 6(float) Constant 1073741824 - 491(d9): 51(ptr) Variable UniformConstant - 507: 6(float) Constant 1084227584 - 522(d10): 51(ptr) Variable UniformConstant - 530(d11): 51(ptr) Variable UniformConstant - 540(d12): 51(ptr) Variable UniformConstant - 563: 6(float) Constant 1092616192 - 565(bigColor8): 55(ptr) Variable UniformConstant - 591: TypePointer Output 7(fvec4) -592(gl_FragColor): 591(ptr) Variable Output - 600(d14): 51(ptr) Variable UniformConstant - 605(d15): 51(ptr) Variable UniformConstant - 624(d16): 51(ptr) Variable UniformConstant - 660(d18): 51(ptr) Variable UniformConstant - 671(d17): 51(ptr) Variable UniformConstant - 697(d13): 51(ptr) Variable UniformConstant - 698(d19): 51(ptr) Variable UniformConstant - 699(d20): 51(ptr) Variable UniformConstant - 700(d21): 51(ptr) Variable UniformConstant - 701(d22): 51(ptr) Variable UniformConstant - 702(d23): 51(ptr) Variable UniformConstant - 703(d24): 51(ptr) Variable UniformConstant - 704(d25): 51(ptr) Variable UniformConstant - 705(d26): 51(ptr) Variable UniformConstant - 706(d27): 51(ptr) Variable UniformConstant - 707(d28): 51(ptr) Variable UniformConstant - 708(d29): 51(ptr) Variable UniformConstant - 709(d30): 51(ptr) Variable UniformConstant - 710(d31): 51(ptr) Variable UniformConstant - 711(d32): 51(ptr) Variable UniformConstant - 712(d33): 51(ptr) Variable UniformConstant - 713(d34): 51(ptr) Variable UniformConstant + 165(bigColor3): 55(ptr) Variable UniformConstant + 179: 141(int) Constant 42 + 194: 141(int) Constant 100 + 198: 6(float) Constant 1101004800 + 229: 141(int) Constant 120 + 297(bigColor4): 55(ptr) Variable UniformConstant + 333(bigColor5): 55(ptr) Variable UniformConstant + 339(d5): 51(ptr) Variable UniformConstant + 355(d6): 51(ptr) Variable UniformConstant + 368(bigColor6): 55(ptr) Variable UniformConstant + 404(d7): 51(ptr) Variable UniformConstant + 430: 6(float) Constant 0 + 435(bigColor7): 55(ptr) Variable UniformConstant + 454(d8): 51(ptr) Variable UniformConstant + 471: 6(float) Constant 1073741824 + 496(d9): 51(ptr) Variable UniformConstant + 512: 6(float) Constant 1084227584 + 527(d10): 51(ptr) Variable UniformConstant + 535(d11): 51(ptr) Variable UniformConstant + 545(d12): 51(ptr) Variable UniformConstant + 568: 6(float) Constant 1092616192 + 570(bigColor8): 55(ptr) Variable UniformConstant + 596: TypePointer Output 7(fvec4) +597(gl_FragColor): 596(ptr) Variable Output + 605(d14): 51(ptr) Variable UniformConstant + 610(d15): 51(ptr) Variable UniformConstant + 629(d16): 51(ptr) Variable UniformConstant + 666(d18): 51(ptr) Variable UniformConstant + 677(d17): 51(ptr) Variable UniformConstant + 703(d13): 51(ptr) Variable UniformConstant + 704(d19): 51(ptr) Variable UniformConstant + 705(d20): 51(ptr) Variable UniformConstant + 706(d21): 51(ptr) Variable UniformConstant + 707(d22): 51(ptr) Variable UniformConstant + 708(d23): 51(ptr) Variable UniformConstant + 709(d24): 51(ptr) Variable UniformConstant + 710(d25): 51(ptr) Variable UniformConstant + 711(d26): 51(ptr) Variable UniformConstant + 712(d27): 51(ptr) Variable UniformConstant + 713(d28): 51(ptr) Variable UniformConstant + 714(d29): 51(ptr) Variable UniformConstant + 715(d30): 51(ptr) Variable UniformConstant + 716(d31): 51(ptr) Variable UniformConstant + 717(d32): 51(ptr) Variable UniformConstant + 718(d33): 51(ptr) Variable UniformConstant + 719(d34): 51(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function 143(i): 142(ptr) Variable Function - 172(i): 142(ptr) Variable Function - 187(i): 142(ptr) Variable Function - 222(i): 142(ptr) Variable Function - 244(i): 142(ptr) Variable Function - 268(i): 142(ptr) Variable Function + 173(i): 142(ptr) Variable Function + 188(i): 142(ptr) Variable Function + 223(i): 142(ptr) Variable Function + 245(i): 142(ptr) Variable Function + 269(i): 142(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 - Branch 16 + Branch 13 13: Label - 22: 21(ptr) AccessChain 9(color) 20 - 23: 6(float) Load 22 - 25: 17(bool) FOrdLessThan 23 24 - SelectionMerge 27 None - BranchConditional 25 26 27 + LoopMerge 15 16 None + BranchConditional 18 14 15 14: Label - Branch 48 - 15: Label - Branch 16 - 16: Label - LoopMerge 14 15 None - BranchConditional 18 13 14 + 22: 21(ptr) AccessChain 9(color) 20 + 23: 6(float) Load 22 + 25: 17(bool) FOrdLessThan 23 24 + SelectionMerge 27 None + BranchConditional 25 26 27 + 15: Label + Branch 45 + 16: Label + Branch 13 26: Label 29: 7(fvec4) Load 9(color) 30: 7(fvec4) FAdd 29 28 Store 9(color) 30 - Branch 14 - 27: Label - 32: 21(ptr) AccessChain 9(color) 20 - 33: 6(float) Load 32 - 35: 17(bool) FOrdLessThan 33 34 - SelectionMerge 37 None - BranchConditional 35 36 37 - 36: Label - 39: 7(fvec4) Load 9(color) - 40: 7(fvec4) FAdd 39 38 - Store 9(color) 40 - Branch 14 - 37: Label - 42: 7(fvec4) Load 9(color) - 43: 7(fvec4) FAdd 42 28 - Store 9(color) 43 - Branch 14 - 45: Label + Branch 15 + 27: Label + 32: 21(ptr) AccessChain 9(color) 20 + 33: 6(float) Load 32 + 35: 17(bool) FOrdLessThan 33 34 + SelectionMerge 37 None + BranchConditional 35 36 37 + 36: Label + 39: 7(fvec4) Load 9(color) + 40: 7(fvec4) FAdd 39 38 + Store 9(color) 40 + Branch 15 + 37: Label + 42: 7(fvec4) Load 9(color) + 43: 7(fvec4) FAdd 42 28 + Store 9(color) 43 + Branch 15 + 45: Label + 49: 21(ptr) AccessChain 9(color) 20 + 50: 6(float) Load 49 + 53: 6(float) Load 52(d) + 54: 17(bool) FOrdLessThan 50 53 + LoopMerge 47 48 None + BranchConditional 54 46 47 + 46: Label 57: 7(fvec4) Load 56(bigColor) 58: 7(fvec4) Load 9(color) 59: 7(fvec4) FAdd 58 57 Store 9(color) 59 - Branch 47 - 46: Label - Branch 63 - 47: Label Branch 48 - 48: Label - 49: 21(ptr) AccessChain 9(color) 20 - 50: 6(float) Load 49 - 53: 6(float) Load 52(d) - 54: 17(bool) FOrdLessThan 50 53 - LoopMerge 46 47 None - BranchConditional 54 45 46 - 60: Label - 70: 7(fvec4) Load 69(bigColor1_1) - 71: 7(fvec4) Load 9(color) - 72: 7(fvec4) FAdd 71 70 - Store 9(color) 72 - 74: 21(ptr) AccessChain 9(color) 73 - 75: 6(float) Load 74 - 76: 6(float) Load 52(d) - 77: 17(bool) FOrdLessThan 75 76 - SelectionMerge 79 None - BranchConditional 77 78 79 - 61: Label - Branch 87 - 62: Label - Branch 63 - 63: Label - 65: 21(ptr) AccessChain 9(color) 64 - 66: 6(float) Load 65 - 67: 6(float) Load 52(d) - 68: 17(bool) FOrdLessThan 66 67 - LoopMerge 61 62 None - BranchConditional 68 60 61 - 78: Label - Branch 62 - 79: Label - 81: 7(fvec4) Load 69(bigColor1_1) - 82: 7(fvec4) Load 9(color) - 83: 7(fvec4) FAdd 82 81 - Store 9(color) 83 - Branch 62 - 84: Label - 92: 7(fvec4) Load 9(color) - 94: 7(fvec4) CompositeConstruct 93 93 93 93 - 95: 7(fvec4) FAdd 92 94 - Store 9(color) 95 - Branch 86 - 85: Label - Branch 99 - 86: Label - Branch 87 - 87: Label - 88: 21(ptr) AccessChain 9(color) 20 - 89: 6(float) Load 88 - 91: 17(bool) FOrdLessThan 89 90 - LoopMerge 85 86 None - BranchConditional 91 84 85 - 96: Label - 115: 7(fvec4) Load 114(bigColor1_2) - 116: 7(fvec4) Load 9(color) - 117: 7(fvec4) FAdd 116 115 - Store 9(color) 117 - Branch 98 - 97: Label - Branch 121 - 98: Label - Branch 99 - 99: Label - 100: 21(ptr) AccessChain 9(color) 73 - 101: 6(float) Load 100 - 103: 6(float) Load 102(d2) - 104: 17(bool) FOrdLessThan 101 103 - SelectionMerge 106 None - BranchConditional 104 105 106 - 105: Label - 108: 21(ptr) AccessChain 9(color) 107 - 109: 6(float) Load 108 - 111: 6(float) Load 110(d3) - 112: 17(bool) FOrdLessThan 109 111 - Branch 106 - 106: Label - 113: 17(bool) Phi 104 99 112 105 - LoopMerge 97 98 None - BranchConditional 113 96 97 - 118: Label - 127: 7(fvec4) Load 126(bigColor1_3) - 128: 7(fvec4) Load 9(color) - 129: 7(fvec4) FAdd 128 127 - Store 9(color) 129 - 130: 21(ptr) AccessChain 9(color) 107 - 131: 6(float) Load 130 - 133: 6(float) Load 132(d4) - 134: 17(bool) FOrdLessThan 131 133 - SelectionMerge 136 None - BranchConditional 134 135 136 - 119: Label - Store 143(i) 144 - Branch 148 - 120: Label - Branch 121 - 121: Label - 122: 21(ptr) AccessChain 9(color) 64 - 123: 6(float) Load 122 - 124: 6(float) Load 110(d3) - 125: 17(bool) FOrdLessThan 123 124 - LoopMerge 119 120 None - BranchConditional 125 118 119 - 135: Label - Branch 119 - 136: Label - 138: 7(fvec4) Load 126(bigColor1_3) - 139: 7(fvec4) Load 9(color) - 140: 7(fvec4) FAdd 139 138 - Store 9(color) 140 - Branch 120 - 145: Label - 155: 7(fvec4) Load 154(bigColor2) - 156: 7(fvec4) Load 9(color) - 157: 7(fvec4) FAdd 156 155 - Store 9(color) 157 - Branch 147 - 146: Label - Branch 161 - 147: Label - 158: 141(int) Load 143(i) - 160: 141(int) IAdd 158 159 - Store 143(i) 160 - Branch 148 - 148: Label - 149: 141(int) Load 143(i) - 152: 141(int) Load 151(Count) - 153: 17(bool) SLessThan 149 152 - LoopMerge 146 147 None - BranchConditional 153 145 146 - 161: Label - 165: 7(fvec4) Load 164(bigColor3) - 166: 7(fvec4) Load 9(color) - 167: 7(fvec4) FAdd 166 165 - Store 9(color) 167 - Branch 163 - 162: Label - Store 172(i) 144 - Branch 176 - 163: Label - 168: 21(ptr) AccessChain 9(color) 20 - 169: 6(float) Load 168 - 170: 6(float) Load 102(d2) - 171: 17(bool) FOrdLessThan 169 170 - LoopMerge 162 163 None - BranchConditional 171 161 162 - 173: Label - 180: 6(float) Load 110(d3) - 181: 21(ptr) AccessChain 9(color) 64 - 182: 6(float) Load 181 - 183: 6(float) FAdd 182 180 - 184: 21(ptr) AccessChain 9(color) 64 - Store 184 183 - Branch 175 - 174: Label - Store 187(i) 144 - Branch 191 - 175: Label - 185: 141(int) Load 172(i) - 186: 141(int) IAdd 185 159 - Store 172(i) 186 - Branch 176 - 176: Label - 177: 141(int) Load 172(i) - 179: 17(bool) SLessThan 177 178 - LoopMerge 174 175 None - BranchConditional 179 173 174 - 188: Label - 195: 21(ptr) AccessChain 9(color) 64 - 196: 6(float) Load 195 - 198: 17(bool) FOrdLessThan 196 197 - SelectionMerge 200 None - BranchConditional 198 199 204 - 189: Label - Store 222(i) 144 - Branch 226 - 190: Label - 220: 141(int) Load 187(i) - 221: 141(int) IAdd 220 159 - Store 187(i) 221 - Branch 191 - 191: Label - 192: 141(int) Load 187(i) - 194: 17(bool) SLessThan 192 193 - LoopMerge 189 190 None - BranchConditional 194 188 189 - 199: Label - 201: 21(ptr) AccessChain 9(color) 20 - 202: 6(float) Load 201 - 203: 6(float) FAdd 202 93 - Store 201 203 - Branch 200 - 204: Label - 205: 21(ptr) AccessChain 9(color) 107 - 206: 6(float) Load 205 - 207: 6(float) FAdd 206 93 - Store 205 207 - Branch 200 - 200: Label - 208: 21(ptr) AccessChain 9(color) 73 - 209: 6(float) Load 208 - 210: 17(bool) FOrdLessThan 209 197 - SelectionMerge 212 None - BranchConditional 210 211 212 - 211: Label - 213: 21(ptr) AccessChain 9(color) 64 - 214: 6(float) Load 213 - 215: 21(ptr) AccessChain 9(color) 107 - 216: 6(float) Load 215 - 217: 17(bool) FOrdGreaterThan 214 216 - SelectionMerge 219 None - BranchConditional 217 218 219 - 218: Label - Branch 219 - 219: Label - Branch 212 - 212: Label - Branch 190 - 223: Label - 230: 21(ptr) AccessChain 9(color) 64 - 231: 6(float) Load 230 - 232: 17(bool) FOrdLessThan 231 197 - SelectionMerge 234 None - BranchConditional 232 233 238 - 224: Label - Store 244(i) 144 - Branch 248 - 225: Label - 242: 141(int) Load 222(i) - 243: 141(int) IAdd 242 159 - Store 222(i) 243 - Branch 226 - 226: Label - 227: 141(int) Load 222(i) - 229: 17(bool) SLessThan 227 228 - LoopMerge 224 225 None - BranchConditional 229 223 224 - 233: Label - 235: 21(ptr) AccessChain 9(color) 20 - 236: 6(float) Load 235 - 237: 6(float) FAdd 236 93 - Store 235 237 - Branch 234 - 238: Label - 239: 21(ptr) AccessChain 9(color) 107 - 240: 6(float) Load 239 - 241: 6(float) FAdd 240 93 - Store 239 241 - Branch 234 - 234: Label - Branch 225 - 245: Label - 251: 6(float) Load 110(d3) - 252: 21(ptr) AccessChain 9(color) 64 - 253: 6(float) Load 252 - 254: 6(float) FAdd 253 251 - 255: 21(ptr) AccessChain 9(color) 64 - Store 255 254 - 256: 21(ptr) AccessChain 9(color) 20 - 257: 6(float) Load 256 - 258: 6(float) Load 132(d4) - 259: 17(bool) FOrdLessThan 257 258 - SelectionMerge 261 None - BranchConditional 259 260 261 - 246: Label - Store 268(i) 144 - Branch 272 - 247: Label - 266: 141(int) Load 244(i) - 267: 141(int) IAdd 266 159 - Store 244(i) 267 - Branch 248 - 248: Label - 249: 141(int) Load 244(i) - 250: 17(bool) SLessThan 249 178 - LoopMerge 246 247 None - BranchConditional 250 245 246 - 260: Label - Branch 247 - 261: Label - 263: 21(ptr) AccessChain 9(color) 73 - 264: 6(float) Load 263 - 265: 6(float) FAdd 264 93 - Store 263 265 - Branch 247 - 269: Label - 275: 6(float) Load 110(d3) - 276: 21(ptr) AccessChain 9(color) 64 - 277: 6(float) Load 276 - 278: 6(float) FAdd 277 275 - 279: 21(ptr) AccessChain 9(color) 64 - Store 279 278 - 280: 21(ptr) AccessChain 9(color) 20 - 281: 6(float) Load 280 - 282: 6(float) Load 132(d4) - 283: 17(bool) FOrdLessThan 281 282 - SelectionMerge 285 None - BranchConditional 283 284 285 - 270: Label - Branch 292 - 271: Label - 290: 141(int) Load 268(i) - 291: 141(int) IAdd 290 159 - Store 268(i) 291 - Branch 272 - 272: Label - 273: 141(int) Load 268(i) - 274: 17(bool) SLessThan 273 178 - LoopMerge 270 271 None - BranchConditional 274 269 270 - 284: Label - Branch 270 - 285: Label - 287: 21(ptr) AccessChain 9(color) 73 - 288: 6(float) Load 287 - 289: 6(float) FAdd 288 93 - Store 287 289 - Branch 271 - 292: Label - 296: 7(fvec4) Load 295(bigColor4) - 297: 7(fvec4) Load 9(color) - 298: 7(fvec4) FAdd 297 296 - Store 9(color) 298 - 299: 21(ptr) AccessChain 9(color) 20 - 300: 6(float) Load 299 - 301: 6(float) Load 132(d4) - 302: 17(bool) FOrdLessThan 300 301 - SelectionMerge 304 None - BranchConditional 302 303 304 - 293: Label - Branch 327 - 294: Label - 323: 21(ptr) AccessChain 9(color) 64 - 324: 6(float) Load 323 - 325: 6(float) Load 132(d4) - 326: 17(bool) FOrdLessThan 324 325 - LoopMerge 293 294 None - BranchConditional 326 292 293 - 303: Label - Branch 294 - 304: Label - 306: 21(ptr) AccessChain 9(color) 107 - 307: 6(float) Load 306 - 308: 6(float) Load 132(d4) - 309: 17(bool) FOrdLessThan 307 308 - SelectionMerge 311 None - BranchConditional 309 310 317 - 310: Label - 312: 6(float) Load 132(d4) - 313: 21(ptr) AccessChain 9(color) 107 - 314: 6(float) Load 313 - 315: 6(float) FAdd 314 312 - 316: 21(ptr) AccessChain 9(color) 107 - Store 316 315 - Branch 311 - 317: Label - 318: 6(float) Load 132(d4) - 319: 21(ptr) AccessChain 9(color) 20 - 320: 6(float) Load 319 - 321: 6(float) FAdd 320 318 - 322: 21(ptr) AccessChain 9(color) 20 - Store 322 321 - Branch 311 - 311: Label - Branch 294 - 327: Label - 331: 7(fvec4) Load 330(bigColor5) - 332: 7(fvec4) Load 9(color) - 333: 7(fvec4) FAdd 332 331 - Store 9(color) 333 - 334: 21(ptr) AccessChain 9(color) 107 - 335: 6(float) Load 334 - 337: 6(float) Load 336(d5) - 338: 17(bool) FOrdLessThan 335 337 - SelectionMerge 340 None - BranchConditional 338 339 340 - 328: Label - 350: 21(ptr) AccessChain 9(color) 20 - 351: 6(float) Load 350 - 353: 6(float) Load 352(d6) - 354: 17(bool) FOrdLessThan 351 353 - SelectionMerge 356 None - BranchConditional 354 355 369 - 329: Label - 346: 21(ptr) AccessChain 9(color) 20 - 347: 6(float) Load 346 - 348: 6(float) Load 336(d5) - 349: 17(bool) FOrdLessThan 347 348 - LoopMerge 328 329 None - BranchConditional 349 327 328 - 339: Label - 341: 6(float) Load 336(d5) - 342: 21(ptr) AccessChain 9(color) 107 - 343: 6(float) Load 342 - 344: 6(float) FAdd 343 341 - 345: 21(ptr) AccessChain 9(color) 107 - Store 345 344 - Branch 340 - 340: Label - Branch 329 - 355: Label - Branch 360 - 357: Label - 366: 7(fvec4) Load 365(bigColor6) - 367: 7(fvec4) Load 9(color) - 368: 7(fvec4) FAdd 367 366 - Store 9(color) 368 - Branch 359 - 358: Label - Branch 356 - 359: Label - Branch 360 - 360: Label - 361: 21(ptr) AccessChain 9(color) 107 - 362: 6(float) Load 361 - 363: 6(float) Load 352(d6) - 364: 17(bool) FOrdLessThan 362 363 - LoopMerge 358 359 None - BranchConditional 364 357 358 - 369: Label - Branch 373 - 370: Label - 378: 51(ptr) AccessChain 365(bigColor6) 64 - 379: 6(float) Load 378 - 380: 21(ptr) AccessChain 9(color) 64 - 381: 6(float) Load 380 - 382: 6(float) FAdd 381 379 - 383: 21(ptr) AccessChain 9(color) 64 - Store 383 382 - Branch 372 - 371: Label - Branch 356 - 372: Label - Branch 373 - 373: Label - 374: 21(ptr) AccessChain 9(color) 64 - 375: 6(float) Load 374 - 376: 6(float) Load 352(d6) - 377: 17(bool) FOrdLessThan 375 376 - LoopMerge 371 372 None - BranchConditional 377 370 371 - 356: Label - 384: 21(ptr) AccessChain 9(color) 20 - 385: 6(float) Load 384 - 386: 6(float) Load 352(d6) - 387: 17(bool) FOrdLessThan 385 386 - SelectionMerge 389 None - BranchConditional 387 388 407 - 388: Label - Branch 393 - 390: Label - 398: 7(fvec4) Load 365(bigColor6) - 399: 7(fvec4) Load 9(color) - 400: 7(fvec4) FAdd 399 398 - Store 9(color) 400 - 402: 6(float) Load 401(d7) - 403: 17(bool) FOrdLessThan 402 93 - SelectionMerge 405 None - BranchConditional 403 404 405 - 391: Label - Branch 389 - 392: Label - Branch 393 - 393: Label - 394: 21(ptr) AccessChain 9(color) 107 - 395: 6(float) Load 394 - 396: 6(float) Load 352(d6) - 397: 17(bool) FOrdLessThan 395 396 - LoopMerge 391 392 None - BranchConditional 397 390 391 - 404: Label - Branch 391 - 405: Label - Branch 392 - 407: Label - Branch 411 - 408: Label - 416: 51(ptr) AccessChain 365(bigColor6) 64 - 417: 6(float) Load 416 - 418: 21(ptr) AccessChain 9(color) 64 - 419: 6(float) Load 418 - 420: 6(float) FAdd 419 417 - 421: 21(ptr) AccessChain 9(color) 64 - Store 421 420 - Branch 410 - 409: Label - Branch 389 - 410: Label - Branch 411 - 411: Label - 412: 21(ptr) AccessChain 9(color) 64 - 413: 6(float) Load 412 - 414: 6(float) Load 352(d6) - 415: 17(bool) FOrdLessThan 413 414 - LoopMerge 409 410 None - BranchConditional 415 408 409 - 389: Label - Branch 422 - 422: Label - 425: 6(float) Load 401(d7) - 427: 17(bool) FOrdLessThan 425 426 - SelectionMerge 429 None - BranchConditional 427 428 429 - 423: Label - Branch 446 - 424: Label - LoopMerge 423 424 None - BranchConditional 18 422 423 - 428: Label - Branch 423 - 429: Label - 432: 7(fvec4) Load 431(bigColor7) - 433: 7(fvec4) Load 9(color) - 434: 7(fvec4) FAdd 433 432 - Store 9(color) 434 - 435: 6(float) Load 401(d7) - 436: 17(bool) FOrdLessThan 435 93 - SelectionMerge 438 None - BranchConditional 436 437 438 - 437: Label - 439: 21(ptr) AccessChain 9(color) 64 - 440: 6(float) Load 439 - 441: 6(float) FAdd 440 93 - Store 439 441 - Branch 423 - 438: Label - 443: 7(fvec4) Load 11(BaseColor) - 444: 7(fvec4) Load 9(color) - 445: 7(fvec4) FAdd 444 443 - Store 9(color) 445 - Branch 424 - 446: Label - 450: 6(float) Load 449(d8) - 451: 17(bool) FOrdLessThan 450 426 - SelectionMerge 453 None - BranchConditional 451 452 453 - 447: Label - Branch 488 - 448: Label - 481: 21(ptr) AccessChain 9(color) 64 - 482: 6(float) Load 481 - 483: 6(float) Load 449(d8) - 484: 17(bool) FOrdLessThan 482 483 - LoopMerge 447 448 None - BranchConditional 484 446 447 - 452: Label - Branch 447 - 453: Label - 455: 7(fvec4) Load 431(bigColor7) - 456: 7(fvec4) Load 9(color) - 457: 7(fvec4) FAdd 456 455 - Store 9(color) 457 - 458: 6(float) Load 449(d8) - 459: 17(bool) FOrdLessThan 458 93 - SelectionMerge 461 None - BranchConditional 459 460 461 - 460: Label - 462: 21(ptr) AccessChain 9(color) 64 - 463: 6(float) Load 462 - 464: 6(float) FAdd 463 93 - Store 462 464 - 465: 6(float) Load 449(d8) - 467: 17(bool) FOrdLessThan 465 466 - SelectionMerge 469 None - BranchConditional 467 468 473 - 468: Label - 470: 21(ptr) AccessChain 9(color) 107 - 471: 6(float) Load 470 - 472: 6(float) FAdd 471 93 - Store 470 472 - Branch 469 - 473: Label - 474: 21(ptr) AccessChain 9(color) 20 - 475: 6(float) Load 474 - 476: 6(float) FAdd 475 93 - Store 474 476 - Branch 469 - 469: Label - Branch 447 - 461: Label - 478: 7(fvec4) Load 11(BaseColor) - 479: 7(fvec4) Load 9(color) - 480: 7(fvec4) FAdd 479 478 - Store 9(color) 480 - Branch 448 - 485: Label - 494: 6(float) Load 491(d9) - 495: 6(float) Load 449(d8) - 496: 17(bool) FOrdGreaterThan 494 495 - SelectionMerge 498 None - BranchConditional 496 497 498 - 486: Label - Branch 519 - 487: Label - Branch 488 - 488: Label - 489: 21(ptr) AccessChain 9(color) 73 - 490: 6(float) Load 489 - 492: 6(float) Load 491(d9) - 493: 17(bool) FOrdLessThan 490 492 - LoopMerge 486 487 None - BranchConditional 493 485 486 - 497: Label - 499: 21(ptr) AccessChain 9(color) 20 - 500: 6(float) Load 499 - 501: 6(float) Load 401(d7) - 502: 17(bool) FOrdLessThanEqual 500 501 - SelectionMerge 504 None - BranchConditional 502 503 504 - 503: Label - 505: 21(ptr) AccessChain 9(color) 64 - 506: 6(float) Load 505 - 508: 17(bool) FOrdEqual 506 507 - SelectionMerge 510 None - BranchConditional 508 509 514 - 509: Label - 511: 21(ptr) AccessChain 9(color) 73 - 512: 6(float) Load 511 - 513: 6(float) FAdd 512 93 - Store 511 513 - Branch 510 - 514: Label - Branch 486 - 510: Label - Branch 504 - 504: Label - Branch 498 - 498: Label - Branch 487 - 516: Label - 525: 21(ptr) AccessChain 9(color) 107 - 526: 6(float) Load 525 - 527: 6(float) FAdd 526 93 - Store 525 527 - 528: 21(ptr) AccessChain 9(color) 107 - 529: 6(float) Load 528 - 531: 6(float) Load 530(d11) - 532: 17(bool) FOrdLessThan 529 531 - SelectionMerge 534 None - BranchConditional 532 533 534 - 517: Label - Branch 560 - 518: Label - Branch 519 - 519: Label - 520: 21(ptr) AccessChain 9(color) 64 - 521: 6(float) Load 520 - 523: 6(float) Load 522(d10) - 524: 17(bool) FOrdLessThan 521 523 - LoopMerge 517 518 None - BranchConditional 524 516 517 - 533: Label - 535: 21(ptr) AccessChain 9(color) 64 - 536: 6(float) Load 535 - 537: 6(float) FAdd 536 93 - Store 535 537 - 538: 21(ptr) AccessChain 9(color) 73 - 539: 6(float) Load 538 - 541: 6(float) Load 540(d12) - 542: 17(bool) FOrdLessThan 539 541 - SelectionMerge 544 None - BranchConditional 542 543 548 - 543: Label - 545: 21(ptr) AccessChain 9(color) 73 - 546: 6(float) Load 545 - 547: 6(float) FAdd 546 93 - Store 545 547 - Branch 544 - 548: Label - 549: 21(ptr) AccessChain 9(color) 20 - 550: 6(float) Load 549 - 551: 6(float) FAdd 550 93 - Store 549 551 - Branch 544 - 544: Label - Branch 518 - 534: Label - 553: 7(fvec4) Load 9(color) - 554: 7(fvec4) CompositeConstruct 93 93 93 93 - 555: 7(fvec4) FAdd 553 554 - Store 9(color) 555 - Branch 517 - 557: Label - 566: 7(fvec4) Load 565(bigColor8) - 567: 7(fvec4) Load 9(color) - 568: 7(fvec4) FAdd 567 566 - Store 9(color) 568 - 569: 21(ptr) AccessChain 9(color) 64 - 570: 6(float) Load 569 - 571: 6(float) Load 449(d8) - 572: 17(bool) FOrdLessThan 570 571 - SelectionMerge 574 None - BranchConditional 572 573 574 - 558: Label - 588: 7(fvec4) Load 9(color) - 589: 7(fvec4) CompositeConstruct 93 93 93 93 - 590: 7(fvec4) FAdd 588 589 - Store 9(color) 590 - 593: 7(fvec4) Load 9(color) - Store 592(gl_FragColor) 593 - Branch 597 - 559: Label - Branch 560 - 560: Label - 561: 21(ptr) AccessChain 9(color) 20 - 562: 6(float) Load 561 - 564: 17(bool) FOrdLessThan 562 563 - LoopMerge 558 559 None - BranchConditional 564 557 558 - 573: Label - 575: 21(ptr) AccessChain 9(color) 73 - 576: 6(float) Load 575 - 577: 6(float) Load 352(d6) - 578: 17(bool) FOrdLessThan 576 577 - SelectionMerge 580 None - BranchConditional 578 579 580 - 579: Label - Branch 559 - 580: Label - Branch 574 - 574: Label - 582: 51(ptr) AccessChain 565(bigColor8) 20 - 583: 6(float) Load 582 - 584: 21(ptr) AccessChain 9(color) 107 - 585: 6(float) Load 584 - 586: 6(float) FAdd 585 583 - 587: 21(ptr) AccessChain 9(color) 107 - Store 587 586 - Branch 559 - 594: Label - 603: 21(ptr) AccessChain 9(color) 107 - 604: 6(float) Load 603 - 606: 6(float) Load 605(d15) - 607: 17(bool) FOrdLessThan 604 606 - SelectionMerge 609 None - BranchConditional 607 608 611 - 595: Label - 615: 7(fvec4) Load 9(color) - 616: 7(fvec4) CompositeConstruct 93 93 93 93 - 617: 7(fvec4) FAdd 615 616 - Store 9(color) 617 - Branch 621 - 596: Label - Branch 597 - 597: Label - 598: 21(ptr) AccessChain 9(color) 20 - 599: 6(float) Load 598 - 601: 6(float) Load 600(d14) - 602: 17(bool) FOrdLessThan 599 601 - LoopMerge 595 596 None - BranchConditional 602 594 595 - 608: Label - Return - 611: Label - 612: 7(fvec4) Load 9(color) - 613: 7(fvec4) CompositeConstruct 93 93 93 93 - 614: 7(fvec4) FAdd 612 613 - Store 9(color) 614 - Branch 609 - 609: Label - Branch 596 - 618: Label - 627: 21(ptr) AccessChain 9(color) 73 - 628: 6(float) Load 627 - 629: 6(float) FAdd 628 93 - Store 627 629 - Branch 620 - 619: Label - Branch 633 - 620: Label - Branch 621 - 621: Label - 622: 21(ptr) AccessChain 9(color) 73 - 623: 6(float) Load 622 - 625: 6(float) Load 624(d16) - 626: 17(bool) FOrdLessThan 623 625 - LoopMerge 619 620 None - BranchConditional 626 618 619 - 630: Label - 645: 7(fvec4) Load 114(bigColor1_2) - 646: 7(fvec4) Load 9(color) - 647: 7(fvec4) FAdd 646 645 - Store 9(color) 647 - 648: 21(ptr) AccessChain 9(color) 64 - 649: 6(float) Load 648 - 650: 6(float) Load 110(d3) - 651: 17(bool) FOrdLessThan 649 650 - SelectionMerge 653 None - BranchConditional 651 652 653 - 631: Label - Branch 655 - 632: Label - Branch 633 - 633: Label - 634: 21(ptr) AccessChain 9(color) 73 - 635: 6(float) Load 634 - 636: 6(float) Load 102(d2) - 637: 17(bool) FOrdLessThan 635 636 - SelectionMerge 639 None - BranchConditional 637 638 639 - 638: Label - 640: 21(ptr) AccessChain 9(color) 107 - 641: 6(float) Load 640 - 642: 6(float) Load 110(d3) - 643: 17(bool) FOrdLessThan 641 642 - Branch 639 - 639: Label - 644: 17(bool) Phi 637 633 643 638 - LoopMerge 631 632 None - BranchConditional 644 630 631 - 652: Label - Return - 653: Label - Branch 632 - 655: Label - 658: 21(ptr) AccessChain 9(color) 107 - 659: 6(float) Load 658 - 661: 6(float) Load 660(d18) - 662: 17(bool) FOrdLessThan 659 661 - SelectionMerge 664 None - BranchConditional 662 663 664 - 656: Label - Branch 677 - 657: Label - 669: 21(ptr) AccessChain 9(color) 20 - 670: 6(float) Load 669 - 672: 6(float) Load 671(d17) - 673: 17(bool) FOrdLessThan 670 672 - LoopMerge 656 657 None - BranchConditional 673 655 656 - 663: Label - Return - 664: Label - 666: 7(fvec4) Load 9(color) - 667: 7(fvec4) CompositeConstruct 93 93 93 93 - 668: 7(fvec4) FAdd 666 667 - Store 9(color) 668 - Branch 657 - 674: Label - 682: 21(ptr) AccessChain 9(color) 73 - 683: 6(float) Load 682 - 684: 6(float) Load 624(d16) - 685: 17(bool) FOrdLessThan 683 684 - SelectionMerge 687 None - BranchConditional 685 686 689 - 675: Label - 693: 7(fvec4) Load 9(color) - 694: 7(fvec4) CompositeConstruct 93 93 93 93 - 695: 7(fvec4) FAdd 693 694 - Store 9(color) 695 - 696: 7(fvec4) Load 9(color) - Store 592(gl_FragColor) 696 - Return - 676: Label - Branch 677 - 677: Label - 678: 21(ptr) AccessChain 9(color) 107 - 679: 6(float) Load 678 - 680: 6(float) Load 624(d16) - 681: 17(bool) FOrdLessThan 679 680 - LoopMerge 675 676 None - BranchConditional 681 674 675 - 686: Label - Kill - 689: Label - 690: 7(fvec4) Load 9(color) - 691: 7(fvec4) CompositeConstruct 93 93 93 93 - 692: 7(fvec4) FAdd 690 691 - Store 9(color) 692 - Branch 687 - 687: Label - Branch 676 - FunctionEnd + 47: Label + Branch 60 + 48: Label + Branch 45 + 60: Label + 65: 21(ptr) AccessChain 9(color) 64 + 66: 6(float) Load 65 + 67: 6(float) Load 52(d) + 68: 17(bool) FOrdLessThan 66 67 + LoopMerge 62 63 None + BranchConditional 68 61 62 + 61: Label + 70: 7(fvec4) Load 69(bigColor1_1) + 71: 7(fvec4) Load 9(color) + 72: 7(fvec4) FAdd 71 70 + Store 9(color) 72 + 74: 21(ptr) AccessChain 9(color) 73 + 75: 6(float) Load 74 + 76: 6(float) Load 52(d) + 77: 17(bool) FOrdLessThan 75 76 + SelectionMerge 79 None + BranchConditional 77 78 79 + 62: Label + Branch 84 + 63: Label + Branch 60 + 78: Label + Branch 63 + 79: Label + 81: 7(fvec4) Load 69(bigColor1_1) + 82: 7(fvec4) Load 9(color) + 83: 7(fvec4) FAdd 82 81 + Store 9(color) 83 + Branch 63 + 84: Label + 88: 21(ptr) AccessChain 9(color) 20 + 89: 6(float) Load 88 + 91: 17(bool) FOrdLessThan 89 90 + LoopMerge 86 87 None + BranchConditional 91 85 86 + 85: Label + 92: 7(fvec4) Load 9(color) + 94: 7(fvec4) CompositeConstruct 93 93 93 93 + 95: 7(fvec4) FAdd 92 94 + Store 9(color) 95 + Branch 87 + 86: Label + Branch 96 + 87: Label + Branch 84 + 96: Label + 100: 21(ptr) AccessChain 9(color) 73 + 101: 6(float) Load 100 + 103: 6(float) Load 102(d2) + 104: 17(bool) FOrdLessThan 101 103 + SelectionMerge 106 None + BranchConditional 104 105 106 + 97: Label + 115: 7(fvec4) Load 114(bigColor1_2) + 116: 7(fvec4) Load 9(color) + 117: 7(fvec4) FAdd 116 115 + Store 9(color) 117 + Branch 99 + 98: Label + Branch 118 + 99: Label + Branch 96 + 105: Label + 108: 21(ptr) AccessChain 9(color) 107 + 109: 6(float) Load 108 + 111: 6(float) Load 110(d3) + 112: 17(bool) FOrdLessThan 109 111 + Branch 106 + 106: Label + 113: 17(bool) Phi 104 96 112 105 + LoopMerge 98 99 None + BranchConditional 113 97 98 + 118: Label + 122: 21(ptr) AccessChain 9(color) 64 + 123: 6(float) Load 122 + 124: 6(float) Load 110(d3) + 125: 17(bool) FOrdLessThan 123 124 + LoopMerge 120 121 None + BranchConditional 125 119 120 + 119: Label + 127: 7(fvec4) Load 126(bigColor1_3) + 128: 7(fvec4) Load 9(color) + 129: 7(fvec4) FAdd 128 127 + Store 9(color) 129 + 130: 21(ptr) AccessChain 9(color) 107 + 131: 6(float) Load 130 + 133: 6(float) Load 132(d4) + 134: 17(bool) FOrdLessThan 131 133 + SelectionMerge 136 None + BranchConditional 134 135 136 + 120: Label + Store 143(i) 144 + Branch 145 + 121: Label + Branch 118 + 135: Label + Branch 120 + 136: Label + 138: 7(fvec4) Load 126(bigColor1_3) + 139: 7(fvec4) Load 9(color) + 140: 7(fvec4) FAdd 139 138 + Store 9(color) 140 + Branch 121 + 145: Label + 149: 141(int) Load 143(i) + 152: 141(int) Load 151(Count) + 153: 17(bool) SLessThan 149 152 + LoopMerge 147 148 None + BranchConditional 153 146 147 + 146: Label + 155: 7(fvec4) Load 154(bigColor2) + 156: 7(fvec4) Load 9(color) + 157: 7(fvec4) FAdd 156 155 + Store 9(color) 157 + Branch 148 + 147: Label + Branch 161 + 148: Label + 158: 141(int) Load 143(i) + 160: 141(int) IAdd 158 159 + Store 143(i) 160 + Branch 145 + 161: Label + LoopMerge 163 164 None + Branch 162 + 162: Label + 166: 7(fvec4) Load 165(bigColor3) + 167: 7(fvec4) Load 9(color) + 168: 7(fvec4) FAdd 167 166 + Store 9(color) 168 + Branch 164 + 163: Label + Store 173(i) 144 + Branch 174 + 164: Label + 169: 21(ptr) AccessChain 9(color) 20 + 170: 6(float) Load 169 + 171: 6(float) Load 102(d2) + 172: 17(bool) FOrdLessThan 170 171 + BranchConditional 172 161 163 + 174: Label + 178: 141(int) Load 173(i) + 180: 17(bool) SLessThan 178 179 + LoopMerge 176 177 None + BranchConditional 180 175 176 + 175: Label + 181: 6(float) Load 110(d3) + 182: 21(ptr) AccessChain 9(color) 64 + 183: 6(float) Load 182 + 184: 6(float) FAdd 183 181 + 185: 21(ptr) AccessChain 9(color) 64 + Store 185 184 + Branch 177 + 176: Label + Store 188(i) 144 + Branch 189 + 177: Label + 186: 141(int) Load 173(i) + 187: 141(int) IAdd 186 159 + Store 173(i) 187 + Branch 174 + 189: Label + 193: 141(int) Load 188(i) + 195: 17(bool) SLessThan 193 194 + LoopMerge 191 192 None + BranchConditional 195 190 191 + 190: Label + 196: 21(ptr) AccessChain 9(color) 64 + 197: 6(float) Load 196 + 199: 17(bool) FOrdLessThan 197 198 + SelectionMerge 201 None + BranchConditional 199 200 205 + 191: Label + Store 223(i) 144 + Branch 224 + 192: Label + 221: 141(int) Load 188(i) + 222: 141(int) IAdd 221 159 + Store 188(i) 222 + Branch 189 + 200: Label + 202: 21(ptr) AccessChain 9(color) 20 + 203: 6(float) Load 202 + 204: 6(float) FAdd 203 93 + Store 202 204 + Branch 201 + 205: Label + 206: 21(ptr) AccessChain 9(color) 107 + 207: 6(float) Load 206 + 208: 6(float) FAdd 207 93 + Store 206 208 + Branch 201 + 201: Label + 209: 21(ptr) AccessChain 9(color) 73 + 210: 6(float) Load 209 + 211: 17(bool) FOrdLessThan 210 198 + SelectionMerge 213 None + BranchConditional 211 212 213 + 212: Label + 214: 21(ptr) AccessChain 9(color) 64 + 215: 6(float) Load 214 + 216: 21(ptr) AccessChain 9(color) 107 + 217: 6(float) Load 216 + 218: 17(bool) FOrdGreaterThan 215 217 + SelectionMerge 220 None + BranchConditional 218 219 220 + 219: Label + Branch 220 + 220: Label + Branch 213 + 213: Label + Branch 192 + 224: Label + 228: 141(int) Load 223(i) + 230: 17(bool) SLessThan 228 229 + LoopMerge 226 227 None + BranchConditional 230 225 226 + 225: Label + 231: 21(ptr) AccessChain 9(color) 64 + 232: 6(float) Load 231 + 233: 17(bool) FOrdLessThan 232 198 + SelectionMerge 235 None + BranchConditional 233 234 239 + 226: Label + Store 245(i) 144 + Branch 246 + 227: Label + 243: 141(int) Load 223(i) + 244: 141(int) IAdd 243 159 + Store 223(i) 244 + Branch 224 + 234: Label + 236: 21(ptr) AccessChain 9(color) 20 + 237: 6(float) Load 236 + 238: 6(float) FAdd 237 93 + Store 236 238 + Branch 235 + 239: Label + 240: 21(ptr) AccessChain 9(color) 107 + 241: 6(float) Load 240 + 242: 6(float) FAdd 241 93 + Store 240 242 + Branch 235 + 235: Label + Branch 227 + 246: Label + 250: 141(int) Load 245(i) + 251: 17(bool) SLessThan 250 179 + LoopMerge 248 249 None + BranchConditional 251 247 248 + 247: Label + 252: 6(float) Load 110(d3) + 253: 21(ptr) AccessChain 9(color) 64 + 254: 6(float) Load 253 + 255: 6(float) FAdd 254 252 + 256: 21(ptr) AccessChain 9(color) 64 + Store 256 255 + 257: 21(ptr) AccessChain 9(color) 20 + 258: 6(float) Load 257 + 259: 6(float) Load 132(d4) + 260: 17(bool) FOrdLessThan 258 259 + SelectionMerge 262 None + BranchConditional 260 261 262 + 248: Label + Store 269(i) 144 + Branch 270 + 249: Label + 267: 141(int) Load 245(i) + 268: 141(int) IAdd 267 159 + Store 245(i) 268 + Branch 246 + 261: Label + Branch 249 + 262: Label + 264: 21(ptr) AccessChain 9(color) 73 + 265: 6(float) Load 264 + 266: 6(float) FAdd 265 93 + Store 264 266 + Branch 249 + 270: Label + 274: 141(int) Load 269(i) + 275: 17(bool) SLessThan 274 179 + LoopMerge 272 273 None + BranchConditional 275 271 272 + 271: Label + 276: 6(float) Load 110(d3) + 277: 21(ptr) AccessChain 9(color) 64 + 278: 6(float) Load 277 + 279: 6(float) FAdd 278 276 + 280: 21(ptr) AccessChain 9(color) 64 + Store 280 279 + 281: 21(ptr) AccessChain 9(color) 20 + 282: 6(float) Load 281 + 283: 6(float) Load 132(d4) + 284: 17(bool) FOrdLessThan 282 283 + SelectionMerge 286 None + BranchConditional 284 285 286 + 272: Label + Branch 293 + 273: Label + 291: 141(int) Load 269(i) + 292: 141(int) IAdd 291 159 + Store 269(i) 292 + Branch 270 + 285: Label + Branch 272 + 286: Label + 288: 21(ptr) AccessChain 9(color) 73 + 289: 6(float) Load 288 + 290: 6(float) FAdd 289 93 + Store 288 290 + Branch 273 + 293: Label + LoopMerge 295 296 None + Branch 294 + 294: Label + 298: 7(fvec4) Load 297(bigColor4) + 299: 7(fvec4) Load 9(color) + 300: 7(fvec4) FAdd 299 298 + Store 9(color) 300 + 301: 21(ptr) AccessChain 9(color) 20 + 302: 6(float) Load 301 + 303: 6(float) Load 132(d4) + 304: 17(bool) FOrdLessThan 302 303 + SelectionMerge 306 None + BranchConditional 304 305 306 + 295: Label + Branch 329 + 296: Label + 325: 21(ptr) AccessChain 9(color) 64 + 326: 6(float) Load 325 + 327: 6(float) Load 132(d4) + 328: 17(bool) FOrdLessThan 326 327 + BranchConditional 328 293 295 + 305: Label + Branch 296 + 306: Label + 308: 21(ptr) AccessChain 9(color) 107 + 309: 6(float) Load 308 + 310: 6(float) Load 132(d4) + 311: 17(bool) FOrdLessThan 309 310 + SelectionMerge 313 None + BranchConditional 311 312 319 + 312: Label + 314: 6(float) Load 132(d4) + 315: 21(ptr) AccessChain 9(color) 107 + 316: 6(float) Load 315 + 317: 6(float) FAdd 316 314 + 318: 21(ptr) AccessChain 9(color) 107 + Store 318 317 + Branch 313 + 319: Label + 320: 6(float) Load 132(d4) + 321: 21(ptr) AccessChain 9(color) 20 + 322: 6(float) Load 321 + 323: 6(float) FAdd 322 320 + 324: 21(ptr) AccessChain 9(color) 20 + Store 324 323 + Branch 313 + 313: Label + Branch 296 + 329: Label + LoopMerge 331 332 None + Branch 330 + 330: Label + 334: 7(fvec4) Load 333(bigColor5) + 335: 7(fvec4) Load 9(color) + 336: 7(fvec4) FAdd 335 334 + Store 9(color) 336 + 337: 21(ptr) AccessChain 9(color) 107 + 338: 6(float) Load 337 + 340: 6(float) Load 339(d5) + 341: 17(bool) FOrdLessThan 338 340 + SelectionMerge 343 None + BranchConditional 341 342 343 + 331: Label + 353: 21(ptr) AccessChain 9(color) 20 + 354: 6(float) Load 353 + 356: 6(float) Load 355(d6) + 357: 17(bool) FOrdLessThan 354 356 + SelectionMerge 359 None + BranchConditional 357 358 372 + 332: Label + 349: 21(ptr) AccessChain 9(color) 20 + 350: 6(float) Load 349 + 351: 6(float) Load 339(d5) + 352: 17(bool) FOrdLessThan 350 351 + BranchConditional 352 329 331 + 342: Label + 344: 6(float) Load 339(d5) + 345: 21(ptr) AccessChain 9(color) 107 + 346: 6(float) Load 345 + 347: 6(float) FAdd 346 344 + 348: 21(ptr) AccessChain 9(color) 107 + Store 348 347 + Branch 343 + 343: Label + Branch 332 + 358: Label + Branch 360 + 360: Label + 364: 21(ptr) AccessChain 9(color) 107 + 365: 6(float) Load 364 + 366: 6(float) Load 355(d6) + 367: 17(bool) FOrdLessThan 365 366 + LoopMerge 362 363 None + BranchConditional 367 361 362 + 361: Label + 369: 7(fvec4) Load 368(bigColor6) + 370: 7(fvec4) Load 9(color) + 371: 7(fvec4) FAdd 370 369 + Store 9(color) 371 + Branch 363 + 362: Label + Branch 359 + 363: Label + Branch 360 + 372: Label + Branch 373 + 373: Label + 377: 21(ptr) AccessChain 9(color) 64 + 378: 6(float) Load 377 + 379: 6(float) Load 355(d6) + 380: 17(bool) FOrdLessThan 378 379 + LoopMerge 375 376 None + BranchConditional 380 374 375 + 374: Label + 381: 51(ptr) AccessChain 368(bigColor6) 64 + 382: 6(float) Load 381 + 383: 21(ptr) AccessChain 9(color) 64 + 384: 6(float) Load 383 + 385: 6(float) FAdd 384 382 + 386: 21(ptr) AccessChain 9(color) 64 + Store 386 385 + Branch 376 + 375: Label + Branch 359 + 376: Label + Branch 373 + 359: Label + 387: 21(ptr) AccessChain 9(color) 20 + 388: 6(float) Load 387 + 389: 6(float) Load 355(d6) + 390: 17(bool) FOrdLessThan 388 389 + SelectionMerge 392 None + BranchConditional 390 391 410 + 391: Label + Branch 393 + 393: Label + 397: 21(ptr) AccessChain 9(color) 107 + 398: 6(float) Load 397 + 399: 6(float) Load 355(d6) + 400: 17(bool) FOrdLessThan 398 399 + LoopMerge 395 396 None + BranchConditional 400 394 395 + 394: Label + 401: 7(fvec4) Load 368(bigColor6) + 402: 7(fvec4) Load 9(color) + 403: 7(fvec4) FAdd 402 401 + Store 9(color) 403 + 405: 6(float) Load 404(d7) + 406: 17(bool) FOrdLessThan 405 93 + SelectionMerge 408 None + BranchConditional 406 407 408 + 395: Label + Branch 392 + 396: Label + Branch 393 + 407: Label + Branch 395 + 408: Label + Branch 396 + 410: Label + Branch 411 + 411: Label + 415: 21(ptr) AccessChain 9(color) 64 + 416: 6(float) Load 415 + 417: 6(float) Load 355(d6) + 418: 17(bool) FOrdLessThan 416 417 + LoopMerge 413 414 None + BranchConditional 418 412 413 + 412: Label + 419: 51(ptr) AccessChain 368(bigColor6) 64 + 420: 6(float) Load 419 + 421: 21(ptr) AccessChain 9(color) 64 + 422: 6(float) Load 421 + 423: 6(float) FAdd 422 420 + 424: 21(ptr) AccessChain 9(color) 64 + Store 424 423 + Branch 414 + 413: Label + Branch 392 + 414: Label + Branch 411 + 392: Label + Branch 425 + 425: Label + LoopMerge 427 428 None + Branch 426 + 426: Label + 429: 6(float) Load 404(d7) + 431: 17(bool) FOrdLessThan 429 430 + SelectionMerge 433 None + BranchConditional 431 432 433 + 427: Label + Branch 450 + 428: Label + BranchConditional 18 425 427 + 432: Label + Branch 427 + 433: Label + 436: 7(fvec4) Load 435(bigColor7) + 437: 7(fvec4) Load 9(color) + 438: 7(fvec4) FAdd 437 436 + Store 9(color) 438 + 439: 6(float) Load 404(d7) + 440: 17(bool) FOrdLessThan 439 93 + SelectionMerge 442 None + BranchConditional 440 441 442 + 441: Label + 443: 21(ptr) AccessChain 9(color) 64 + 444: 6(float) Load 443 + 445: 6(float) FAdd 444 93 + Store 443 445 + Branch 427 + 442: Label + 447: 7(fvec4) Load 11(BaseColor) + 448: 7(fvec4) Load 9(color) + 449: 7(fvec4) FAdd 448 447 + Store 9(color) 449 + Branch 428 + 450: Label + LoopMerge 452 453 None + Branch 451 + 451: Label + 455: 6(float) Load 454(d8) + 456: 17(bool) FOrdLessThan 455 430 + SelectionMerge 458 None + BranchConditional 456 457 458 + 452: Label + Branch 490 + 453: Label + 486: 21(ptr) AccessChain 9(color) 64 + 487: 6(float) Load 486 + 488: 6(float) Load 454(d8) + 489: 17(bool) FOrdLessThan 487 488 + BranchConditional 489 450 452 + 457: Label + Branch 452 + 458: Label + 460: 7(fvec4) Load 435(bigColor7) + 461: 7(fvec4) Load 9(color) + 462: 7(fvec4) FAdd 461 460 + Store 9(color) 462 + 463: 6(float) Load 454(d8) + 464: 17(bool) FOrdLessThan 463 93 + SelectionMerge 466 None + BranchConditional 464 465 466 + 465: Label + 467: 21(ptr) AccessChain 9(color) 64 + 468: 6(float) Load 467 + 469: 6(float) FAdd 468 93 + Store 467 469 + 470: 6(float) Load 454(d8) + 472: 17(bool) FOrdLessThan 470 471 + SelectionMerge 474 None + BranchConditional 472 473 478 + 473: Label + 475: 21(ptr) AccessChain 9(color) 107 + 476: 6(float) Load 475 + 477: 6(float) FAdd 476 93 + Store 475 477 + Branch 474 + 478: Label + 479: 21(ptr) AccessChain 9(color) 20 + 480: 6(float) Load 479 + 481: 6(float) FAdd 480 93 + Store 479 481 + Branch 474 + 474: Label + Branch 452 + 466: Label + 483: 7(fvec4) Load 11(BaseColor) + 484: 7(fvec4) Load 9(color) + 485: 7(fvec4) FAdd 484 483 + Store 9(color) 485 + Branch 453 + 490: Label + 494: 21(ptr) AccessChain 9(color) 73 + 495: 6(float) Load 494 + 497: 6(float) Load 496(d9) + 498: 17(bool) FOrdLessThan 495 497 + LoopMerge 492 493 None + BranchConditional 498 491 492 + 491: Label + 499: 6(float) Load 496(d9) + 500: 6(float) Load 454(d8) + 501: 17(bool) FOrdGreaterThan 499 500 + SelectionMerge 503 None + BranchConditional 501 502 503 + 492: Label + Branch 521 + 493: Label + Branch 490 + 502: Label + 504: 21(ptr) AccessChain 9(color) 20 + 505: 6(float) Load 504 + 506: 6(float) Load 404(d7) + 507: 17(bool) FOrdLessThanEqual 505 506 + SelectionMerge 509 None + BranchConditional 507 508 509 + 508: Label + 510: 21(ptr) AccessChain 9(color) 64 + 511: 6(float) Load 510 + 513: 17(bool) FOrdEqual 511 512 + SelectionMerge 515 None + BranchConditional 513 514 519 + 514: Label + 516: 21(ptr) AccessChain 9(color) 73 + 517: 6(float) Load 516 + 518: 6(float) FAdd 517 93 + Store 516 518 + Branch 515 + 519: Label + Branch 492 + 515: Label + Branch 509 + 509: Label + Branch 503 + 503: Label + Branch 493 + 521: Label + 525: 21(ptr) AccessChain 9(color) 64 + 526: 6(float) Load 525 + 528: 6(float) Load 527(d10) + 529: 17(bool) FOrdLessThan 526 528 + LoopMerge 523 524 None + BranchConditional 529 522 523 + 522: Label + 530: 21(ptr) AccessChain 9(color) 107 + 531: 6(float) Load 530 + 532: 6(float) FAdd 531 93 + Store 530 532 + 533: 21(ptr) AccessChain 9(color) 107 + 534: 6(float) Load 533 + 536: 6(float) Load 535(d11) + 537: 17(bool) FOrdLessThan 534 536 + SelectionMerge 539 None + BranchConditional 537 538 539 + 523: Label + Branch 562 + 524: Label + Branch 521 + 538: Label + 540: 21(ptr) AccessChain 9(color) 64 + 541: 6(float) Load 540 + 542: 6(float) FAdd 541 93 + Store 540 542 + 543: 21(ptr) AccessChain 9(color) 73 + 544: 6(float) Load 543 + 546: 6(float) Load 545(d12) + 547: 17(bool) FOrdLessThan 544 546 + SelectionMerge 549 None + BranchConditional 547 548 553 + 548: Label + 550: 21(ptr) AccessChain 9(color) 73 + 551: 6(float) Load 550 + 552: 6(float) FAdd 551 93 + Store 550 552 + Branch 549 + 553: Label + 554: 21(ptr) AccessChain 9(color) 20 + 555: 6(float) Load 554 + 556: 6(float) FAdd 555 93 + Store 554 556 + Branch 549 + 549: Label + Branch 524 + 539: Label + 558: 7(fvec4) Load 9(color) + 559: 7(fvec4) CompositeConstruct 93 93 93 93 + 560: 7(fvec4) FAdd 558 559 + Store 9(color) 560 + Branch 523 + 562: Label + 566: 21(ptr) AccessChain 9(color) 20 + 567: 6(float) Load 566 + 569: 17(bool) FOrdLessThan 567 568 + LoopMerge 564 565 None + BranchConditional 569 563 564 + 563: Label + 571: 7(fvec4) Load 570(bigColor8) + 572: 7(fvec4) Load 9(color) + 573: 7(fvec4) FAdd 572 571 + Store 9(color) 573 + 574: 21(ptr) AccessChain 9(color) 64 + 575: 6(float) Load 574 + 576: 6(float) Load 454(d8) + 577: 17(bool) FOrdLessThan 575 576 + SelectionMerge 579 None + BranchConditional 577 578 579 + 564: Label + 593: 7(fvec4) Load 9(color) + 594: 7(fvec4) CompositeConstruct 93 93 93 93 + 595: 7(fvec4) FAdd 593 594 + Store 9(color) 595 + 598: 7(fvec4) Load 9(color) + Store 597(gl_FragColor) 598 + Branch 599 + 565: Label + Branch 562 + 578: Label + 580: 21(ptr) AccessChain 9(color) 73 + 581: 6(float) Load 580 + 582: 6(float) Load 355(d6) + 583: 17(bool) FOrdLessThan 581 582 + SelectionMerge 585 None + BranchConditional 583 584 585 + 584: Label + Branch 565 + 585: Label + Branch 579 + 579: Label + 587: 51(ptr) AccessChain 570(bigColor8) 20 + 588: 6(float) Load 587 + 589: 21(ptr) AccessChain 9(color) 107 + 590: 6(float) Load 589 + 591: 6(float) FAdd 590 588 + 592: 21(ptr) AccessChain 9(color) 107 + Store 592 591 + Branch 565 + 599: Label + 603: 21(ptr) AccessChain 9(color) 20 + 604: 6(float) Load 603 + 606: 6(float) Load 605(d14) + 607: 17(bool) FOrdLessThan 604 606 + LoopMerge 601 602 None + BranchConditional 607 600 601 + 600: Label + 608: 21(ptr) AccessChain 9(color) 107 + 609: 6(float) Load 608 + 611: 6(float) Load 610(d15) + 612: 17(bool) FOrdLessThan 609 611 + SelectionMerge 614 None + BranchConditional 612 613 616 + 601: Label + 620: 7(fvec4) Load 9(color) + 621: 7(fvec4) CompositeConstruct 93 93 93 93 + 622: 7(fvec4) FAdd 620 621 + Store 9(color) 622 + Branch 623 + 602: Label + Branch 599 + 613: Label + Return + 616: Label + 617: 7(fvec4) Load 9(color) + 618: 7(fvec4) CompositeConstruct 93 93 93 93 + 619: 7(fvec4) FAdd 617 618 + Store 9(color) 619 + Branch 614 + 614: Label + Branch 602 + 623: Label + 627: 21(ptr) AccessChain 9(color) 73 + 628: 6(float) Load 627 + 630: 6(float) Load 629(d16) + 631: 17(bool) FOrdLessThan 628 630 + LoopMerge 625 626 None + BranchConditional 631 624 625 + 624: Label + 632: 21(ptr) AccessChain 9(color) 73 + 633: 6(float) Load 632 + 634: 6(float) FAdd 633 93 + Store 632 634 + Branch 626 + 625: Label + Branch 635 + 626: Label + Branch 623 + 635: Label + 639: 21(ptr) AccessChain 9(color) 73 + 640: 6(float) Load 639 + 641: 6(float) Load 102(d2) + 642: 17(bool) FOrdLessThan 640 641 + SelectionMerge 644 None + BranchConditional 642 643 644 + 636: Label + 650: 7(fvec4) Load 114(bigColor1_2) + 651: 7(fvec4) Load 9(color) + 652: 7(fvec4) FAdd 651 650 + Store 9(color) 652 + 653: 21(ptr) AccessChain 9(color) 64 + 654: 6(float) Load 653 + 655: 6(float) Load 110(d3) + 656: 17(bool) FOrdLessThan 654 655 + SelectionMerge 658 None + BranchConditional 656 657 658 + 637: Label + Branch 660 + 638: Label + Branch 635 + 643: Label + 645: 21(ptr) AccessChain 9(color) 107 + 646: 6(float) Load 645 + 647: 6(float) Load 110(d3) + 648: 17(bool) FOrdLessThan 646 647 + Branch 644 + 644: Label + 649: 17(bool) Phi 642 635 648 643 + LoopMerge 637 638 None + BranchConditional 649 636 637 + 657: Label + Return + 658: Label + Branch 638 + 660: Label + LoopMerge 662 663 None + Branch 661 + 661: Label + 664: 21(ptr) AccessChain 9(color) 107 + 665: 6(float) Load 664 + 667: 6(float) Load 666(d18) + 668: 17(bool) FOrdLessThan 665 667 + SelectionMerge 670 None + BranchConditional 668 669 670 + 662: Label + Branch 680 + 663: Label + 675: 21(ptr) AccessChain 9(color) 20 + 676: 6(float) Load 675 + 678: 6(float) Load 677(d17) + 679: 17(bool) FOrdLessThan 676 678 + BranchConditional 679 660 662 + 669: Label + Return + 670: Label + 672: 7(fvec4) Load 9(color) + 673: 7(fvec4) CompositeConstruct 93 93 93 93 + 674: 7(fvec4) FAdd 672 673 + Store 9(color) 674 + Branch 663 + 680: Label + 684: 21(ptr) AccessChain 9(color) 107 + 685: 6(float) Load 684 + 686: 6(float) Load 629(d16) + 687: 17(bool) FOrdLessThan 685 686 + LoopMerge 682 683 None + BranchConditional 687 681 682 + 681: Label + 688: 21(ptr) AccessChain 9(color) 73 + 689: 6(float) Load 688 + 690: 6(float) Load 629(d16) + 691: 17(bool) FOrdLessThan 689 690 + SelectionMerge 693 None + BranchConditional 691 692 695 + 682: Label + 699: 7(fvec4) Load 9(color) + 700: 7(fvec4) CompositeConstruct 93 93 93 93 + 701: 7(fvec4) FAdd 699 700 + Store 9(color) 701 + 702: 7(fvec4) Load 9(color) + Store 597(gl_FragColor) 702 + Return + 683: Label + Branch 680 + 692: Label + Kill + 695: Label + 696: 7(fvec4) Load 9(color) + 697: 7(fvec4) CompositeConstruct 93 93 93 93 + 698: 7(fvec4) FAdd 696 697 + Store 9(color) 698 + Branch 693 + 693: Label + Branch 683 + FunctionEnd diff --git a/Test/baseResults/spv.loopsArtificial.frag.out b/Test/baseResults/spv.loopsArtificial.frag.out index ff7a8f2f..fa7313e7 100755 --- a/Test/baseResults/spv.loopsArtificial.frag.out +++ b/Test/baseResults/spv.loopsArtificial.frag.out @@ -7,7 +7,7 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 186 +// Id's are bound by 187 Capability Shader 1: ExtInstImport "GLSL.std.450" @@ -18,53 +18,53 @@ Linked fragment stage: Name 4 "main" Name 9 "color" Name 11 "BaseColor" - Name 17 "bigColor4" - Name 27 "d4" - Name 79 "d13" - Name 139 "gl_FragColor" - Name 141 "bigColor" - Name 142 "bigColor1_1" - Name 143 "bigColor1_2" - Name 144 "bigColor1_3" - Name 145 "bigColor2" - Name 146 "bigColor3" - Name 147 "bigColor5" - Name 148 "bigColor6" - Name 149 "bigColor7" - Name 150 "bigColor8" - Name 151 "d" - Name 152 "d2" - Name 153 "d3" - Name 154 "d5" - Name 155 "d6" - Name 156 "d7" - Name 157 "d8" - Name 158 "d9" - Name 159 "d10" - Name 160 "d11" - Name 161 "d12" - Name 162 "d14" - Name 163 "d15" - Name 164 "d16" - Name 165 "d17" - Name 166 "d18" - Name 167 "d19" - Name 168 "d20" - Name 169 "d21" - Name 170 "d22" - Name 171 "d23" - Name 172 "d24" - Name 173 "d25" - Name 174 "d26" - Name 175 "d27" - Name 176 "d28" - Name 177 "d29" - Name 178 "d30" - Name 179 "d31" - Name 180 "d32" - Name 181 "d33" - Name 182 "d34" - Name 185 "Count" + Name 18 "bigColor4" + Name 28 "d4" + Name 80 "d13" + Name 140 "gl_FragColor" + Name 142 "bigColor" + Name 143 "bigColor1_1" + Name 144 "bigColor1_2" + Name 145 "bigColor1_3" + Name 146 "bigColor2" + Name 147 "bigColor3" + Name 148 "bigColor5" + Name 149 "bigColor6" + Name 150 "bigColor7" + Name 151 "bigColor8" + Name 152 "d" + Name 153 "d2" + Name 154 "d3" + Name 155 "d5" + Name 156 "d6" + Name 157 "d7" + Name 158 "d8" + Name 159 "d9" + Name 160 "d10" + Name 161 "d11" + Name 162 "d12" + Name 163 "d14" + Name 164 "d15" + Name 165 "d16" + Name 166 "d17" + Name 167 "d18" + Name 168 "d19" + Name 169 "d20" + Name 170 "d21" + Name 171 "d22" + Name 172 "d23" + Name 173 "d24" + Name 174 "d25" + Name 175 "d26" + Name 176 "d27" + Name 177 "d28" + Name 178 "d29" + Name 179 "d30" + Name 180 "d31" + Name 181 "d32" + Name 182 "d33" + Name 183 "d34" + Name 186 "Count" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -72,67 +72,67 @@ Linked fragment stage: 8: TypePointer Function 7(fvec4) 10: TypePointer Input 7(fvec4) 11(BaseColor): 10(ptr) Variable Input - 16: TypePointer UniformConstant 7(fvec4) - 17(bigColor4): 16(ptr) Variable UniformConstant - 21: TypeInt 32 0 - 22: 21(int) Constant 0 - 23: TypePointer Function 6(float) - 26: TypePointer UniformConstant 6(float) - 27(d4): 26(ptr) Variable UniformConstant - 29: TypeBool - 33: 6(float) Constant 1073741824 - 34: 21(int) Constant 2 - 47: 6(float) Constant 1065353216 - 50: 21(int) Constant 1 - 76: 21(int) Constant 3 - 79(d13): 26(ptr) Variable UniformConstant - 138: TypePointer Output 7(fvec4) -139(gl_FragColor): 138(ptr) Variable Output - 141(bigColor): 16(ptr) Variable UniformConstant -142(bigColor1_1): 16(ptr) Variable UniformConstant -143(bigColor1_2): 16(ptr) Variable UniformConstant -144(bigColor1_3): 16(ptr) Variable UniformConstant - 145(bigColor2): 16(ptr) Variable UniformConstant - 146(bigColor3): 16(ptr) Variable UniformConstant - 147(bigColor5): 16(ptr) Variable UniformConstant - 148(bigColor6): 16(ptr) Variable UniformConstant - 149(bigColor7): 16(ptr) Variable UniformConstant - 150(bigColor8): 16(ptr) Variable UniformConstant - 151(d): 26(ptr) Variable UniformConstant - 152(d2): 26(ptr) Variable UniformConstant - 153(d3): 26(ptr) Variable UniformConstant - 154(d5): 26(ptr) Variable UniformConstant - 155(d6): 26(ptr) Variable UniformConstant - 156(d7): 26(ptr) Variable UniformConstant - 157(d8): 26(ptr) Variable UniformConstant - 158(d9): 26(ptr) Variable UniformConstant - 159(d10): 26(ptr) Variable UniformConstant - 160(d11): 26(ptr) Variable UniformConstant - 161(d12): 26(ptr) Variable UniformConstant - 162(d14): 26(ptr) Variable UniformConstant - 163(d15): 26(ptr) Variable UniformConstant - 164(d16): 26(ptr) Variable UniformConstant - 165(d17): 26(ptr) Variable UniformConstant - 166(d18): 26(ptr) Variable UniformConstant - 167(d19): 26(ptr) Variable UniformConstant - 168(d20): 26(ptr) Variable UniformConstant - 169(d21): 26(ptr) Variable UniformConstant - 170(d22): 26(ptr) Variable UniformConstant - 171(d23): 26(ptr) Variable UniformConstant - 172(d24): 26(ptr) Variable UniformConstant - 173(d25): 26(ptr) Variable UniformConstant - 174(d26): 26(ptr) Variable UniformConstant - 175(d27): 26(ptr) Variable UniformConstant - 176(d28): 26(ptr) Variable UniformConstant - 177(d29): 26(ptr) Variable UniformConstant - 178(d30): 26(ptr) Variable UniformConstant - 179(d31): 26(ptr) Variable UniformConstant - 180(d32): 26(ptr) Variable UniformConstant - 181(d33): 26(ptr) Variable UniformConstant - 182(d34): 26(ptr) Variable UniformConstant - 183: TypeInt 32 1 - 184: TypePointer UniformConstant 183(int) - 185(Count): 184(ptr) Variable UniformConstant + 17: TypePointer UniformConstant 7(fvec4) + 18(bigColor4): 17(ptr) Variable UniformConstant + 22: TypeInt 32 0 + 23: 22(int) Constant 0 + 24: TypePointer Function 6(float) + 27: TypePointer UniformConstant 6(float) + 28(d4): 27(ptr) Variable UniformConstant + 30: TypeBool + 34: 6(float) Constant 1073741824 + 35: 22(int) Constant 2 + 48: 6(float) Constant 1065353216 + 51: 22(int) Constant 1 + 77: 22(int) Constant 3 + 80(d13): 27(ptr) Variable UniformConstant + 139: TypePointer Output 7(fvec4) +140(gl_FragColor): 139(ptr) Variable Output + 142(bigColor): 17(ptr) Variable UniformConstant +143(bigColor1_1): 17(ptr) Variable UniformConstant +144(bigColor1_2): 17(ptr) Variable UniformConstant +145(bigColor1_3): 17(ptr) Variable UniformConstant + 146(bigColor2): 17(ptr) Variable UniformConstant + 147(bigColor3): 17(ptr) Variable UniformConstant + 148(bigColor5): 17(ptr) Variable UniformConstant + 149(bigColor6): 17(ptr) Variable UniformConstant + 150(bigColor7): 17(ptr) Variable UniformConstant + 151(bigColor8): 17(ptr) Variable UniformConstant + 152(d): 27(ptr) Variable UniformConstant + 153(d2): 27(ptr) Variable UniformConstant + 154(d3): 27(ptr) Variable UniformConstant + 155(d5): 27(ptr) Variable UniformConstant + 156(d6): 27(ptr) Variable UniformConstant + 157(d7): 27(ptr) Variable UniformConstant + 158(d8): 27(ptr) Variable UniformConstant + 159(d9): 27(ptr) Variable UniformConstant + 160(d10): 27(ptr) Variable UniformConstant + 161(d11): 27(ptr) Variable UniformConstant + 162(d12): 27(ptr) Variable UniformConstant + 163(d14): 27(ptr) Variable UniformConstant + 164(d15): 27(ptr) Variable UniformConstant + 165(d16): 27(ptr) Variable UniformConstant + 166(d17): 27(ptr) Variable UniformConstant + 167(d18): 27(ptr) Variable UniformConstant + 168(d19): 27(ptr) Variable UniformConstant + 169(d20): 27(ptr) Variable UniformConstant + 170(d21): 27(ptr) Variable UniformConstant + 171(d22): 27(ptr) Variable UniformConstant + 172(d23): 27(ptr) Variable UniformConstant + 173(d24): 27(ptr) Variable UniformConstant + 174(d25): 27(ptr) Variable UniformConstant + 175(d26): 27(ptr) Variable UniformConstant + 176(d27): 27(ptr) Variable UniformConstant + 177(d28): 27(ptr) Variable UniformConstant + 178(d29): 27(ptr) Variable UniformConstant + 179(d30): 27(ptr) Variable UniformConstant + 180(d31): 27(ptr) Variable UniformConstant + 181(d32): 27(ptr) Variable UniformConstant + 182(d33): 27(ptr) Variable UniformConstant + 183(d34): 27(ptr) Variable UniformConstant + 184: TypeInt 32 1 + 185: TypePointer UniformConstant 184(int) + 186(Count): 185(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label 9(color): 8(ptr) Variable Function @@ -140,160 +140,162 @@ Linked fragment stage: Store 9(color) 12 Branch 13 13: Label - 18: 7(fvec4) Load 17(bigColor4) - 19: 7(fvec4) Load 9(color) - 20: 7(fvec4) FAdd 19 18 - Store 9(color) 20 - 24: 23(ptr) AccessChain 9(color) 22 - 25: 6(float) Load 24 - 28: 6(float) Load 27(d4) - 30: 29(bool) FOrdLessThan 25 28 - SelectionMerge 32 None - BranchConditional 30 31 32 - 14: Label - Branch 75 + LoopMerge 15 16 None + Branch 14 + 14: Label + 19: 7(fvec4) Load 18(bigColor4) + 20: 7(fvec4) Load 9(color) + 21: 7(fvec4) FAdd 20 19 + Store 9(color) 21 + 25: 24(ptr) AccessChain 9(color) 23 + 26: 6(float) Load 25 + 29: 6(float) Load 28(d4) + 31: 30(bool) FOrdLessThan 26 29 + SelectionMerge 33 None + BranchConditional 31 32 33 15: Label - 68: 23(ptr) AccessChain 9(color) 34 - 69: 6(float) Load 68 - 70: 6(float) Load 27(d4) - 71: 29(bool) FOrdLessThan 69 70 - LoopMerge 14 15 None - BranchConditional 71 13 14 - 31: Label - 35: 23(ptr) AccessChain 9(color) 34 - 36: 6(float) Load 35 - 37: 6(float) FAdd 36 33 - 38: 23(ptr) AccessChain 9(color) 34 - Store 38 37 - 39: 23(ptr) AccessChain 9(color) 34 - 40: 6(float) Load 39 - 41: 6(float) Load 27(d4) - 42: 29(bool) FOrdLessThan 40 41 - SelectionMerge 44 None - BranchConditional 42 43 44 - 43: Label - 45: 23(ptr) AccessChain 9(color) 22 - 46: 6(float) Load 45 - 48: 6(float) FAdd 46 47 - Store 45 48 - Branch 15 + Branch 73 + 16: Label + 69: 24(ptr) AccessChain 9(color) 35 + 70: 6(float) Load 69 + 71: 6(float) Load 28(d4) + 72: 30(bool) FOrdLessThan 70 71 + BranchConditional 72 13 15 + 32: Label + 36: 24(ptr) AccessChain 9(color) 35 + 37: 6(float) Load 36 + 38: 6(float) FAdd 37 34 + 39: 24(ptr) AccessChain 9(color) 35 + Store 39 38 + 40: 24(ptr) AccessChain 9(color) 35 + 41: 6(float) Load 40 + 42: 6(float) Load 28(d4) + 43: 30(bool) FOrdLessThan 41 42 + SelectionMerge 45 None + BranchConditional 43 44 45 44: Label - Branch 32 - 32: Label - 51: 23(ptr) AccessChain 9(color) 50 - 52: 6(float) Load 51 - 53: 6(float) Load 27(d4) - 54: 29(bool) FOrdLessThan 52 53 - SelectionMerge 56 None - BranchConditional 54 55 62 - 55: Label - 57: 6(float) Load 27(d4) - 58: 23(ptr) AccessChain 9(color) 50 - 59: 6(float) Load 58 - 60: 6(float) FAdd 59 57 - 61: 23(ptr) AccessChain 9(color) 50 - Store 61 60 - Branch 56 - 62: Label - 63: 6(float) Load 27(d4) - 64: 23(ptr) AccessChain 9(color) 22 - 65: 6(float) Load 64 - 66: 6(float) FAdd 65 63 - 67: 23(ptr) AccessChain 9(color) 22 - Store 67 66 - Branch 56 - 56: Label - Branch 15 - 72: Label - 82: 23(ptr) AccessChain 9(color) 34 - 83: 6(float) Load 82 - 84: 6(float) Load 79(d13) - 85: 29(bool) FOrdLessThan 83 84 - SelectionMerge 87 None - BranchConditional 85 86 91 - 73: Label - 135: 7(fvec4) Load 9(color) - 136: 7(fvec4) CompositeConstruct 47 47 47 47 - 137: 7(fvec4) FAdd 135 136 - Store 9(color) 137 - 140: 7(fvec4) Load 9(color) - Store 139(gl_FragColor) 140 - Return - 74: Label - Branch 75 - 75: Label - 77: 23(ptr) AccessChain 9(color) 76 - 78: 6(float) Load 77 - 80: 6(float) Load 79(d13) - 81: 29(bool) FOrdLessThan 78 80 - LoopMerge 73 74 None - BranchConditional 81 72 73 - 86: Label - 88: 7(fvec4) Load 9(color) - 89: 7(fvec4) CompositeConstruct 47 47 47 47 - 90: 7(fvec4) FAdd 88 89 - Store 9(color) 90 - Branch 87 - 91: Label - 92: 7(fvec4) Load 9(color) - 93: 7(fvec4) CompositeConstruct 47 47 47 47 - 94: 7(fvec4) FSub 92 93 - Store 9(color) 94 - Branch 87 - 87: Label - 95: 7(fvec4) Load 17(bigColor4) - 96: 7(fvec4) Load 9(color) - 97: 7(fvec4) FAdd 96 95 - Store 9(color) 97 - 98: 23(ptr) AccessChain 9(color) 22 - 99: 6(float) Load 98 - 100: 6(float) Load 27(d4) - 101: 29(bool) FOrdLessThan 99 100 - SelectionMerge 103 None - BranchConditional 101 102 103 - 102: Label - 104: 23(ptr) AccessChain 9(color) 34 - 105: 6(float) Load 104 - 106: 6(float) FAdd 105 33 - 107: 23(ptr) AccessChain 9(color) 34 - Store 107 106 - 108: 23(ptr) AccessChain 9(color) 34 - 109: 6(float) Load 108 - 110: 6(float) Load 27(d4) - 111: 29(bool) FOrdLessThan 109 110 - SelectionMerge 113 None - BranchConditional 111 112 113 - 112: Label - 114: 23(ptr) AccessChain 9(color) 22 - 115: 6(float) Load 114 - 116: 6(float) FAdd 115 47 - Store 114 116 - Branch 74 - 113: Label - Branch 103 - 103: Label - 118: 23(ptr) AccessChain 9(color) 50 - 119: 6(float) Load 118 - 120: 6(float) Load 27(d4) - 121: 29(bool) FOrdLessThan 119 120 - SelectionMerge 123 None - BranchConditional 121 122 129 - 122: Label - 124: 6(float) Load 27(d4) - 125: 23(ptr) AccessChain 9(color) 50 - 126: 6(float) Load 125 - 127: 6(float) FAdd 126 124 - 128: 23(ptr) AccessChain 9(color) 50 - Store 128 127 - Branch 123 - 129: Label - 130: 6(float) Load 27(d4) - 131: 23(ptr) AccessChain 9(color) 22 - 132: 6(float) Load 131 - 133: 6(float) FAdd 132 130 - 134: 23(ptr) AccessChain 9(color) 22 - Store 134 133 - Branch 123 - 123: Label - Branch 74 - FunctionEnd + 46: 24(ptr) AccessChain 9(color) 23 + 47: 6(float) Load 46 + 49: 6(float) FAdd 47 48 + Store 46 49 + Branch 16 + 45: Label + Branch 33 + 33: Label + 52: 24(ptr) AccessChain 9(color) 51 + 53: 6(float) Load 52 + 54: 6(float) Load 28(d4) + 55: 30(bool) FOrdLessThan 53 54 + SelectionMerge 57 None + BranchConditional 55 56 63 + 56: Label + 58: 6(float) Load 28(d4) + 59: 24(ptr) AccessChain 9(color) 51 + 60: 6(float) Load 59 + 61: 6(float) FAdd 60 58 + 62: 24(ptr) AccessChain 9(color) 51 + Store 62 61 + Branch 57 + 63: Label + 64: 6(float) Load 28(d4) + 65: 24(ptr) AccessChain 9(color) 23 + 66: 6(float) Load 65 + 67: 6(float) FAdd 66 64 + 68: 24(ptr) AccessChain 9(color) 23 + Store 68 67 + Branch 57 + 57: Label + Branch 16 + 73: Label + 78: 24(ptr) AccessChain 9(color) 77 + 79: 6(float) Load 78 + 81: 6(float) Load 80(d13) + 82: 30(bool) FOrdLessThan 79 81 + LoopMerge 75 76 None + BranchConditional 82 74 75 + 74: Label + 83: 24(ptr) AccessChain 9(color) 35 + 84: 6(float) Load 83 + 85: 6(float) Load 80(d13) + 86: 30(bool) FOrdLessThan 84 85 + SelectionMerge 88 None + BranchConditional 86 87 92 + 75: Label + 136: 7(fvec4) Load 9(color) + 137: 7(fvec4) CompositeConstruct 48 48 48 48 + 138: 7(fvec4) FAdd 136 137 + Store 9(color) 138 + 141: 7(fvec4) Load 9(color) + Store 140(gl_FragColor) 141 + Return + 76: Label + Branch 73 + 87: Label + 89: 7(fvec4) Load 9(color) + 90: 7(fvec4) CompositeConstruct 48 48 48 48 + 91: 7(fvec4) FAdd 89 90 + Store 9(color) 91 + Branch 88 + 92: Label + 93: 7(fvec4) Load 9(color) + 94: 7(fvec4) CompositeConstruct 48 48 48 48 + 95: 7(fvec4) FSub 93 94 + Store 9(color) 95 + Branch 88 + 88: Label + 96: 7(fvec4) Load 18(bigColor4) + 97: 7(fvec4) Load 9(color) + 98: 7(fvec4) FAdd 97 96 + Store 9(color) 98 + 99: 24(ptr) AccessChain 9(color) 23 + 100: 6(float) Load 99 + 101: 6(float) Load 28(d4) + 102: 30(bool) FOrdLessThan 100 101 + SelectionMerge 104 None + BranchConditional 102 103 104 + 103: Label + 105: 24(ptr) AccessChain 9(color) 35 + 106: 6(float) Load 105 + 107: 6(float) FAdd 106 34 + 108: 24(ptr) AccessChain 9(color) 35 + Store 108 107 + 109: 24(ptr) AccessChain 9(color) 35 + 110: 6(float) Load 109 + 111: 6(float) Load 28(d4) + 112: 30(bool) FOrdLessThan 110 111 + SelectionMerge 114 None + BranchConditional 112 113 114 + 113: Label + 115: 24(ptr) AccessChain 9(color) 23 + 116: 6(float) Load 115 + 117: 6(float) FAdd 116 48 + Store 115 117 + Branch 76 + 114: Label + Branch 104 + 104: Label + 119: 24(ptr) AccessChain 9(color) 51 + 120: 6(float) Load 119 + 121: 6(float) Load 28(d4) + 122: 30(bool) FOrdLessThan 120 121 + SelectionMerge 124 None + BranchConditional 122 123 130 + 123: Label + 125: 6(float) Load 28(d4) + 126: 24(ptr) AccessChain 9(color) 51 + 127: 6(float) Load 126 + 128: 6(float) FAdd 127 125 + 129: 24(ptr) AccessChain 9(color) 51 + Store 129 128 + Branch 124 + 130: Label + 131: 6(float) Load 28(d4) + 132: 24(ptr) AccessChain 9(color) 23 + 133: 6(float) Load 132 + 134: 6(float) FAdd 133 131 + 135: 24(ptr) AccessChain 9(color) 23 + Store 135 134 + Branch 124 + 124: Label + Branch 76 + FunctionEnd diff --git a/Test/baseResults/spv.switch.frag.out b/Test/baseResults/spv.switch.frag.out index bc91acc5..fa7d6a54 100755 --- a/Test/baseResults/spv.switch.frag.out +++ b/Test/baseResults/spv.switch.frag.out @@ -216,29 +216,29 @@ Linked fragment stage: Branch 121 121: Label Store 153(i) 154 - Branch 158 + Branch 155 155: Label - 163: 9(int) Load 60(c) - SelectionMerge 167 None - Switch 163 166 - case 1: 164 - case 2: 165 + 159: 9(int) Load 153(i) + 162: 161(bool) SLessThan 159 160 + LoopMerge 157 158 None + BranchConditional 162 156 157 156: Label - 211: 9(int) Load 60(c) - SelectionMerge 214 None - Switch 211 214 - case 1: 212 - case 2: 213 + 163: 9(int) Load 60(c) + SelectionMerge 167 None + Switch 163 166 + case 1: 164 + case 2: 165 157: Label - 209: 9(int) Load 153(i) - 210: 9(int) IAdd 209 63 - Store 153(i) 210 - Branch 158 - 158: Label - 159: 9(int) Load 153(i) - 162: 161(bool) SLessThan 159 160 - LoopMerge 156 157 None - BranchConditional 162 155 156 + 211: 9(int) Load 60(c) + SelectionMerge 214 None + Switch 211 214 + case 1: 212 + case 2: 213 + 158: Label + 209: 9(int) Load 153(i) + 210: 9(int) IAdd 209 63 + Store 153(i) 210 + Branch 155 164: Label 168: 6(float) Load 73(x) 169: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 168 @@ -246,159 +246,159 @@ Linked fragment stage: 171: 6(float) FAdd 170 169 Store 71(f) 171 Store 172(j) 173 - Branch 177 + Branch 174 174: Label - 181: 6(float) Load 71(f) - 182: 6(float) FAdd 181 47 - Store 71(f) 182 - 183: 6(float) Load 71(f) - 185: 161(bool) FOrdLessThan 183 184 - SelectionMerge 187 None - BranchConditional 185 186 187 + 178: 9(int) Load 172(j) + 180: 161(bool) SLessThan 178 179 + LoopMerge 176 177 None + BranchConditional 180 175 176 175: Label - Branch 167 - 176: Label - 189: 9(int) Load 172(j) - 190: 9(int) IAdd 189 63 - Store 172(j) 190 - Branch 177 - 177: Label - 178: 9(int) Load 172(j) - 180: 161(bool) SLessThan 178 179 - LoopMerge 175 176 None - BranchConditional 180 174 175 + 181: 6(float) Load 71(f) + 182: 6(float) FAdd 181 47 + Store 71(f) 182 + 183: 6(float) Load 71(f) + 185: 161(bool) FOrdLessThan 183 184 + SelectionMerge 187 None + BranchConditional 185 186 187 + 176: Label + Branch 167 + 177: Label + 189: 9(int) Load 172(j) + 190: 9(int) IAdd 189 63 + Store 172(j) 190 + Branch 174 186: Label - Branch 175 - 187: Label Branch 176 - 165: Label - 192: 6(float) Load 73(x) - 193: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 192 - 194: 6(float) Load 71(f) - 195: 6(float) FAdd 194 193 - Store 71(f) 195 - Branch 167 - 166: Label - 198: 6(float) Load 73(x) - 199: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 198 - 200: 6(float) Load 71(f) - 201: 6(float) FAdd 200 199 - Store 71(f) 201 - Branch 167 - 167: Label - 203: 6(float) Load 71(f) - 205: 161(bool) FOrdLessThan 203 204 - SelectionMerge 207 None - BranchConditional 205 206 207 - 206: Label - Branch 156 - 207: Label + 187: Label + Branch 177 + 165: Label + 192: 6(float) Load 73(x) + 193: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 192 + 194: 6(float) Load 71(f) + 195: 6(float) FAdd 194 193 + Store 71(f) 195 + Branch 167 + 166: Label + 198: 6(float) Load 73(x) + 199: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 198 + 200: 6(float) Load 71(f) + 201: 6(float) FAdd 200 199 + Store 71(f) 201 + Branch 167 + 167: Label + 203: 6(float) Load 71(f) + 205: 161(bool) FOrdLessThan 203 204 + SelectionMerge 207 None + BranchConditional 205 206 207 + 206: Label Branch 157 - 212: Label - 215: 6(float) Load 73(x) - 216: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 215 - 217: 6(float) Load 71(f) - 218: 6(float) FAdd 217 216 - Store 71(f) 218 - Branch 214 - 213: Label - Branch 214 - 214: Label - 224: 6(float) Load 71(f) - 225: 9(int) Load 58(local) - 226: 6(float) ConvertSToF 225 - 227: 6(float) FAdd 224 226 - Store 223(color) 227 - 231: 7(fvec4) Load 229(v) - Store 230(param) 231 - 233: 7(fvec4) Load 229(v) - Store 232(param) 233 - 235: 9(int) Load 60(c) - Store 234(param) 235 - 236: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 230(param) 232(param) 234(param) - 239: 6(float) CompositeExtract 236 1 - 240: 6(float) Load 223(color) - 241: 6(float) FAdd 240 239 - Store 223(color) 241 - 243: 7(fvec4) Load 229(v) - Store 242(param) 243 - 245: 7(fvec4) Load 229(v) - Store 244(param) 245 - 247: 9(int) Load 60(c) - Store 246(param) 247 - 248: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 242(param) 244(param) 246(param) - 250: 6(float) CompositeExtract 248 2 - 251: 6(float) Load 223(color) - 252: 6(float) FAdd 251 250 - Store 223(color) 252 - 253: 9(int) Load 60(c) - SelectionMerge 256 None - Switch 253 255 - case 0: 254 - 254: Label - Branch 256 - 255: Label - Branch 256 - 256: Label - 260: 9(int) Load 60(c) - SelectionMerge 262 None - Switch 260 261 - 261: Label - Branch 262 - 262: Label - Return - FunctionEnd -15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 - 12(v1): 8(ptr) FunctionParameter - 13(v2): 8(ptr) FunctionParameter - 14(i1): 10(ptr) FunctionParameter - 16: Label - 22: 9(int) Load 14(i1) - SelectionMerge 26 None - Switch 22 26 - case 0: 23 - case 2: 24 - case 1: 24 - case 3: 25 - 23: Label - 27: 7(fvec4) Load 12(v1) - ReturnValue 27 - 24: Label - 29: 7(fvec4) Load 13(v2) - ReturnValue 29 - 25: Label - 31: 7(fvec4) Load 12(v1) - 32: 7(fvec4) Load 13(v2) - 33: 7(fvec4) FMul 31 32 - ReturnValue 33 - 26: Label - ReturnValue 37 - FunctionEnd -20(foo2(vf4;vf4;i1;): 7(fvec4) Function None 11 - 17(v1): 8(ptr) FunctionParameter - 18(v2): 8(ptr) FunctionParameter - 19(i1): 10(ptr) FunctionParameter - 21: Label - 39: 9(int) Load 19(i1) - SelectionMerge 44 None - Switch 39 44 - case 0: 40 - case 2: 41 - case 1: 42 - case 3: 43 - 40: Label - 45: 7(fvec4) Load 17(v1) - ReturnValue 45 - 41: Label - ReturnValue 48 - 42: Label - 50: 7(fvec4) Load 18(v2) - ReturnValue 50 - 43: Label - 52: 7(fvec4) Load 17(v1) - 53: 7(fvec4) Load 18(v2) - 54: 7(fvec4) FMul 52 53 - ReturnValue 54 - 44: Label - ReturnValue 37 - FunctionEnd + 207: Label + Branch 158 + 212: Label + 215: 6(float) Load 73(x) + 216: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 215 + 217: 6(float) Load 71(f) + 218: 6(float) FAdd 217 216 + Store 71(f) 218 + Branch 214 + 213: Label + Branch 214 + 214: Label + 224: 6(float) Load 71(f) + 225: 9(int) Load 58(local) + 226: 6(float) ConvertSToF 225 + 227: 6(float) FAdd 224 226 + Store 223(color) 227 + 231: 7(fvec4) Load 229(v) + Store 230(param) 231 + 233: 7(fvec4) Load 229(v) + Store 232(param) 233 + 235: 9(int) Load 60(c) + Store 234(param) 235 + 236: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 230(param) 232(param) 234(param) + 239: 6(float) CompositeExtract 236 1 + 240: 6(float) Load 223(color) + 241: 6(float) FAdd 240 239 + Store 223(color) 241 + 243: 7(fvec4) Load 229(v) + Store 242(param) 243 + 245: 7(fvec4) Load 229(v) + Store 244(param) 245 + 247: 9(int) Load 60(c) + Store 246(param) 247 + 248: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 242(param) 244(param) 246(param) + 250: 6(float) CompositeExtract 248 2 + 251: 6(float) Load 223(color) + 252: 6(float) FAdd 251 250 + Store 223(color) 252 + 253: 9(int) Load 60(c) + SelectionMerge 256 None + Switch 253 255 + case 0: 254 + 254: Label + Branch 256 + 255: Label + Branch 256 + 256: Label + 260: 9(int) Load 60(c) + SelectionMerge 262 None + Switch 260 261 + 261: Label + Branch 262 + 262: Label + Return + FunctionEnd +15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 + 12(v1): 8(ptr) FunctionParameter + 13(v2): 8(ptr) FunctionParameter + 14(i1): 10(ptr) FunctionParameter + 16: Label + 22: 9(int) Load 14(i1) + SelectionMerge 26 None + Switch 22 26 + case 0: 23 + case 2: 24 + case 1: 24 + case 3: 25 + 23: Label + 27: 7(fvec4) Load 12(v1) + ReturnValue 27 + 24: Label + 29: 7(fvec4) Load 13(v2) + ReturnValue 29 + 25: Label + 31: 7(fvec4) Load 12(v1) + 32: 7(fvec4) Load 13(v2) + 33: 7(fvec4) FMul 31 32 + ReturnValue 33 + 26: Label + ReturnValue 37 + FunctionEnd +20(foo2(vf4;vf4;i1;): 7(fvec4) Function None 11 + 17(v1): 8(ptr) FunctionParameter + 18(v2): 8(ptr) FunctionParameter + 19(i1): 10(ptr) FunctionParameter + 21: Label + 39: 9(int) Load 19(i1) + SelectionMerge 44 None + Switch 39 44 + case 0: 40 + case 2: 41 + case 1: 42 + case 3: 43 + 40: Label + 45: 7(fvec4) Load 17(v1) + ReturnValue 45 + 41: Label + ReturnValue 48 + 42: Label + 50: 7(fvec4) Load 18(v2) + ReturnValue 50 + 43: Label + 52: 7(fvec4) Load 17(v1) + 53: 7(fvec4) Load 18(v2) + 54: 7(fvec4) FMul 52 53 + ReturnValue 54 + 44: Label + ReturnValue 37 + FunctionEnd diff --git a/Test/baseResults/spv.while-continue-break.vert.out b/Test/baseResults/spv.while-continue-break.vert.out index 0938db43..684f4526 100755 --- a/Test/baseResults/spv.while-continue-break.vert.out +++ b/Test/baseResults/spv.while-continue-break.vert.out @@ -44,45 +44,45 @@ Linked vertex stage: 28(C): 7(ptr) Variable Function 38(D): 7(ptr) Variable Function Store 8(i) 9 - Branch 13 + Branch 10 10: Label - Store 18(A) 19 - 20: 6(int) Load 8(i) - 22: 6(int) SMod 20 21 - 23: 16(bool) IEqual 22 9 - SelectionMerge 25 None - BranchConditional 23 24 25 + 14: 6(int) Load 8(i) + 17: 16(bool) SLessThan 14 15 + LoopMerge 12 13 None + BranchConditional 17 11 12 11: Label - Store 38(D) 39 - Return - 12: Label - Branch 13 - 13: Label - 14: 6(int) Load 8(i) - 17: 16(bool) SLessThan 14 15 - LoopMerge 11 12 None - BranchConditional 17 10 11 + Store 18(A) 19 + 20: 6(int) Load 8(i) + 22: 6(int) SMod 20 21 + 23: 16(bool) IEqual 22 9 + SelectionMerge 25 None + BranchConditional 23 24 25 + 12: Label + Store 38(D) 39 + Return + 13: Label + Branch 10 24: Label Store 26(B) 21 - Branch 12 + Branch 13 27: Label Store 28(C) 21 Branch 25 - 25: Label - 29: 6(int) Load 8(i) - 31: 6(int) SMod 29 30 - 32: 16(bool) IEqual 31 9 - SelectionMerge 34 None - BranchConditional 32 33 34 - 33: Label - Store 26(B) 21 - Branch 11 - 35: Label - Store 28(C) 21 - Branch 34 - 34: Label - 36: 6(int) Load 8(i) - 37: 6(int) IAdd 36 19 - Store 8(i) 37 + 25: Label + 29: 6(int) Load 8(i) + 31: 6(int) SMod 29 30 + 32: 16(bool) IEqual 31 9 + SelectionMerge 34 None + BranchConditional 32 33 34 + 33: Label + Store 26(B) 21 Branch 12 - FunctionEnd + 35: Label + Store 28(C) 21 + Branch 34 + 34: Label + 36: 6(int) Load 8(i) + 37: 6(int) IAdd 36 19 + Store 8(i) 37 + Branch 13 + FunctionEnd diff --git a/Test/baseResults/spv.while-simple.vert.out b/Test/baseResults/spv.while-simple.vert.out index 3684101c..63656537 100755 --- a/Test/baseResults/spv.while-simple.vert.out +++ b/Test/baseResults/spv.while-simple.vert.out @@ -33,19 +33,19 @@ Linked vertex stage: 5: Label 8(i): 7(ptr) Variable Function Store 8(i) 9 - Branch 13 + Branch 10 10: Label - 18: 6(int) Load 8(i) - 20: 6(int) IAdd 18 19 - Store 8(i) 20 - Branch 12 - 11: Label - Return - 12: Label - Branch 13 - 13: Label 14: 6(int) Load 8(i) 17: 16(bool) SLessThan 14 15 - LoopMerge 11 12 None - BranchConditional 17 10 11 - FunctionEnd + LoopMerge 12 13 None + BranchConditional 17 11 12 + 11: Label + 18: 6(int) Load 8(i) + 20: 6(int) IAdd 18 19 + Store 8(i) 20 + Branch 13 + 12: Label + Return + 13: Label + Branch 10 + FunctionEnd diff --git a/Test/baseResults/spv.whileLoop.frag.out b/Test/baseResults/spv.whileLoop.frag.out index 62279827..e5c9642e 100755 --- a/Test/baseResults/spv.whileLoop.frag.out +++ b/Test/baseResults/spv.whileLoop.frag.out @@ -41,24 +41,24 @@ Linked fragment stage: 9(color): 8(ptr) Variable Function 12: 7(fvec4) Load 11(BaseColor) Store 9(color) 12 - Branch 16 + Branch 13 13: Label - 29: 7(fvec4) Load 28(bigColor) - 30: 7(fvec4) Load 9(color) - 31: 7(fvec4) FAdd 30 29 - Store 9(color) 31 - Branch 15 - 14: Label - 34: 7(fvec4) Load 9(color) - Store 33(gl_FragColor) 34 - Return - 15: Label - Branch 16 - 16: Label 20: 19(ptr) AccessChain 9(color) 18 21: 6(float) Load 20 24: 6(float) Load 23(d) 26: 25(bool) FOrdLessThan 21 24 - LoopMerge 14 15 None - BranchConditional 26 13 14 - FunctionEnd + LoopMerge 15 16 None + BranchConditional 26 14 15 + 14: Label + 29: 7(fvec4) Load 28(bigColor) + 30: 7(fvec4) Load 9(color) + 31: 7(fvec4) FAdd 30 29 + Store 9(color) 31 + Branch 16 + 15: Label + 34: 7(fvec4) Load 9(color) + Store 33(gl_FragColor) 34 + Return + 16: Label + Branch 13 + FunctionEnd diff --git a/Test/spv.for-notest.vert b/Test/spv.for-notest.vert index f40e6664..7aff3b30 100644 --- a/Test/spv.for-notest.vert +++ b/Test/spv.for-notest.vert @@ -2,5 +2,8 @@ layout(location=0) out highp int r; void main() { int i; + // This infinite loop results in bad SPIR-V generated, since the merge block + // is dropped as unreachable. It is still useful for testing the rest of the + // code generation. for (i=0; ; i++) { r = i; } } From f3c63cc35923b06c7a5c5e4be3fa0c728ab5f5e7 Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 16:56:45 -0500 Subject: [PATCH 7/7] Move continue-block to after all branches. --- SPIRV/InReadableOrder.cpp | 16 +++++++-- .../spv.do-while-continue-break.vert.out | 12 +++---- .../spv.for-continue-break.vert.out | 10 +++--- Test/baseResults/spv.loops.frag.out | 36 ++++++++++--------- Test/baseResults/spv.loopsArtificial.frag.out | 16 ++++----- .../spv.while-continue-break.vert.out | 4 +-- 6 files changed, 54 insertions(+), 40 deletions(-) diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp index 4eb56d64..9180dc8c 100644 --- a/SPIRV/InReadableOrder.cpp +++ b/SPIRV/InReadableOrder.cpp @@ -67,8 +67,9 @@ class ReadableOrderTraverser { public: explicit ReadableOrderTraverser(std::function callback) : callback_(callback) {} // Visits the block if it hasn't been visited already and isn't currently - // being delayed. Invokes callback(block), then descends into its successors. - // Delays merge-block processing until all the branches have been completed. + // being delayed. Invokes callback(block), then descends into its + // successors. Delays merge-block and continue-block processing until all + // the branches have been completed. void visit(Block* block) { assert(block); @@ -77,14 +78,25 @@ public: callback_(block); visited_[block] = true; Block* mergeBlock = nullptr; + Block* continueBlock = nullptr; auto mergeInst = block->getMergeInstruction(); if (mergeInst) { Id mergeId = mergeInst->getIdOperand(0); mergeBlock = block->getParent().getParent().getInstruction(mergeId)->getBlock(); delayed_[mergeBlock] = true; + if (mergeInst->getOpCode() == spv::OpLoopMerge) { + Id continueId = mergeInst->getIdOperand(1); + continueBlock = + block->getParent().getParent().getInstruction(continueId)->getBlock(); + delayed_[continueBlock] = true; + } } for (const auto succ : block->getSuccessors()) visit(succ); + if (continueBlock) { + delayed_[continueBlock] = false; + visit(continueBlock); + } if (mergeBlock) { delayed_[mergeBlock] = false; visit(mergeBlock); diff --git a/Test/baseResults/spv.do-while-continue-break.vert.out b/Test/baseResults/spv.do-while-continue-break.vert.out index 1b5ff62b..c8f0b2f9 100644 --- a/Test/baseResults/spv.do-while-continue-break.vert.out +++ b/Test/baseResults/spv.do-while-continue-break.vert.out @@ -66,12 +66,6 @@ Linked vertex stage: 19: Label Store 21(B) 22 Branch 13 - 13: Label - 37: 6(int) Load 8(i) - 38: 6(int) IAdd 37 22 - Store 8(i) 38 - 40: 17(bool) SLessThan 38 39 - BranchConditional 40 10 12 20: Label 25: 6(int) Load 8(i) 27: 17(bool) IEqual 25 26 @@ -83,6 +77,12 @@ Linked vertex stage: 29: Label Store 35(F) 36 Branch 13 + 13: Label + 37: 6(int) Load 8(i) + 38: 6(int) IAdd 37 22 + Store 8(i) 38 + 40: 17(bool) SLessThan 38 39 + BranchConditional 40 10 12 12: Label Store 41(G) 42 Return diff --git a/Test/baseResults/spv.for-continue-break.vert.out b/Test/baseResults/spv.for-continue-break.vert.out index 6aaf82a3..33c61386 100644 --- a/Test/baseResults/spv.for-continue-break.vert.out +++ b/Test/baseResults/spv.for-continue-break.vert.out @@ -67,11 +67,6 @@ Linked vertex stage: 24: Label Store 26(B) 19 Branch 13 - 13: Label - 40: 6(int) Load 8(i) - 41: 6(int) IAdd 40 19 - Store 8(i) 41 - Branch 10 25: Label 29: 6(int) Load 8(i) 31: 6(int) SMod 29 30 @@ -84,6 +79,11 @@ Linked vertex stage: 34: Label Store 38(F) 39 Branch 13 + 13: Label + 40: 6(int) Load 8(i) + 41: 6(int) IAdd 40 19 + Store 8(i) 41 + Branch 10 12: Label Store 42(G) 43 Return diff --git a/Test/baseResults/spv.loops.frag.out b/Test/baseResults/spv.loops.frag.out index a4556933..98d2878b 100755 --- a/Test/baseResults/spv.loops.frag.out +++ b/Test/baseResults/spv.loops.frag.out @@ -197,6 +197,8 @@ Linked fragment stage: 43: 7(fvec4) FAdd 42 28 Store 9(color) 43 Branch 15 + 16: Label + Branch 13 15: Label Branch 45 45: Label @@ -236,14 +238,14 @@ Linked fragment stage: BranchConditional 77 78 79 78: Label Branch 63 - 63: Label - Branch 60 79: Label 81: 7(fvec4) Load 69(bigColor1_1) 82: 7(fvec4) Load 9(color) 83: 7(fvec4) FAdd 82 81 Store 9(color) 83 Branch 63 + 63: Label + Branch 60 62: Label Branch 84 84: Label @@ -482,17 +484,17 @@ Linked fragment stage: BranchConditional 260 261 262 261: Label Branch 249 - 249: Label - 267: 141(int) Load 245(i) - 268: 141(int) IAdd 267 159 - Store 245(i) 268 - Branch 246 262: Label 264: 21(ptr) AccessChain 9(color) 73 265: 6(float) Load 264 266: 6(float) FAdd 265 93 Store 264 266 Branch 249 + 249: Label + 267: 141(int) Load 245(i) + 268: 141(int) IAdd 267 159 + Store 245(i) 268 + Branch 246 248: Label Store 269(i) 144 Branch 270 @@ -545,12 +547,6 @@ Linked fragment stage: BranchConditional 304 305 306 305: Label Branch 296 - 296: Label - 325: 21(ptr) AccessChain 9(color) 64 - 326: 6(float) Load 325 - 327: 6(float) Load 132(d4) - 328: 17(bool) FOrdLessThan 326 327 - BranchConditional 328 293 295 306: Label 308: 21(ptr) AccessChain 9(color) 107 309: 6(float) Load 308 @@ -576,6 +572,12 @@ Linked fragment stage: Branch 313 313: Label Branch 296 + 296: Label + 325: 21(ptr) AccessChain 9(color) 64 + 326: 6(float) Load 325 + 327: 6(float) Load 132(d4) + 328: 17(bool) FOrdLessThan 326 327 + BranchConditional 328 293 295 295: Label Branch 329 329: Label @@ -891,14 +893,14 @@ Linked fragment stage: Branch 549 549: Label Branch 524 - 524: Label - Branch 521 539: Label 558: 7(fvec4) Load 9(color) 559: 7(fvec4) CompositeConstruct 93 93 93 93 560: 7(fvec4) FAdd 558 559 Store 9(color) 560 Branch 523 + 524: Label + Branch 521 523: Label Branch 562 562: Label @@ -927,8 +929,6 @@ Linked fragment stage: BranchConditional 583 584 585 584: Label Branch 565 - 565: Label - Branch 562 585: Label Branch 579 579: Label @@ -940,6 +940,8 @@ Linked fragment stage: 592: 21(ptr) AccessChain 9(color) 107 Store 592 591 Branch 565 + 565: Label + Branch 562 564: Label 593: 7(fvec4) Load 9(color) 594: 7(fvec4) CompositeConstruct 93 93 93 93 diff --git a/Test/baseResults/spv.loopsArtificial.frag.out b/Test/baseResults/spv.loopsArtificial.frag.out index dd700ca0..e1bf0859 100755 --- a/Test/baseResults/spv.loopsArtificial.frag.out +++ b/Test/baseResults/spv.loopsArtificial.frag.out @@ -171,12 +171,6 @@ Linked fragment stage: 49: 6(float) FAdd 47 48 Store 46 49 Branch 16 - 16: Label - 69: 24(ptr) AccessChain 9(color) 35 - 70: 6(float) Load 69 - 71: 6(float) Load 28(d4) - 72: 30(bool) FOrdLessThan 70 71 - BranchConditional 72 13 15 45: Label Branch 33 33: Label @@ -204,6 +198,12 @@ Linked fragment stage: Branch 57 57: Label Branch 16 + 16: Label + 69: 24(ptr) AccessChain 9(color) 35 + 70: 6(float) Load 69 + 71: 6(float) Load 28(d4) + 72: 30(bool) FOrdLessThan 70 71 + BranchConditional 72 13 15 15: Label Branch 73 73: Label @@ -261,8 +261,6 @@ Linked fragment stage: 117: 6(float) FAdd 116 48 Store 115 117 Branch 76 - 76: Label - Branch 73 114: Label Branch 104 104: Label @@ -290,6 +288,8 @@ Linked fragment stage: Branch 124 124: Label Branch 76 + 76: Label + Branch 73 75: Label 136: 7(fvec4) Load 9(color) 137: 7(fvec4) CompositeConstruct 48 48 48 48 diff --git a/Test/baseResults/spv.while-continue-break.vert.out b/Test/baseResults/spv.while-continue-break.vert.out index 3f13b7c8..aedd4371 100644 --- a/Test/baseResults/spv.while-continue-break.vert.out +++ b/Test/baseResults/spv.while-continue-break.vert.out @@ -60,8 +60,6 @@ Linked vertex stage: 24: Label Store 26(B) 21 Branch 13 - 13: Label - Branch 10 25: Label 29: 6(int) Load 8(i) 31: 6(int) SMod 29 30 @@ -76,6 +74,8 @@ Linked vertex stage: 37: 6(int) IAdd 36 19 Store 8(i) 37 Branch 13 + 13: Label + Branch 10 12: Label Store 38(D) 39 Return