Commit ac4b37b3 by John Kessenich

Merge branch GitHub 'master' into GitLab master

parents 73d60135 33782795
...@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8) ...@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8)
set(SOURCES set(SOURCES
GlslangToSpv.cpp GlslangToSpv.cpp
InReadableOrder.cpp
SpvBuilder.cpp SpvBuilder.cpp
SPVRemapper.cpp SPVRemapper.cpp
doc.cpp doc.cpp
......
...@@ -144,7 +144,6 @@ protected: ...@@ -144,7 +144,6 @@ protected:
std::unordered_map<const glslang::TTypeList*, spv::Id> structMap[glslang::ElpCount][glslang::ElmCount]; std::unordered_map<const glslang::TTypeList*, spv::Id> structMap[glslang::ElpCount][glslang::ElmCount];
std::unordered_map<const glslang::TTypeList*, std::vector<int> > memberRemapper; // for mapping glslang block indices to spv indices (e.g., due to hidden members) std::unordered_map<const glslang::TTypeList*, std::vector<int> > memberRemapper; // for mapping glslang block indices to spv indices (e.g., due to hidden members)
std::stack<bool> breakForLoop; // false means break for switch std::stack<bool> breakForLoop; // false means break for switch
std::stack<glslang::TIntermTyped*> loopTerminal; // code from the last part of a for loop: for(...; ...; terminal), needed for e.g., continue };
}; };
// //
...@@ -1390,33 +1389,63 @@ void TGlslangToSpvTraverser::visitConstantUnion(glslang::TIntermConstantUnion* n ...@@ -1390,33 +1389,63 @@ void TGlslangToSpvTraverser::visitConstantUnion(glslang::TIntermConstantUnion* n
bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIntermLoop* node) 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" auto blocks = builder.makeNewLoop();
loopTerminal.push(node->getTerminal()); builder.createBranch(&blocks.head);
if (node->testFirst() && node->getTest()) {
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);
builder.makeNewLoop(node->testFirst()); builder.setBuildPoint(&blocks.body);
breakForLoop.push(true);
if (node->getBody())
node->getBody()->traverse(this);
builder.createBranch(&blocks.continue_target);
breakForLoop.pop();
if (node->getTest()) { builder.setBuildPoint(&blocks.continue_target);
node->getTest()->traverse(this); if (node->getTerminal())
// the AST only contained the test computation, not the branch, we have to add it node->getTerminal()->traverse(this);
spv::Id condition = builder.accessChainLoad(convertGlslangToSpvType(node->getTest()->getType())); builder.createBranch(&blocks.head);
builder.createLoopTestBranch(condition);
} else { } else {
builder.createBranchToBody(); // 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);
if (node->getBody()) {
breakForLoop.push(true); breakForLoop.push(true);
node->getBody()->traverse(this); builder.setBuildPoint(&blocks.body);
if (node->getBody())
node->getBody()->traverse(this);
builder.createBranch(&blocks.continue_target);
breakForLoop.pop(); breakForLoop.pop();
}
if (loopTerminal.top())
loopTerminal.top()->traverse(this);
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.createConditionalBranch(condition, &blocks.head, &blocks.merge);
} else {
// 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(); builder.closeLoop();
loopTerminal.pop();
return false; return false;
} }
...@@ -1436,8 +1465,6 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T ...@@ -1436,8 +1465,6 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T
builder.addSwitchBreak(); builder.addSwitchBreak();
break; break;
case glslang::EOpContinue: case glslang::EOpContinue:
if (loopTerminal.top())
loopTerminal.top()->traverse(this);
builder.createLoopContinue(); builder.createLoopContinue();
break; break;
case glslang::EOpReturn: case glslang::EOpReturn:
......
//
//Copyright (C) 2016 Google, Inc.
//
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions
//are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
//POSSIBILITY OF SUCH DAMAGE.
//
// Author: Dejan Mircevski, Google
//
// The SPIR-V spec requires code blocks to appear in an order satisfying the
// dominator-tree direction (ie, dominator before the dominated). This is,
// actually, easy to achieve: any pre-order CFG traversal algorithm will do it.
// Because such algorithms visit a block only after traversing some path to it
// from the root, they necessarily visit the block's idom first.
//
// But not every graph-traversal algorithm outputs blocks in an order that
// appears logical to human readers. The problem is that unrelated branches may
// be interspersed with each other, and merge blocks may come before some of the
// branches being merged.
//
// A good, human-readable order of blocks may be achieved by performing
// depth-first search but delaying merge nodes until after all their branches
// have been visited. This is implemented below by the inReadableOrder()
// function.
#include "spvIR.h"
#include <cassert>
#include <unordered_map>
using spv::Block;
using spv::Id;
namespace {
// Traverses CFG in a readable order, invoking a pre-set callback on each block.
// Use by calling visit() on the root block.
class ReadableOrderTraverser {
public:
explicit ReadableOrderTraverser(std::function<void(Block*)> 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 and continue-block processing until all
// the branches have been completed.
void visit(Block* block)
{
assert(block);
if (visited_[block] || delayed_[block])
return;
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);
}
}
private:
std::function<void(Block*)> callback_;
// Whether a block has already been visited or is being delayed.
std::unordered_map<Block *, bool> visited_, delayed_;
};
}
void spv::inReadableOrder(Block* root, std::function<void(Block*)> callback)
{
ReadableOrderTraverser(callback).visit(root);
}
...@@ -857,12 +857,12 @@ void Builder::leaveFunction() ...@@ -857,12 +857,12 @@ void Builder::leaveFunction()
if (! block->isTerminated()) { if (! block->isTerminated()) {
// Whether we're in an unreachable (non-entry) block. // Whether we're in an unreachable (non-entry) block.
bool unreachable = function.getEntryBlock() != block && block->getNumPredecessors() == 0; bool unreachable = function.getEntryBlock() != block && block->getPredecessors().empty();
if (unreachable) { if (unreachable) {
// Given that this block is at the end of a function, it must be right after an // Given that this block is at the end of a function, it must be right after an
// explicit return, just remove it. // explicit return, just remove it.
function.popBlock(block); function.removeBlock(block);
} else { } else {
// We'll add a return instruction at the end of the current block, // 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 // which for a non-void function is really error recovery (?), as the source
...@@ -1759,10 +1759,13 @@ void Builder::makeSwitch(Id selector, int numSegments, std::vector<int>& caseVal ...@@ -1759,10 +1759,13 @@ void Builder::makeSwitch(Id selector, int numSegments, std::vector<int>& caseVal
// make the switch instruction // make the switch instruction
Instruction* switchInst = new Instruction(NoResult, NoType, OpSwitch); Instruction* switchInst = new Instruction(NoResult, NoType, OpSwitch);
switchInst->addIdOperand(selector); switchInst->addIdOperand(selector);
switchInst->addIdOperand(defaultSegment >= 0 ? segmentBlocks[defaultSegment]->getId() : mergeBlock->getId()); auto defaultOrMerge = (defaultSegment >= 0) ? segmentBlocks[defaultSegment] : mergeBlock;
switchInst->addIdOperand(defaultOrMerge->getId());
defaultOrMerge->addPredecessor(buildPoint);
for (int i = 0; i < (int)caseValues.size(); ++i) { for (int i = 0; i < (int)caseValues.size(); ++i) {
switchInst->addImmediateOperand(caseValues[i]); switchInst->addImmediateOperand(caseValues[i]);
switchInst->addIdOperand(segmentBlocks[valueIndexToSegment[i]]->getId()); switchInst->addIdOperand(segmentBlocks[valueIndexToSegment[i]]->getId());
segmentBlocks[valueIndexToSegment[i]]->addPredecessor(buildPoint);
} }
buildPoint->addInstruction(std::unique_ptr<Instruction>(switchInst)); buildPoint->addInstruction(std::unique_ptr<Instruction>(switchInst));
...@@ -1805,150 +1808,39 @@ void Builder::endSwitch(std::vector<Block*>& /*segmentBlock*/) ...@@ -1805,150 +1808,39 @@ void Builder::endSwitch(std::vector<Block*>& /*segmentBlock*/)
switchMerges.pop(); switchMerges.pop();
} }
// Comments in header Block& Builder::makeNewBlock()
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(std::unique_ptr<Instruction>(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(); Function& function = buildPoint->getParent();
auto block = new Block(getUniqueId(), function);
// Generate the merge instruction. If the loop test executes before function.addBlock(block);
// the body, then this is a loop merge. Otherwise the loop merge return *block;
// 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() Builder::LoopBlocks& Builder::makeNewLoop()
{ {
const Loop& loop = loops.top(); loops.push({makeNewBlock(), makeNewBlock(), makeNewBlock(), makeNewBlock()});
assert(loop.body); return loops.top();
// This is a reconvergence of control flow, so no merge instruction
// is required.
createBranch(loop.body);
loop.function->addBlock(loop.body);
setBuildPoint(loop.body);
} }
void Builder::createLoopContinue() void Builder::createLoopContinue()
{ {
createBranchToLoopHeaderFromInside(loops.top()); createBranch(&loops.top().continue_target);
// Set up a block for dead code. // Set up a block for dead code.
createAndSetNoPredecessorBlock("post-loop-continue"); createAndSetNoPredecessorBlock("post-loop-continue");
} }
// Add an exit (e.g. "break") for the innermost loop that you're in
void Builder::createLoopExit() void Builder::createLoopExit()
{ {
createBranch(loops.top().merge); createBranch(&loops.top().merge);
// Set up a block for dead code. // Set up a block for dead code.
createAndSetNoPredecessorBlock("post-loop-break"); createAndSetNoPredecessorBlock("post-loop-break");
} }
// Close the innermost loop
void Builder::closeLoop() 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(); 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() void Builder::clearAccessChain()
{ {
accessChain.base = NoResult; accessChain.base = NoResult;
...@@ -2311,24 +2203,4 @@ void MissingFunctionality(const char* fun) ...@@ -2311,24 +2203,4 @@ void MissingFunctionality(const char* fun)
printf("Missing functionality: %s\n", fun); printf("Missing functionality: %s\n", fun);
} }
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 }; // end spv namespace
...@@ -387,28 +387,24 @@ public: ...@@ -387,28 +387,24 @@ public:
// Finish off the innermost switch. // Finish off the innermost switch.
void endSwitch(std::vector<Block*>& segmentBB); void endSwitch(std::vector<Block*>& segmentBB);
// Start the beginning of a new loop, and prepare the builder to struct LoopBlocks {
// generate code for the loop test. Block &head, &body, &merge, &continue_target;
// The loopTestFirst parameter is true when the loop test executes before };
// the body. (It is false for do-while loops.)
void makeNewLoop(bool loopTestFirst); // Start a new loop and prepare the builder to generate code for it. Until
// closeLoop() is called for this loop, createLoopContinue() and
// Add the branch for the loop test, based on the given condition. // createLoopExit() will target its corresponding blocks.
// The true branch goes to the first block in the loop body, and LoopBlocks& makeNewLoop();
// the false branch goes to the loop's merge block. The builder insertion
// point will be placed at the start of the body. // Create a new block in the function containing the build point. Memory is
void createLoopTestBranch(Id condition); // owned by the function object.
Block& makeNewBlock();
// 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 // Add a branch to the continue_target of the current (innermost) loop.
// 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.
void createLoopContinue(); 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(); void createLoopExit();
// Close the innermost loop that you're in // Close the innermost loop that you're in
...@@ -508,7 +504,11 @@ public: ...@@ -508,7 +504,11 @@ public:
void dump(std::vector<unsigned int>&) const; void dump(std::vector<unsigned int>&) 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 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 value) const;
Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const; Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const;
...@@ -517,15 +517,9 @@ protected: ...@@ -517,15 +517,9 @@ protected:
void transferAccessChainSwizzle(bool dynamic); void transferAccessChainSwizzle(bool dynamic);
void simplifyAccessChainSwizzle(); void simplifyAccessChainSwizzle();
void createAndSetNoPredecessorBlock(const char*); void createAndSetNoPredecessorBlock(const char*);
void createBranch(Block* block);
void createSelectionMerge(Block* mergeBlock, unsigned int control); 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<unsigned int>&, const std::vector<std::unique_ptr<Instruction> >&) const; void dumpInstructions(std::vector<unsigned int>&, const std::vector<std::unique_ptr<Instruction> >&) const;
struct Loop; // Defined below.
void createBranchToLoopHeaderFromInside(const Loop& loop);
SourceLanguage source; SourceLanguage source;
int sourceVersion; int sourceVersion;
std::vector<const char*> extensions; std::vector<const char*> extensions;
...@@ -557,47 +551,8 @@ protected: ...@@ -557,47 +551,8 @@ protected:
// stack of switches // stack of switches
std::stack<Block*> switchMerges; std::stack<Block*> 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. // Our loop stack.
std::stack<Loop> loops; std::stack<LoopBlocks> loops;
}; // end Builder class }; // end Builder class
// Use for non-fatal notes about what's not complete // Use for non-fatal notes about what's not complete
......
...@@ -52,13 +52,16 @@ ...@@ -52,13 +52,16 @@
#include "spirv.hpp" #include "spirv.hpp"
#include <vector> #include <algorithm>
#include <cassert>
#include <functional>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include <assert.h> #include <vector>
namespace spv { namespace spv {
class Block;
class Function; class Function;
class Module; class Module;
...@@ -75,8 +78,8 @@ const MemorySemanticsMask MemorySemanticsAllMemory = (MemorySemanticsMask)0x3FF; ...@@ -75,8 +78,8 @@ const MemorySemanticsMask MemorySemanticsAllMemory = (MemorySemanticsMask)0x3FF;
class Instruction { class Instruction {
public: public:
Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode) { } Instruction(Id resultId, Id typeId, Op opCode) : resultId(resultId), typeId(typeId), opCode(opCode), block(nullptr) { }
explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode) { } explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { }
virtual ~Instruction() {} virtual ~Instruction() {}
void addIdOperand(Id id) { operands.push_back(id); } void addIdOperand(Id id) { operands.push_back(id); }
void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); } void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); }
...@@ -107,6 +110,8 @@ public: ...@@ -107,6 +110,8 @@ public:
addImmediateOperand(word); addImmediateOperand(word);
} }
} }
void setBlock(Block* b) { block = b; }
Block* getBlock() const { return block; }
Op getOpCode() const { return opCode; } Op getOpCode() const { return opCode; }
int getNumOperands() const { return (int)operands.size(); } int getNumOperands() const { return (int)operands.size(); }
Id getResultId() const { return resultId; } Id getResultId() const { return resultId; }
...@@ -145,6 +150,7 @@ protected: ...@@ -145,6 +150,7 @@ protected:
Op opCode; Op opCode;
std::vector<Id> operands; std::vector<Id> operands;
std::string originalString; // could be optimized away; convenience for getting string operand std::string originalString; // could be optimized away; convenience for getting string operand
Block* block;
}; };
// //
...@@ -157,16 +163,30 @@ public: ...@@ -157,16 +163,30 @@ public:
virtual ~Block() virtual ~Block()
{ {
} }
Id getId() { return instructions.front()->getResultId(); } Id getId() { return instructions.front()->getResultId(); }
Function& getParent() const { return parent; } Function& getParent() const { return parent; }
void addInstruction(std::unique_ptr<Instruction> inst); void addInstruction(std::unique_ptr<Instruction> inst);
void addPredecessor(Block* pred) { predecessors.push_back(pred); } void addPredecessor(Block* pred) { predecessors.push_back(pred); pred->successors.push_back(this);}
void addLocalVariable(std::unique_ptr<Instruction> inst) { localVariables.push_back(std::move(inst)); } void addLocalVariable(std::unique_ptr<Instruction> inst) { localVariables.push_back(std::move(inst)); }
int getNumPredecessors() const { return (int)predecessors.size(); } const std::vector<Block*>& getPredecessors() const { return predecessors; }
const std::vector<Block*>& getSuccessors() const { return successors; }
void setUnreachable() { unreachable = true; } void setUnreachable() { unreachable = true; }
bool isUnreachable() const { return unreachable; } bool isUnreachable() const { return unreachable; }
// Returns the block's merge instruction, if one exists (otherwise null).
const Instruction* getMergeInstruction() const {
if (instructions.size() < 2) return nullptr;
const Instruction* nextToLast = (instructions.cend() - 2)->get();
switch (nextToLast->getOpCode()) {
case OpSelectionMerge:
case OpLoopMerge:
return nextToLast;
default:
return nullptr;
}
return nullptr;
}
bool isTerminated() const bool isTerminated() const
{ {
...@@ -206,7 +226,7 @@ protected: ...@@ -206,7 +226,7 @@ protected:
friend Function; friend Function;
std::vector<std::unique_ptr<Instruction> > instructions; std::vector<std::unique_ptr<Instruction> > instructions;
std::vector<Block*> predecessors; std::vector<Block*> predecessors, successors;
std::vector<std::unique_ptr<Instruction> > localVariables; std::vector<std::unique_ptr<Instruction> > localVariables;
Function& parent; Function& parent;
...@@ -216,6 +236,11 @@ protected: ...@@ -216,6 +236,11 @@ protected:
bool unreachable; bool unreachable;
}; };
// Traverses the control-flow graph rooted at root in an order suited for
// readable code generation. Invokes callback at every node in the traversal
// order.
void inReadableOrder(Block* root, std::function<void(Block*)> callback);
// //
// SPIR-V IR Function. // SPIR-V IR Function.
// //
...@@ -235,7 +260,13 @@ public: ...@@ -235,7 +260,13 @@ public:
Id getParamId(int p) { return parameterInstructions[p]->getResultId(); } Id getParamId(int p) { return parameterInstructions[p]->getResultId(); }
void addBlock(Block* block) { blocks.push_back(block); } 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; } Module& getParent() const { return parent; }
Block* getEntryBlock() const { return blocks.front(); } Block* getEntryBlock() const { return blocks.front(); }
...@@ -252,8 +283,7 @@ public: ...@@ -252,8 +283,7 @@ public:
parameterInstructions[p]->dump(out); parameterInstructions[p]->dump(out);
// Blocks // Blocks
for (int b = 0; b < (int)blocks.size(); ++b) inReadableOrder(blocks[0], [&out](const Block* b) { b->dump(out); });
blocks[b]->dump(out);
Instruction end(0, 0, OpFunctionEnd); Instruction end(0, 0, OpFunctionEnd);
end.dump(out); end.dump(out);
} }
...@@ -351,12 +381,15 @@ __inline void Function::addLocalVariable(std::unique_ptr<Instruction> inst) ...@@ -351,12 +381,15 @@ __inline void Function::addLocalVariable(std::unique_ptr<Instruction> inst)
__inline Block::Block(Id id, Function& parent) : parent(parent), unreachable(false) __inline Block::Block(Id id, Function& parent) : parent(parent), unreachable(false)
{ {
instructions.push_back(std::unique_ptr<Instruction>(new Instruction(id, NoType, OpLabel))); instructions.push_back(std::unique_ptr<Instruction>(new Instruction(id, NoType, OpLabel)));
instructions.back()->setBlock(this);
parent.getParent().mapInstruction(instructions.back().get());
} }
__inline void Block::addInstruction(std::unique_ptr<Instruction> inst) __inline void Block::addInstruction(std::unique_ptr<Instruction> inst)
{ {
Instruction* raw_instruction = inst.get(); Instruction* raw_instruction = inst.get();
instructions.push_back(std::move(inst)); instructions.push_back(std::move(inst));
raw_instruction->setBlock(this);
if (raw_instruction->getResultId()) if (raw_instruction->getResultId())
parent.getParent().mapInstruction(raw_instruction); parent.getParent().mapInstruction(raw_instruction);
} }
......
...@@ -110,23 +110,4 @@ Linked fragment stage: ...@@ -110,23 +110,4 @@ Linked fragment stage:
Branch 49 Branch 49
49: Label 49: Label
Kill Kill
69: Label
70: 6(float) Load 36(radius)
72: 46(bool) FOrdGreaterThanEqual 70 71
SelectionMerge 74 None
BranchConditional 72 73 74
73: Label
75: 6(float) Load 36(radius)
77: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 75 76
78: 6(float) FDiv 77 27
79: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 78
80: 7(fvec4) Load 15(color)
81: 7(fvec4) CompositeConstruct 79 79 79 79
82: 7(fvec4) FSub 80 81
Store 15(color) 82
Branch 74
74: Label
83: 7(fvec4) Load 15(color)
Store 59(gl_FragColor) 83
Return
FunctionEnd FunctionEnd
spv.branch-return.vert
Linked vertex 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 Vertex 4 "main" 8 19 34
Source ESSL 300
Name 4 "main"
Name 8 "gl_InstanceID"
Name 19 "gl_Position"
Name 34 "gl_VertexID"
Decorate 8(gl_InstanceID) BuiltIn InstanceId
Decorate 19(gl_Position) BuiltIn Position
Decorate 34(gl_VertexID) BuiltIn VertexId
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Input 6(int)
8(gl_InstanceID): 7(ptr) Variable Input
16: TypeFloat 32
17: TypeVector 16(float) 4
18: TypePointer Output 17(fvec4)
19(gl_Position): 18(ptr) Variable Output
20: 16(float) Constant 0
21: 17(fvec4) ConstantComposite 20 20 20 20
26: 16(float) Constant 1039918957
27: TypeInt 32 0
28: 27(int) Constant 0
29: TypePointer Output 16(float)
34(gl_VertexID): 7(ptr) Variable Input
4(main): 2 Function None 3
5: Label
9: 6(int) Load 8(gl_InstanceID)
SelectionMerge 14 None
Switch 9 14
case 0: 10
case 1: 11
case 2: 12
case 3: 13
10: Label
Return
11: Label
Store 19(gl_Position) 21
Branch 14
12: Label
Return
13: Label
Return
14: Label
30: 29(ptr) AccessChain 19(gl_Position) 28
31: 16(float) Load 30
32: 16(float) FAdd 31 26
33: 29(ptr) AccessChain 19(gl_Position) 28
Store 33 32
Return
FunctionEnd
...@@ -8,64 +8,66 @@ Linked vertex stage: ...@@ -8,64 +8,66 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 38 // Id's are bound by 39
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 23 26 32 37 EntryPoint Vertex 4 "main" 24 27 33 38
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 23 "colorOut" Name 24 "colorOut"
Name 26 "color" Name 27 "color"
Name 32 "gl_Position" Name 33 "gl_Position"
Name 37 "gl_VertexID" Name 38 "gl_VertexID"
Decorate 32(gl_Position) BuiltIn Position Decorate 33(gl_Position) BuiltIn Position
Decorate 37(gl_VertexID) BuiltIn VertexId Decorate 38(gl_VertexID) BuiltIn VertexId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 1 9: 6(int) Constant 1
14: 6(int) Constant 5 15: 6(int) Constant 5
15: TypeBool 16: TypeBool
17: TypeFloat 32 18: TypeFloat 32
18: TypeVector 17(float) 4 19: TypeVector 18(float) 4
19: TypeInt 32 0 20: TypeInt 32 0
20: 19(int) Constant 6 21: 20(int) Constant 6
21: TypeArray 18(fvec4) 20 22: TypeArray 19(fvec4) 21
22: TypePointer Output 21 23: TypePointer Output 22
23(colorOut): 22(ptr) Variable Output 24(colorOut): 23(ptr) Variable Output
25: TypePointer Input 18(fvec4) 26: TypePointer Input 19(fvec4)
26(color): 25(ptr) Variable Input 27(color): 26(ptr) Variable Input
28: TypePointer Output 18(fvec4) 29: TypePointer Output 19(fvec4)
32(gl_Position): 28(ptr) Variable Output 33(gl_Position): 29(ptr) Variable Output
33: 6(int) Constant 2 34: 6(int) Constant 2
36: TypePointer Input 6(int) 37: TypePointer Input 6(int)
37(gl_VertexID): 36(ptr) Variable Input 38(gl_VertexID): 37(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
13: 6(int) Load 8(i) 14: 6(int) Load 8(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 11 10 None LoopMerge 12 13 None
BranchConditional 16 12 11 BranchConditional 17 11 12
12: Label 11: Label
24: 6(int) Load 8(i) 25: 6(int) Load 8(i)
27: 18(fvec4) Load 26(color) 28: 19(fvec4) Load 27(color)
29: 28(ptr) AccessChain 23(colorOut) 24 30: 29(ptr) AccessChain 24(colorOut) 25
Store 29 27 Store 30 28
30: 6(int) Load 8(i) Branch 13
31: 6(int) IAdd 30 9 13: Label
Store 8(i) 31 31: 6(int) Load 8(i)
32: 6(int) IAdd 31 9
Store 8(i) 32
Branch 10 Branch 10
11: Label 12: Label
34: 28(ptr) AccessChain 23(colorOut) 33 35: 29(ptr) AccessChain 24(colorOut) 34
35: 18(fvec4) Load 34 36: 19(fvec4) Load 35
Store 32(gl_Position) 35 Store 33(gl_Position) 36
Return Return
FunctionEnd FunctionEnd
...@@ -5,56 +5,47 @@ Linked vertex stage: ...@@ -5,56 +5,47 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 29 // Id's are bound by 24
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 27 28 EntryPoint Vertex 4 "main" 22 23
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 27 "gl_VertexID" Name 22 "gl_VertexID"
Name 28 "gl_InstanceID" Name 23 "gl_InstanceID"
Decorate 27(gl_VertexID) BuiltIn VertexId Decorate 22(gl_VertexID) BuiltIn VertexId
Decorate 28(gl_InstanceID) BuiltIn InstanceId Decorate 23(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: TypeBool 15: 6(int) Constant 1
15: 14(bool) ConstantTrue 18: 6(int) Constant 10
19: 6(int) Constant 10 19: TypeBool
23: 6(int) Constant 1 21: TypePointer Input 6(int)
25: 14(bool) ConstantFalse 22(gl_VertexID): 21(ptr) Variable Input
26: TypePointer Input 6(int) 23(gl_InstanceID): 21(ptr) Variable Input
27(gl_VertexID): 26(ptr) Variable Input
28(gl_InstanceID): 26(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
13: 14(bool) Phi 15 5 25 12 LoopMerge 12 13 None
LoopMerge 11 10 None Branch 11
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
11: Label 11: Label
14: 6(int) Load 8(i)
16: 6(int) IAdd 14 15
Store 8(i) 16
Branch 13
13: Label
17: 6(int) Load 8(i)
20: 19(bool) SLessThan 17 18
BranchConditional 20 10 12
12: Label
Return Return
FunctionEnd FunctionEnd
...@@ -5,100 +5,85 @@ Linked vertex stage: ...@@ -5,100 +5,85 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 51 // Id's are bound by 46
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 49 50 EntryPoint Vertex 4 "main" 44 45
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 24 "A" Name 14 "A"
Name 30 "B" Name 21 "B"
Name 33 "C" Name 24 "C"
Name 39 "D" Name 30 "D"
Name 42 "E" Name 33 "E"
Name 44 "F" Name 35 "F"
Name 46 "G" Name 41 "G"
Name 49 "gl_VertexID" Name 44 "gl_VertexID"
Name 50 "gl_InstanceID" Name 45 "gl_InstanceID"
Decorate 49(gl_VertexID) BuiltIn VertexId Decorate 44(gl_VertexID) BuiltIn VertexId
Decorate 50(gl_InstanceID) BuiltIn InstanceId Decorate 45(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: TypeBool 16: 6(int) Constant 2
15: 14(bool) ConstantTrue 17: TypeBool
19: 6(int) Constant 1 22: 6(int) Constant 1
21: 6(int) Constant 19 26: 6(int) Constant 5
26: 6(int) Constant 2 31: 6(int) Constant 3
31: 14(bool) ConstantFalse 34: 6(int) Constant 42
35: 6(int) Constant 5 36: 6(int) Constant 99
40: 6(int) Constant 3 39: 6(int) Constant 19
43: 6(int) Constant 42 42: 6(int) Constant 12
45: 6(int) Constant 99 43: TypePointer Input 6(int)
47: 6(int) Constant 12 44(gl_VertexID): 43(ptr) Variable Input
48: TypePointer Input 6(int) 45(gl_InstanceID): 43(ptr) Variable Input
49(gl_VertexID): 48(ptr) Variable Input
50(gl_InstanceID): 48(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
24(A): 7(ptr) Variable Function 14(A): 7(ptr) Variable Function
30(B): 7(ptr) Variable Function 21(B): 7(ptr) Variable Function
33(C): 7(ptr) Variable Function 24(C): 7(ptr) Variable Function
39(D): 7(ptr) Variable Function 30(D): 7(ptr) Variable Function
42(E): 7(ptr) Variable Function 33(E): 7(ptr) Variable Function
44(F): 7(ptr) Variable Function 35(F): 7(ptr) Variable Function
46(G): 7(ptr) Variable Function 41(G): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
13: 14(bool) Phi 15 5 31 28 31 38 LoopMerge 12 13 None
LoopMerge 11 10 None Branch 11
Branch 16 11: Label
16: Label Store 14(A) 9
SelectionMerge 12 None 15: 6(int) Load 8(i)
BranchConditional 13 12 17 18: 17(bool) IEqual 15 16
17: Label SelectionMerge 20 None
18: 6(int) Load 8(i) BranchConditional 18 19 20
20: 6(int) IAdd 18 19 19: Label
Store 8(i) 20 Store 21(B) 22
22: 14(bool) SLessThan 20 21 Branch 13
SelectionMerge 23 None 20: Label
BranchConditional 22 23 11
23: Label
Branch 12
12: Label
Store 24(A) 9
25: 6(int) Load 8(i) 25: 6(int) Load 8(i)
27: 14(bool) IEqual 25 26 27: 17(bool) IEqual 25 26
SelectionMerge 29 None SelectionMerge 29 None
BranchConditional 27 28 29 BranchConditional 27 28 29
28: Label 28: Label
Store 30(B) 19 Store 30(D) 31
Branch 10 Branch 12
32: Label
Store 33(C) 26
Branch 29
29: Label 29: Label
34: 6(int) Load 8(i) Store 35(F) 36
36: 14(bool) IEqual 34 35 Branch 13
SelectionMerge 38 None 13: Label
BranchConditional 36 37 38 37: 6(int) Load 8(i)
37: Label 38: 6(int) IAdd 37 22
Store 39(D) 40 Store 8(i) 38
Branch 11 40: 17(bool) SLessThan 38 39
41: Label BranchConditional 40 10 12
Store 42(E) 43 12: Label
Branch 38 Store 41(G) 42
38: Label
Store 44(F) 45
Branch 10
11: Label
Store 46(G) 47
Return Return
FunctionEnd FunctionEnd
...@@ -5,20 +5,20 @@ Linked fragment stage: ...@@ -5,20 +5,20 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 40 // Id's are bound by 35
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 38 EntryPoint Fragment 4 "main" 11 33
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 110 Source GLSL 110
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 27 "d" Name 18 "bigColor"
Name 32 "bigColor" Name 28 "d"
Name 38 "gl_FragColor" Name 33 "gl_FragColor"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
...@@ -26,18 +26,16 @@ Linked fragment stage: ...@@ -26,18 +26,16 @@ Linked fragment stage:
8: TypePointer Function 7(fvec4) 8: TypePointer Function 7(fvec4)
10: TypePointer Input 7(fvec4) 10: TypePointer Input 7(fvec4)
11(BaseColor): 10(ptr) Variable Input 11(BaseColor): 10(ptr) Variable Input
17: TypeBool 17: TypePointer UniformConstant 7(fvec4)
18: 17(bool) ConstantTrue 18(bigColor): 17(ptr) Variable UniformConstant
21: TypeInt 32 0 22: TypeInt 32 0
22: 21(int) Constant 0 23: 22(int) Constant 0
23: TypePointer Function 6(float) 24: TypePointer Function 6(float)
26: TypePointer UniformConstant 6(float) 27: TypePointer UniformConstant 6(float)
27(d): 26(ptr) Variable UniformConstant 28(d): 27(ptr) Variable UniformConstant
31: TypePointer UniformConstant 7(fvec4) 30: TypeBool
32(bigColor): 31(ptr) Variable UniformConstant 32: TypePointer Output 7(fvec4)
36: 17(bool) ConstantFalse 33(gl_FragColor): 32(ptr) Variable Output
37: TypePointer Output 7(fvec4)
38(gl_FragColor): 37(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(color): 8(ptr) Variable Function 9(color): 8(ptr) Variable Function
...@@ -45,29 +43,22 @@ Linked fragment stage: ...@@ -45,29 +43,22 @@ Linked fragment stage:
Store 9(color) 12 Store 9(color) 12
Branch 13 Branch 13
13: Label 13: Label
16: 17(bool) Phi 18 5 36 15 LoopMerge 15 16 None
LoopMerge 14 13 None Branch 14
Branch 19 14: Label
19: Label 19: 7(fvec4) Load 18(bigColor)
SelectionMerge 15 None 20: 7(fvec4) Load 9(color)
BranchConditional 16 15 20 21: 7(fvec4) FAdd 20 19
20: Label Store 9(color) 21
24: 23(ptr) AccessChain 9(color) 22 Branch 16
25: 6(float) Load 24 16: Label
28: 6(float) Load 27(d) 25: 24(ptr) AccessChain 9(color) 23
29: 17(bool) FOrdLessThan 25 28 26: 6(float) Load 25
SelectionMerge 30 None 29: 6(float) Load 28(d)
BranchConditional 29 30 14 31: 30(bool) FOrdLessThan 26 29
30: Label BranchConditional 31 13 15
Branch 15
15: Label 15: Label
33: 7(fvec4) Load 32(bigColor)
34: 7(fvec4) Load 9(color) 34: 7(fvec4) Load 9(color)
35: 7(fvec4) FAdd 34 33 Store 33(gl_FragColor) 34
Store 9(color) 35
Branch 13
14: Label
39: 7(fvec4) Load 9(color)
Store 38(gl_FragColor) 39
Return Return
FunctionEnd FunctionEnd
...@@ -5,93 +5,86 @@ Linked vertex stage: ...@@ -5,93 +5,86 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 48 // Id's are bound by 47
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 46 47 EntryPoint Vertex 4 "main" 45 46
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 17 "A" Name 18 "A"
Name 25 "B" Name 26 "B"
Name 29 "C" Name 28 "C"
Name 36 "D" Name 35 "D"
Name 38 "E" Name 37 "E"
Name 39 "F" Name 38 "F"
Name 43 "G" Name 42 "G"
Name 46 "gl_VertexID" Name 45 "gl_VertexID"
Name 47 "gl_InstanceID" Name 46 "gl_InstanceID"
Decorate 46(gl_VertexID) BuiltIn VertexId Decorate 45(gl_VertexID) BuiltIn VertexId
Decorate 47(gl_InstanceID) BuiltIn InstanceId Decorate 46(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: 6(int) Constant 10 15: 6(int) Constant 10
15: TypeBool 16: TypeBool
18: 6(int) Constant 1 19: 6(int) Constant 1
20: 6(int) Constant 2 21: 6(int) Constant 2
31: 6(int) Constant 3 30: 6(int) Constant 3
40: 6(int) Constant 12 39: 6(int) Constant 12
44: 6(int) Constant 99 43: 6(int) Constant 99
45: TypePointer Input 6(int) 44: TypePointer Input 6(int)
46(gl_VertexID): 45(ptr) Variable Input 45(gl_VertexID): 44(ptr) Variable Input
47(gl_InstanceID): 45(ptr) Variable Input 46(gl_InstanceID): 44(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
17(A): 7(ptr) Variable Function 18(A): 7(ptr) Variable Function
25(B): 7(ptr) Variable Function 26(B): 7(ptr) Variable Function
29(C): 7(ptr) Variable Function 28(C): 7(ptr) Variable Function
36(D): 7(ptr) Variable Function 35(D): 7(ptr) Variable Function
38(E): 7(ptr) Variable Function 37(E): 7(ptr) Variable Function
39(F): 7(ptr) Variable Function 38(F): 7(ptr) Variable Function
43(G): 7(ptr) Variable Function 42(G): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
13: 6(int) Load 8(i) 14: 6(int) Load 8(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 11 10 None LoopMerge 12 13 None
BranchConditional 16 12 11 BranchConditional 17 11 12
12: Label 11: Label
Store 17(A) 18 Store 18(A) 19
19: 6(int) Load 8(i) 20: 6(int) Load 8(i)
21: 6(int) SMod 19 20 22: 6(int) SMod 20 21
22: 15(bool) IEqual 21 9 23: 16(bool) IEqual 22 9
SelectionMerge 24 None SelectionMerge 25 None
BranchConditional 22 23 24 BranchConditional 23 24 25
23: Label 24: Label
Store 25(B) 18 Store 26(B) 19
26: 6(int) Load 8(i) Branch 13
27: 6(int) IAdd 26 18 25: Label
Store 8(i) 27 29: 6(int) Load 8(i)
Branch 10 31: 6(int) SMod 29 30
28: Label 32: 16(bool) IEqual 31 9
Store 29(C) 18 SelectionMerge 34 None
Branch 24 BranchConditional 32 33 34
24: Label 33: Label
30: 6(int) Load 8(i) Store 35(D) 19
32: 6(int) SMod 30 31 Branch 12
33: 15(bool) IEqual 32 9 34: Label
SelectionMerge 35 None Store 38(F) 39
BranchConditional 33 34 35 Branch 13
34: Label 13: Label
Store 36(D) 18 40: 6(int) Load 8(i)
Branch 11 41: 6(int) IAdd 40 19
37: Label Store 8(i) 41
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 Branch 10
11: Label 12: Label
Store 43(G) 44 Store 42(G) 43
Return Return
FunctionEnd 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
13: Label
18: 6(int) Load 8(i)
20: 6(int) IAdd 18 19
Store 8(i) 20
Branch 10
12: Label
23: 6(int) Load 8(i)
Store 22(r) 23
Return
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
...@@ -5,49 +5,51 @@ Linked vertex stage: ...@@ -5,49 +5,51 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 25 // Id's are bound by 26
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 23 24 EntryPoint Vertex 4 "main" 24 25
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 17 "j" Name 18 "j"
Name 23 "gl_VertexID" Name 24 "gl_VertexID"
Name 24 "gl_InstanceID" Name 25 "gl_InstanceID"
Decorate 23(gl_VertexID) BuiltIn VertexId Decorate 24(gl_VertexID) BuiltIn VertexId
Decorate 24(gl_InstanceID) BuiltIn InstanceId Decorate 25(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: 6(int) Constant 10 15: 6(int) Constant 10
15: TypeBool 16: TypeBool
18: 6(int) Constant 12 19: 6(int) Constant 12
20: 6(int) Constant 1 21: 6(int) Constant 1
22: TypePointer Input 6(int) 23: TypePointer Input 6(int)
23(gl_VertexID): 22(ptr) Variable Input 24(gl_VertexID): 23(ptr) Variable Input
24(gl_InstanceID): 22(ptr) Variable Input 25(gl_InstanceID): 23(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
17(j): 7(ptr) Variable Function 18(j): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
13: 6(int) Load 8(i) 14: 6(int) Load 8(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 11 10 None LoopMerge 12 13 None
BranchConditional 16 12 11 BranchConditional 17 11 12
12: Label 11: Label
Store 17(j) 18 Store 18(j) 19
19: 6(int) Load 8(i) Branch 13
21: 6(int) IAdd 19 20 13: Label
Store 8(i) 21 20: 6(int) Load 8(i)
22: 6(int) IAdd 20 21
Store 8(i) 22
Branch 10 Branch 10
11: Label 12: Label
Return Return
FunctionEnd FunctionEnd
...@@ -5,30 +5,30 @@ Linked fragment stage: ...@@ -5,30 +5,30 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 122 // Id's are bound by 127
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 35 97 EntryPoint Fragment 4 "main" 11 36 101
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 15 "i" Name 15 "i"
Name 22 "Count" Name 23 "Count"
Name 27 "bigColor" Name 28 "bigColor"
Name 35 "gl_FragColor" Name 36 "gl_FragColor"
Name 38 "sum" Name 39 "sum"
Name 40 "i" Name 41 "i"
Name 50 "v4" Name 52 "v4"
Name 60 "i" Name 62 "i"
Name 66 "tv4" Name 69 "tv4"
Name 83 "r" Name 86 "r"
Name 89 "i" Name 92 "i"
Name 97 "f" Name 101 "f"
Name 110 "i" Name 114 "i"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
...@@ -39,156 +39,166 @@ Linked fragment stage: ...@@ -39,156 +39,166 @@ Linked fragment stage:
13: TypeInt 32 1 13: TypeInt 32 1
14: TypePointer Function 13(int) 14: TypePointer Function 13(int)
16: 13(int) Constant 0 16: 13(int) Constant 0
21: TypePointer UniformConstant 13(int) 22: TypePointer UniformConstant 13(int)
22(Count): 21(ptr) Variable UniformConstant 23(Count): 22(ptr) Variable UniformConstant
24: TypeBool 25: TypeBool
26: TypePointer UniformConstant 7(fvec4) 27: TypePointer UniformConstant 7(fvec4)
27(bigColor): 26(ptr) Variable UniformConstant 28(bigColor): 27(ptr) Variable UniformConstant
32: 13(int) Constant 1 33: 13(int) Constant 1
34: TypePointer Output 7(fvec4) 35: TypePointer Output 7(fvec4)
35(gl_FragColor): 34(ptr) Variable Output 36(gl_FragColor): 35(ptr) Variable Output
37: TypePointer Function 6(float) 38: TypePointer Function 6(float)
39: 6(float) Constant 0 40: 6(float) Constant 0
45: 13(int) Constant 4 47: 13(int) Constant 4
47: TypeInt 32 0 49: TypeInt 32 0
48: TypeVector 47(int) 4 50: TypeVector 49(int) 4
49: TypePointer UniformConstant 48(ivec4) 51: TypePointer UniformConstant 50(ivec4)
50(v4): 49(ptr) Variable UniformConstant 52(v4): 51(ptr) Variable UniformConstant
52: TypePointer UniformConstant 47(int) 54: TypePointer UniformConstant 49(int)
71: 47(int) Constant 4 74: 49(int) Constant 4
84: TypeVector 6(float) 3 87: TypeVector 6(float) 3
96: TypePointer Input 6(float) 100: TypePointer Input 6(float)
97(f): 96(ptr) Variable Input 101(f): 100(ptr) Variable Input
99: 47(int) Constant 3 103: 49(int) Constant 3
115: 13(int) Constant 16 120: 13(int) Constant 16
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(color): 8(ptr) Variable Function 9(color): 8(ptr) Variable Function
15(i): 14(ptr) Variable Function 15(i): 14(ptr) Variable Function
38(sum): 37(ptr) Variable Function 39(sum): 38(ptr) Variable Function
40(i): 14(ptr) Variable Function 41(i): 14(ptr) Variable Function
60(i): 14(ptr) Variable Function 62(i): 14(ptr) Variable Function
66(tv4): 8(ptr) Variable Function 69(tv4): 8(ptr) Variable Function
83(r): 8(ptr) Variable Function 86(r): 8(ptr) Variable Function
89(i): 14(ptr) Variable Function 92(i): 14(ptr) Variable Function
110(i): 14(ptr) Variable Function 114(i): 14(ptr) Variable Function
12: 7(fvec4) Load 11(BaseColor) 12: 7(fvec4) Load 11(BaseColor)
Store 9(color) 12 Store 9(color) 12
Store 15(i) 16 Store 15(i) 16
Branch 17 Branch 17
17: Label 17: Label
20: 13(int) Load 15(i) 21: 13(int) Load 15(i)
23: 13(int) Load 22(Count) 24: 13(int) Load 23(Count)
25: 24(bool) SLessThan 20 23 26: 25(bool) SLessThan 21 24
LoopMerge 18 17 None LoopMerge 19 20 None
BranchConditional 25 19 18 BranchConditional 26 18 19
19: Label 18: Label
28: 7(fvec4) Load 27(bigColor) 29: 7(fvec4) Load 28(bigColor)
29: 7(fvec4) Load 9(color) 30: 7(fvec4) Load 9(color)
30: 7(fvec4) FAdd 29 28 31: 7(fvec4) FAdd 30 29
Store 9(color) 30 Store 9(color) 31
31: 13(int) Load 15(i) Branch 20
33: 13(int) IAdd 31 32 20: Label
Store 15(i) 33 32: 13(int) Load 15(i)
34: 13(int) IAdd 32 33
Store 15(i) 34
Branch 17 Branch 17
18: Label 19: Label
36: 7(fvec4) Load 9(color) 37: 7(fvec4) Load 9(color)
Store 35(gl_FragColor) 36 Store 36(gl_FragColor) 37
Store 38(sum) 39 Store 39(sum) 40
Store 40(i) 16 Store 41(i) 16
Branch 41 Branch 42
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 42: Label
Store 60(i) 16 46: 13(int) Load 41(i)
Branch 61 48: 25(bool) SLessThan 46 47
61: Label LoopMerge 44 45 None
64: 13(int) Load 60(i) BranchConditional 48 43 44
65: 24(bool) SLessThan 64 45 43: Label
LoopMerge 62 61 None 53: 13(int) Load 41(i)
BranchConditional 65 63 62 55: 54(ptr) AccessChain 52(v4) 53
63: Label 56: 49(int) Load 55
67: 13(int) Load 60(i) 57: 6(float) ConvertUToF 56
68: 13(int) Load 60(i) 58: 6(float) Load 39(sum)
69: 52(ptr) AccessChain 50(v4) 68 59: 6(float) FAdd 58 57
70: 47(int) Load 69 Store 39(sum) 59
72: 47(int) IMul 70 71 Branch 45
73: 6(float) ConvertUToF 72 45: Label
74: 37(ptr) AccessChain 66(tv4) 67 60: 13(int) Load 41(i)
Store 74 73 61: 13(int) IAdd 60 33
75: 13(int) Load 60(i) Store 41(i) 61
76: 13(int) IAdd 75 32 Branch 42
Store 60(i) 76 44: Label
Branch 61 Store 62(i) 16
62: Label Branch 63
77: 6(float) Load 38(sum) 63: Label
78: 7(fvec4) CompositeConstruct 77 77 77 77 67: 13(int) Load 62(i)
79: 7(fvec4) Load 66(tv4) 68: 25(bool) SLessThan 67 47
80: 7(fvec4) FAdd 78 79 LoopMerge 65 66 None
81: 7(fvec4) Load 35(gl_FragColor) BranchConditional 68 64 65
82: 7(fvec4) FAdd 81 80 64: Label
Store 35(gl_FragColor) 82 70: 13(int) Load 62(i)
85: 7(fvec4) Load 11(BaseColor) 71: 13(int) Load 62(i)
86: 84(fvec3) VectorShuffle 85 85 0 1 2 72: 54(ptr) AccessChain 52(v4) 71
87: 7(fvec4) Load 83(r) 73: 49(int) Load 72
88: 7(fvec4) VectorShuffle 87 86 4 5 6 3 75: 49(int) IMul 73 74
Store 83(r) 88 76: 6(float) ConvertUToF 75
Store 89(i) 16 77: 38(ptr) AccessChain 69(tv4) 70
Branch 90 Store 77 76
90: Label Branch 66
93: 13(int) Load 89(i) 66: Label
94: 13(int) Load 22(Count) 78: 13(int) Load 62(i)
95: 24(bool) SLessThan 93 94 79: 13(int) IAdd 78 33
LoopMerge 91 90 None Store 62(i) 79
BranchConditional 95 92 91 Branch 63
92: Label 65: Label
98: 6(float) Load 97(f) 80: 6(float) Load 39(sum)
100: 37(ptr) AccessChain 83(r) 99 81: 7(fvec4) CompositeConstruct 80 80 80 80
Store 100 98 82: 7(fvec4) Load 69(tv4)
101: 13(int) Load 89(i) 83: 7(fvec4) FAdd 81 82
102: 13(int) IAdd 101 32 84: 7(fvec4) Load 36(gl_FragColor)
Store 89(i) 102 85: 7(fvec4) FAdd 84 83
Branch 90 Store 36(gl_FragColor) 85
91: Label 88: 7(fvec4) Load 11(BaseColor)
103: 7(fvec4) Load 83(r) 89: 87(fvec3) VectorShuffle 88 88 0 1 2
104: 84(fvec3) VectorShuffle 103 103 0 1 2 90: 7(fvec4) Load 86(r)
105: 7(fvec4) Load 35(gl_FragColor) 91: 7(fvec4) VectorShuffle 90 89 4 5 6 3
106: 84(fvec3) VectorShuffle 105 105 0 1 2 Store 86(r) 91
107: 84(fvec3) FAdd 106 104 Store 92(i) 16
108: 7(fvec4) Load 35(gl_FragColor) Branch 93
109: 7(fvec4) VectorShuffle 108 107 4 5 6 3 93: Label
Store 35(gl_FragColor) 109 97: 13(int) Load 92(i)
Store 110(i) 16 98: 13(int) Load 23(Count)
Branch 111 99: 25(bool) SLessThan 97 98
111: Label LoopMerge 95 96 None
114: 13(int) Load 110(i) BranchConditional 99 94 95
116: 24(bool) SLessThan 114 115 94: Label
LoopMerge 112 111 None 102: 6(float) Load 101(f)
BranchConditional 116 113 112 104: 38(ptr) AccessChain 86(r) 103
113: Label Store 104 102
117: 6(float) Load 97(f) Branch 96
118: 7(fvec4) Load 35(gl_FragColor) 96: Label
119: 7(fvec4) VectorTimesScalar 118 117 105: 13(int) Load 92(i)
Store 35(gl_FragColor) 119 106: 13(int) IAdd 105 33
120: 13(int) Load 110(i) Store 92(i) 106
121: 13(int) IAdd 120 45 Branch 93
Store 110(i) 121 95: Label
Branch 111 107: 7(fvec4) Load 86(r)
112: Label 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
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
118: Label
125: 13(int) Load 114(i)
126: 13(int) IAdd 125 47
Store 114(i) 126
Branch 115
117: Label
Return Return
FunctionEnd FunctionEnd
...@@ -8,12 +8,12 @@ Linked fragment stage: ...@@ -8,12 +8,12 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 136 // Id's are bound by 137
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 40 96 106 EntryPoint Fragment 4 "main" 40 97 107
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
...@@ -38,14 +38,14 @@ Linked fragment stage: ...@@ -38,14 +38,14 @@ Linked fragment stage:
Name 68 "x" Name 68 "x"
Name 70 "localArray" Name 70 "localArray"
Name 75 "i" Name 75 "i"
Name 82 "a" Name 83 "a"
Name 88 "condition" Name 89 "condition"
Name 96 "color" Name 97 "color"
Name 106 "gl_FragColor" Name 107 "gl_FragColor"
Name 126 "samp2D" Name 127 "samp2D"
Name 132 "foo" Name 133 "foo"
Name 133 "foo2" Name 134 "foo2"
Name 135 "uFloatArray" Name 136 "uFloatArray"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
...@@ -80,26 +80,26 @@ Linked fragment stage: ...@@ -80,26 +80,26 @@ Linked fragment stage:
48: TypePointer Function 47 48: TypePointer Function 47
52: TypePointer Function 6(int) 52: TypePointer Function 6(int)
69: 6(int) Constant 5 69: 6(int) Constant 5
80: 6(int) Constant 16 81: 6(int) Constant 16
84: 7(float) Constant 0 85: 7(float) Constant 0
88(condition): 20(ptr) Variable UniformConstant 89(condition): 20(ptr) Variable UniformConstant
94: 6(int) Constant 3 95: 6(int) Constant 3
95: TypePointer Input 9(fvec4) 96: TypePointer Input 9(fvec4)
96(color): 95(ptr) Variable Input 97(color): 96(ptr) Variable Input
98: TypePointer Function 9(fvec4) 99: TypePointer Function 9(fvec4)
100: 32(int) Constant 1 101: 32(int) Constant 1
103: 32(int) Constant 2 104: 32(int) Constant 2
105: TypePointer Output 9(fvec4) 106: TypePointer Output 9(fvec4)
106(gl_FragColor): 105(ptr) Variable Output 107(gl_FragColor): 106(ptr) Variable Output
123: TypeImage 7(float) 2D sampled format:Unknown 124: TypeImage 7(float) 2D sampled format:Unknown
124: TypeSampledImage 123 125: TypeSampledImage 124
125: TypePointer UniformConstant 124 126: TypePointer UniformConstant 125
126(samp2D): 125(ptr) Variable UniformConstant 127(samp2D): 126(ptr) Variable UniformConstant
131: TypePointer UniformConstant 8(s1) 132: TypePointer UniformConstant 8(s1)
132(foo): 131(ptr) Variable UniformConstant 133(foo): 132(ptr) Variable UniformConstant
133(foo2): 17(ptr) Variable UniformConstant 134(foo2): 17(ptr) Variable UniformConstant
134: TypePointer UniformConstant 34 135: TypePointer UniformConstant 34
135(uFloatArray): 134(ptr) Variable UniformConstant 136(uFloatArray): 135(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
12(locals2): 11(ptr) Variable Function 12(locals2): 11(ptr) Variable Function
...@@ -108,7 +108,7 @@ Linked fragment stage: ...@@ -108,7 +108,7 @@ Linked fragment stage:
68(x): 52(ptr) Variable Function 68(x): 52(ptr) Variable Function
70(localArray): 35(ptr) Variable Function 70(localArray): 35(ptr) Variable Function
75(i): 52(ptr) Variable Function 75(i): 52(ptr) Variable Function
82(a): 35(ptr) Variable Function 83(a): 35(ptr) Variable Function
18: 17(ptr) AccessChain 15(foo3) 16 18: 17(ptr) AccessChain 15(foo3) 16
19: 10(s2) Load 18 19: 10(s2) Load 18
Store 12(locals2) 19 Store 12(locals2) 19
...@@ -161,55 +161,57 @@ Linked fragment stage: ...@@ -161,55 +161,57 @@ Linked fragment stage:
Store 75(i) 16 Store 75(i) 16
Branch 76 Branch 76
76: Label 76: Label
79: 6(int) Load 75(i) 80: 6(int) Load 75(i)
81: 23(bool) SLessThan 79 80 82: 23(bool) SLessThan 80 81
LoopMerge 77 76 None LoopMerge 78 79 None
BranchConditional 81 78 77 BranchConditional 82 77 78
78: Label 77: Label
83: 6(int) Load 75(i) 84: 6(int) Load 75(i)
85: 30(ptr) AccessChain 82(a) 83 86: 30(ptr) AccessChain 83(a) 84
Store 85 84 Store 86 85
86: 6(int) Load 75(i) Branch 79
87: 6(int) IAdd 86 28 79: Label
Store 75(i) 87 87: 6(int) Load 75(i)
88: 6(int) IAdd 87 28
Store 75(i) 88
Branch 76 Branch 76
77: Label 78: Label
89: 6(int) Load 88(condition) 90: 6(int) Load 89(condition)
90: 23(bool) IEqual 89 28 91: 23(bool) IEqual 90 28
SelectionMerge 92 None SelectionMerge 93 None
BranchConditional 90 91 92 BranchConditional 91 92 93
91: Label 92: Label
93: 34 Load 70(localArray) 94: 34 Load 70(localArray)
Store 82(a) 93 Store 83(a) 94
Branch 92 Branch 93
92: Label 93: Label
97: 9(fvec4) Load 96(color) 98: 9(fvec4) Load 97(color)
99: 98(ptr) AccessChain 12(locals2) 94 100: 99(ptr) AccessChain 12(locals2) 95
Store 99 97 Store 100 98
101: 42(ptr) AccessChain 40(coord) 100 102: 42(ptr) AccessChain 40(coord) 101
102: 7(float) Load 101 103: 7(float) Load 102
104: 30(ptr) AccessChain 12(locals2) 94 103 105: 30(ptr) AccessChain 12(locals2) 95 104
Store 104 102 Store 105 103
107: 98(ptr) AccessChain 12(locals2) 94 108: 99(ptr) AccessChain 12(locals2) 95
108: 9(fvec4) Load 107 109: 9(fvec4) Load 108
109: 30(ptr) AccessChain 36(localFArray) 37 110: 30(ptr) AccessChain 36(localFArray) 37
110: 7(float) Load 109 111: 7(float) Load 110
111: 30(ptr) AccessChain 12(locals2) 27 28 112: 30(ptr) AccessChain 12(locals2) 27 28
112: 7(float) Load 111 113: 7(float) Load 112
113: 7(float) FAdd 110 112 114: 7(float) FAdd 111 113
114: 6(int) Load 68(x) 115: 6(int) Load 68(x)
115: 30(ptr) AccessChain 70(localArray) 114 116: 30(ptr) AccessChain 70(localArray) 115
116: 7(float) Load 115 117: 7(float) Load 116
117: 7(float) FAdd 113 116 118: 7(float) FAdd 114 117
118: 6(int) Load 68(x) 119: 6(int) Load 68(x)
119: 30(ptr) AccessChain 82(a) 118 120: 30(ptr) AccessChain 83(a) 119
120: 7(float) Load 119 121: 7(float) Load 120
121: 7(float) FAdd 117 120 122: 7(float) FAdd 118 121
122: 9(fvec4) VectorTimesScalar 108 121 123: 9(fvec4) VectorTimesScalar 109 122
127: 124 Load 126(samp2D) 128: 125 Load 127(samp2D)
128: 38(fvec2) Load 40(coord) 129: 38(fvec2) Load 40(coord)
129: 9(fvec4) ImageSampleImplicitLod 127 128 130: 9(fvec4) ImageSampleImplicitLod 128 129
130: 9(fvec4) FMul 122 129 131: 9(fvec4) FMul 123 130
Store 106(gl_FragColor) 130 Store 107(gl_FragColor) 131
Return Return
FunctionEnd FunctionEnd
...@@ -7,70 +7,70 @@ Linked fragment stage: ...@@ -7,70 +7,70 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 718 // Id's are bound by 720
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 596 EntryPoint Fragment 4 "main" 11 597
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 50 "d" Name 52 "d"
Name 54 "bigColor" Name 56 "bigColor"
Name 66 "bigColor1_1" Name 69 "bigColor1_1"
Name 97 "d2" Name 102 "d2"
Name 105 "d3" Name 110 "d3"
Name 109 "bigColor1_2" Name 114 "bigColor1_2"
Name 120 "bigColor1_3" Name 126 "bigColor1_3"
Name 126 "d4" Name 132 "d4"
Name 137 "i" Name 143 "i"
Name 144 "Count" Name 151 "Count"
Name 147 "bigColor2" Name 154 "bigColor2"
Name 165 "bigColor3" Name 165 "bigColor3"
Name 170 "i" Name 173 "i"
Name 184 "i" Name 188 "i"
Name 218 "i" Name 223 "i"
Name 239 "i" Name 245 "i"
Name 264 "i" Name 269 "i"
Name 298 "bigColor4" Name 297 "bigColor4"
Name 334 "d5" Name 333 "bigColor5"
Name 338 "bigColor5" Name 339 "d5"
Name 355 "d6" Name 355 "d6"
Name 367 "bigColor6" Name 368 "bigColor6"
Name 401 "d7" Name 404 "d7"
Name 434 "bigColor7" Name 435 "bigColor7"
Name 457 "d8" Name 454 "d8"
Name 497 "d9" Name 496 "d9"
Name 527 "d10" Name 527 "d10"
Name 535 "d11" Name 535 "d11"
Name 545 "d12" Name 545 "d12"
Name 569 "bigColor8" Name 570 "bigColor8"
Name 596 "gl_FragColor" Name 597 "gl_FragColor"
Name 603 "d14" Name 605 "d14"
Name 608 "d15" Name 610 "d15"
Name 626 "d16" Name 629 "d16"
Name 664 "d17" Name 666 "d18"
Name 670 "d18" Name 677 "d17"
Name 701 "d13" Name 703 "d13"
Name 702 "d19" Name 704 "d19"
Name 703 "d20" Name 705 "d20"
Name 704 "d21" Name 706 "d21"
Name 705 "d22" Name 707 "d22"
Name 706 "d23" Name 708 "d23"
Name 707 "d24" Name 709 "d24"
Name 708 "d25" Name 710 "d25"
Name 709 "d26" Name 711 "d26"
Name 710 "d27" Name 712 "d27"
Name 711 "d28" Name 713 "d28"
Name 712 "d29" Name 714 "d29"
Name 713 "d30" Name 715 "d30"
Name 714 "d31" Name 716 "d31"
Name 715 "d32" Name 717 "d32"
Name 716 "d33" Name 718 "d33"
Name 717 "d34" Name 719 "d34"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
...@@ -78,1021 +78,1021 @@ Linked fragment stage: ...@@ -78,1021 +78,1021 @@ Linked fragment stage:
8: TypePointer Function 7(fvec4) 8: TypePointer Function 7(fvec4)
10: TypePointer Input 7(fvec4) 10: TypePointer Input 7(fvec4)
11(BaseColor): 10(ptr) Variable Input 11(BaseColor): 10(ptr) Variable Input
16: TypeBool 17: TypeBool
17: 16(bool) ConstantTrue 18: 17(bool) ConstantTrue
18: TypeInt 32 0 19: TypeInt 32 0
19: 18(int) Constant 0 20: 19(int) Constant 0
20: TypePointer Function 6(float) 21: TypePointer Function 6(float)
23: 6(float) Constant 1051260355 24: 6(float) Constant 1051260355
27: 7(fvec4) ConstantComposite 23 23 23 23 28: 7(fvec4) ConstantComposite 24 24 24 24
33: 6(float) Constant 1059648963 34: 6(float) Constant 1059648963
37: 7(fvec4) ConstantComposite 33 33 33 33 38: 7(fvec4) ConstantComposite 34 34 34 34
49: TypePointer UniformConstant 6(float) 51: TypePointer UniformConstant 6(float)
50(d): 49(ptr) Variable UniformConstant 52(d): 51(ptr) Variable UniformConstant
53: TypePointer UniformConstant 7(fvec4) 55: TypePointer UniformConstant 7(fvec4)
54(bigColor): 53(ptr) Variable UniformConstant 56(bigColor): 55(ptr) Variable UniformConstant
61: 18(int) Constant 2 64: 19(int) Constant 2
66(bigColor1_1): 53(ptr) Variable UniformConstant 69(bigColor1_1): 55(ptr) Variable UniformConstant
70: 18(int) Constant 3 73: 19(int) Constant 3
86: 6(float) Constant 1109917696 90: 6(float) Constant 1109917696
89: 6(float) Constant 1065353216 93: 6(float) Constant 1065353216
97(d2): 49(ptr) Variable UniformConstant 102(d2): 51(ptr) Variable UniformConstant
102: 18(int) Constant 1 107: 19(int) Constant 1
105(d3): 49(ptr) Variable UniformConstant 110(d3): 51(ptr) Variable UniformConstant
109(bigColor1_2): 53(ptr) Variable UniformConstant 114(bigColor1_2): 55(ptr) Variable UniformConstant
120(bigColor1_3): 53(ptr) Variable UniformConstant 126(bigColor1_3): 55(ptr) Variable UniformConstant
126(d4): 49(ptr) Variable UniformConstant 132(d4): 51(ptr) Variable UniformConstant
135: TypeInt 32 1 141: TypeInt 32 1
136: TypePointer Function 135(int) 142: TypePointer Function 141(int)
138: 135(int) Constant 0 144: 141(int) Constant 0
143: TypePointer UniformConstant 135(int) 150: TypePointer UniformConstant 141(int)
144(Count): 143(ptr) Variable UniformConstant 151(Count): 150(ptr) Variable UniformConstant
147(bigColor2): 53(ptr) Variable UniformConstant 154(bigColor2): 55(ptr) Variable UniformConstant
152: 135(int) Constant 1 159: 141(int) Constant 1
165(bigColor3): 53(ptr) Variable UniformConstant 165(bigColor3): 55(ptr) Variable UniformConstant
169: 16(bool) ConstantFalse 179: 141(int) Constant 42
175: 135(int) Constant 42 194: 141(int) Constant 100
189: 135(int) Constant 100 198: 6(float) Constant 1101004800
193: 6(float) Constant 1101004800 229: 141(int) Constant 120
223: 135(int) Constant 120 297(bigColor4): 55(ptr) Variable UniformConstant
298(bigColor4): 53(ptr) Variable UniformConstant 333(bigColor5): 55(ptr) Variable UniformConstant
334(d5): 49(ptr) Variable UniformConstant 339(d5): 51(ptr) Variable UniformConstant
338(bigColor5): 53(ptr) Variable UniformConstant 355(d6): 51(ptr) Variable UniformConstant
355(d6): 49(ptr) Variable UniformConstant 368(bigColor6): 55(ptr) Variable UniformConstant
367(bigColor6): 53(ptr) Variable UniformConstant 404(d7): 51(ptr) Variable UniformConstant
401(d7): 49(ptr) Variable UniformConstant 430: 6(float) Constant 0
429: 6(float) Constant 0 435(bigColor7): 55(ptr) Variable UniformConstant
434(bigColor7): 53(ptr) Variable UniformConstant 454(d8): 51(ptr) Variable UniformConstant
457(d8): 49(ptr) Variable UniformConstant 471: 6(float) Constant 1073741824
477: 6(float) Constant 1073741824 496(d9): 51(ptr) Variable UniformConstant
497(d9): 49(ptr) Variable UniformConstant 512: 6(float) Constant 1084227584
513: 6(float) Constant 1084227584 527(d10): 51(ptr) Variable UniformConstant
527(d10): 49(ptr) Variable UniformConstant 535(d11): 51(ptr) Variable UniformConstant
535(d11): 49(ptr) Variable UniformConstant 545(d12): 51(ptr) Variable UniformConstant
545(d12): 49(ptr) Variable UniformConstant 568: 6(float) Constant 1092616192
567: 6(float) Constant 1092616192 570(bigColor8): 55(ptr) Variable UniformConstant
569(bigColor8): 53(ptr) Variable UniformConstant 596: TypePointer Output 7(fvec4)
595: TypePointer Output 7(fvec4) 597(gl_FragColor): 596(ptr) Variable Output
596(gl_FragColor): 595(ptr) Variable Output 605(d14): 51(ptr) Variable UniformConstant
603(d14): 49(ptr) Variable UniformConstant 610(d15): 51(ptr) Variable UniformConstant
608(d15): 49(ptr) Variable UniformConstant 629(d16): 51(ptr) Variable UniformConstant
626(d16): 49(ptr) Variable UniformConstant 666(d18): 51(ptr) Variable UniformConstant
664(d17): 49(ptr) Variable UniformConstant 677(d17): 51(ptr) Variable UniformConstant
670(d18): 49(ptr) Variable UniformConstant 703(d13): 51(ptr) Variable UniformConstant
701(d13): 49(ptr) Variable UniformConstant 704(d19): 51(ptr) Variable UniformConstant
702(d19): 49(ptr) Variable UniformConstant 705(d20): 51(ptr) Variable UniformConstant
703(d20): 49(ptr) Variable UniformConstant 706(d21): 51(ptr) Variable UniformConstant
704(d21): 49(ptr) Variable UniformConstant 707(d22): 51(ptr) Variable UniformConstant
705(d22): 49(ptr) Variable UniformConstant 708(d23): 51(ptr) Variable UniformConstant
706(d23): 49(ptr) Variable UniformConstant 709(d24): 51(ptr) Variable UniformConstant
707(d24): 49(ptr) Variable UniformConstant 710(d25): 51(ptr) Variable UniformConstant
708(d25): 49(ptr) Variable UniformConstant 711(d26): 51(ptr) Variable UniformConstant
709(d26): 49(ptr) Variable UniformConstant 712(d27): 51(ptr) Variable UniformConstant
710(d27): 49(ptr) Variable UniformConstant 713(d28): 51(ptr) Variable UniformConstant
711(d28): 49(ptr) Variable UniformConstant 714(d29): 51(ptr) Variable UniformConstant
712(d29): 49(ptr) Variable UniformConstant 715(d30): 51(ptr) Variable UniformConstant
713(d30): 49(ptr) Variable UniformConstant 716(d31): 51(ptr) Variable UniformConstant
714(d31): 49(ptr) Variable UniformConstant 717(d32): 51(ptr) Variable UniformConstant
715(d32): 49(ptr) Variable UniformConstant 718(d33): 51(ptr) Variable UniformConstant
716(d33): 49(ptr) Variable UniformConstant 719(d34): 51(ptr) Variable UniformConstant
717(d34): 49(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(color): 8(ptr) Variable Function 9(color): 8(ptr) Variable Function
137(i): 136(ptr) Variable Function 143(i): 142(ptr) Variable Function
170(i): 136(ptr) Variable Function 173(i): 142(ptr) Variable Function
184(i): 136(ptr) Variable Function 188(i): 142(ptr) Variable Function
218(i): 136(ptr) Variable Function 223(i): 142(ptr) Variable Function
239(i): 136(ptr) Variable Function 245(i): 142(ptr) Variable Function
264(i): 136(ptr) Variable Function 269(i): 142(ptr) Variable Function
12: 7(fvec4) Load 11(BaseColor) 12: 7(fvec4) Load 11(BaseColor)
Store 9(color) 12 Store 9(color) 12
Branch 13 Branch 13
13: Label 13: Label
LoopMerge 14 13 None LoopMerge 15 16 None
BranchConditional 17 15 14 BranchConditional 18 14 15
15: Label 14: Label
21: 20(ptr) AccessChain 9(color) 19 22: 21(ptr) AccessChain 9(color) 20
22: 6(float) Load 21 23: 6(float) Load 22
24: 16(bool) FOrdLessThan 22 23 25: 17(bool) FOrdLessThan 23 24
SelectionMerge 26 None SelectionMerge 27 None
BranchConditional 24 25 26 BranchConditional 25 26 27
25: Label 26: Label
28: 7(fvec4) Load 9(color) 29: 7(fvec4) Load 9(color)
29: 7(fvec4) FAdd 28 27 30: 7(fvec4) FAdd 29 28
Store 9(color) 29 Store 9(color) 30
Branch 14 Branch 15
26: Label 27: Label
31: 20(ptr) AccessChain 9(color) 19 32: 21(ptr) AccessChain 9(color) 20
32: 6(float) Load 31 33: 6(float) Load 32
34: 16(bool) FOrdLessThan 32 33 35: 17(bool) FOrdLessThan 33 34
SelectionMerge 36 None SelectionMerge 37 None
BranchConditional 34 35 36 BranchConditional 35 36 37
35: Label 36: Label
38: 7(fvec4) Load 9(color) 39: 7(fvec4) Load 9(color)
39: 7(fvec4) FAdd 38 37 40: 7(fvec4) FAdd 39 38
Store 9(color) 39 Store 9(color) 40
Branch 14 Branch 15
36: Label 37: Label
41: 7(fvec4) Load 9(color) 42: 7(fvec4) Load 9(color)
42: 7(fvec4) FAdd 41 27 43: 7(fvec4) FAdd 42 28
Store 9(color) 42 Store 9(color) 43
Branch 14 Branch 15
14: Label 16: Label
Branch 44 Branch 13
44: Label 15: Label
47: 20(ptr) AccessChain 9(color) 19 Branch 45
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 45: Label
Branch 58 49: 21(ptr) AccessChain 9(color) 20
58: Label 50: 6(float) Load 49
62: 20(ptr) AccessChain 9(color) 61 53: 6(float) Load 52(d)
63: 6(float) Load 62 54: 17(bool) FOrdLessThan 50 53
64: 6(float) Load 50(d) LoopMerge 47 48 None
65: 16(bool) FOrdLessThan 63 64 BranchConditional 54 46 47
LoopMerge 59 58 None 46: Label
BranchConditional 65 60 59 57: 7(fvec4) Load 56(bigColor)
60: Label 58: 7(fvec4) Load 9(color)
67: 7(fvec4) Load 66(bigColor1_1) 59: 7(fvec4) FAdd 58 57
68: 7(fvec4) Load 9(color) Store 9(color) 59
69: 7(fvec4) FAdd 68 67 Branch 48
Store 9(color) 69 48: Label
71: 20(ptr) AccessChain 9(color) 70 Branch 45
72: 6(float) Load 71 47: Label
73: 6(float) Load 50(d) Branch 60
74: 16(bool) FOrdLessThan 72 73 60: Label
SelectionMerge 76 None 65: 21(ptr) AccessChain 9(color) 64
BranchConditional 74 75 76 66: 6(float) Load 65
75: Label 67: 6(float) Load 52(d)
Branch 58 68: 17(bool) FOrdLessThan 66 67
76: Label LoopMerge 62 63 None
78: 7(fvec4) Load 66(bigColor1_1) BranchConditional 68 61 62
79: 7(fvec4) Load 9(color) 61: Label
80: 7(fvec4) FAdd 79 78 70: 7(fvec4) Load 69(bigColor1_1)
Store 9(color) 80 71: 7(fvec4) Load 9(color)
Branch 58 72: 7(fvec4) FAdd 71 70
59: Label Store 9(color) 72
Branch 81 74: 21(ptr) AccessChain 9(color) 73
81: Label 75: 6(float) Load 74
84: 20(ptr) AccessChain 9(color) 19 76: 6(float) Load 52(d)
85: 6(float) Load 84 77: 17(bool) FOrdLessThan 75 76
87: 16(bool) FOrdLessThan 85 86 SelectionMerge 79 None
LoopMerge 82 81 None BranchConditional 77 78 79
BranchConditional 87 83 82 78: Label
83: Label Branch 63
88: 7(fvec4) Load 9(color) 79: Label
90: 7(fvec4) CompositeConstruct 89 89 89 89 81: 7(fvec4) Load 69(bigColor1_1)
91: 7(fvec4) FAdd 88 90 82: 7(fvec4) Load 9(color)
Store 9(color) 91 83: 7(fvec4) FAdd 82 81
Branch 81 Store 9(color) 83
82: Label Branch 63
Branch 92 63: Label
92: Label Branch 60
95: 20(ptr) AccessChain 9(color) 70 62: Label
96: 6(float) Load 95 Branch 84
98: 6(float) Load 97(d2) 84: Label
99: 16(bool) FOrdLessThan 96 98 88: 21(ptr) AccessChain 9(color) 20
SelectionMerge 101 None 89: 6(float) Load 88
BranchConditional 99 100 101 91: 17(bool) FOrdLessThan 89 90
100: Label LoopMerge 86 87 None
103: 20(ptr) AccessChain 9(color) 102 BranchConditional 91 85 86
104: 6(float) Load 103 85: Label
106: 6(float) Load 105(d3) 92: 7(fvec4) Load 9(color)
107: 16(bool) FOrdLessThan 104 106 94: 7(fvec4) CompositeConstruct 93 93 93 93
Branch 101 95: 7(fvec4) FAdd 92 94
101: Label Store 9(color) 95
108: 16(bool) Phi 99 92 107 100 Branch 87
LoopMerge 93 92 None 87: Label
BranchConditional 108 94 93 Branch 84
94: Label 86: Label
110: 7(fvec4) Load 109(bigColor1_2) Branch 96
111: 7(fvec4) Load 9(color) 96: Label
112: 7(fvec4) FAdd 111 110 100: 21(ptr) AccessChain 9(color) 73
Store 9(color) 112 101: 6(float) Load 100
Branch 92 103: 6(float) Load 102(d2)
93: Label 104: 17(bool) FOrdLessThan 101 103
Branch 113 SelectionMerge 106 None
113: Label BranchConditional 104 105 106
116: 20(ptr) AccessChain 9(color) 61 105: Label
117: 6(float) Load 116 108: 21(ptr) AccessChain 9(color) 107
118: 6(float) Load 105(d3) 109: 6(float) Load 108
119: 16(bool) FOrdLessThan 117 118 111: 6(float) Load 110(d3)
LoopMerge 114 113 None 112: 17(bool) FOrdLessThan 109 111
BranchConditional 119 115 114 Branch 106
115: Label 106: Label
121: 7(fvec4) Load 120(bigColor1_3) 113: 17(bool) Phi 104 96 112 105
122: 7(fvec4) Load 9(color) LoopMerge 98 99 None
123: 7(fvec4) FAdd 122 121 BranchConditional 113 97 98
Store 9(color) 123 97: Label
124: 20(ptr) AccessChain 9(color) 102 115: 7(fvec4) Load 114(bigColor1_2)
125: 6(float) Load 124 116: 7(fvec4) Load 9(color)
127: 6(float) Load 126(d4) 117: 7(fvec4) FAdd 116 115
128: 16(bool) FOrdLessThan 125 127 Store 9(color) 117
SelectionMerge 130 None Branch 99
BranchConditional 128 129 130 99: Label
129: Label Branch 96
Branch 114 98: Label
130: Label Branch 118
132: 7(fvec4) Load 120(bigColor1_3) 118: Label
133: 7(fvec4) Load 9(color) 122: 21(ptr) AccessChain 9(color) 64
134: 7(fvec4) FAdd 133 132 123: 6(float) Load 122
Store 9(color) 134 124: 6(float) Load 110(d3)
Branch 113 125: 17(bool) FOrdLessThan 123 124
114: Label LoopMerge 120 121 None
Store 137(i) 138 BranchConditional 125 119 120
Branch 139 119: Label
139: Label 127: 7(fvec4) Load 126(bigColor1_3)
142: 135(int) Load 137(i) 128: 7(fvec4) Load 9(color)
145: 135(int) Load 144(Count) 129: 7(fvec4) FAdd 128 127
146: 16(bool) SLessThan 142 145 Store 9(color) 129
LoopMerge 140 139 None 130: 21(ptr) AccessChain 9(color) 107
BranchConditional 146 141 140 131: 6(float) Load 130
141: Label 133: 6(float) Load 132(d4)
148: 7(fvec4) Load 147(bigColor2) 134: 17(bool) FOrdLessThan 131 133
149: 7(fvec4) Load 9(color) SelectionMerge 136 None
150: 7(fvec4) FAdd 149 148 BranchConditional 134 135 136
Store 9(color) 150 135: Label
151: 135(int) Load 137(i) Branch 120
153: 135(int) IAdd 151 152 136: Label
Store 137(i) 153 138: 7(fvec4) Load 126(bigColor1_3)
Branch 139 139: 7(fvec4) Load 9(color)
140: Label 140: 7(fvec4) FAdd 139 138
Branch 154 Store 9(color) 140
154: Label Branch 121
157: 16(bool) Phi 17 140 169 156 121: Label
LoopMerge 155 154 None Branch 118
Branch 158 120: Label
158: Label Store 143(i) 144
SelectionMerge 156 None Branch 145
BranchConditional 157 156 159 145: Label
159: Label 149: 141(int) Load 143(i)
160: 20(ptr) AccessChain 9(color) 19 152: 141(int) Load 151(Count)
161: 6(float) Load 160 153: 17(bool) SLessThan 149 152
162: 6(float) Load 97(d2) LoopMerge 147 148 None
163: 16(bool) FOrdLessThan 161 162 BranchConditional 153 146 147
SelectionMerge 164 None 146: Label
BranchConditional 163 164 155 155: 7(fvec4) Load 154(bigColor2)
164: Label 156: 7(fvec4) Load 9(color)
Branch 156 157: 7(fvec4) FAdd 156 155
156: Label Store 9(color) 157
Branch 148
148: Label
158: 141(int) Load 143(i)
160: 141(int) IAdd 158 159
Store 143(i) 160
Branch 145
147: Label
Branch 161
161: Label
LoopMerge 163 164 None
Branch 162
162: Label
166: 7(fvec4) Load 165(bigColor3) 166: 7(fvec4) Load 165(bigColor3)
167: 7(fvec4) Load 9(color) 167: 7(fvec4) Load 9(color)
168: 7(fvec4) FAdd 167 166 168: 7(fvec4) FAdd 167 166
Store 9(color) 168 Store 9(color) 168
Branch 154 Branch 164
155: Label 164: Label
Store 170(i) 138 169: 21(ptr) AccessChain 9(color) 20
Branch 171 170: 6(float) Load 169
171: Label 171: 6(float) Load 102(d2)
174: 135(int) Load 170(i) 172: 17(bool) FOrdLessThan 170 171
176: 16(bool) SLessThan 174 175 BranchConditional 172 161 163
LoopMerge 172 171 None 163: Label
BranchConditional 176 173 172 Store 173(i) 144
173: Label Branch 174
177: 6(float) Load 105(d3) 174: Label
178: 20(ptr) AccessChain 9(color) 61 178: 141(int) Load 173(i)
179: 6(float) Load 178 180: 17(bool) SLessThan 178 179
180: 6(float) FAdd 179 177 LoopMerge 176 177 None
181: 20(ptr) AccessChain 9(color) 61 BranchConditional 180 175 176
Store 181 180 175: Label
182: 135(int) Load 170(i) 181: 6(float) Load 110(d3)
183: 135(int) IAdd 182 152 182: 21(ptr) AccessChain 9(color) 64
Store 170(i) 183 183: 6(float) Load 182
Branch 171 184: 6(float) FAdd 183 181
172: Label 185: 21(ptr) AccessChain 9(color) 64
Store 184(i) 138 Store 185 184
Branch 185 Branch 177
185: Label 177: Label
188: 135(int) Load 184(i) 186: 141(int) Load 173(i)
190: 16(bool) SLessThan 188 189 187: 141(int) IAdd 186 159
LoopMerge 186 185 None Store 173(i) 187
BranchConditional 190 187 186 Branch 174
187: Label 176: Label
191: 20(ptr) AccessChain 9(color) 61 Store 188(i) 144
192: 6(float) Load 191 Branch 189
194: 16(bool) FOrdLessThan 192 193 189: Label
SelectionMerge 196 None 193: 141(int) Load 188(i)
BranchConditional 194 195 200 195: 17(bool) SLessThan 193 194
195: Label LoopMerge 191 192 None
197: 20(ptr) AccessChain 9(color) 19 BranchConditional 195 190 191
198: 6(float) Load 197 190: Label
199: 6(float) FAdd 198 89 196: 21(ptr) AccessChain 9(color) 64
Store 197 199 197: 6(float) Load 196
Branch 196 199: 17(bool) FOrdLessThan 197 198
SelectionMerge 201 None
BranchConditional 199 200 205
200: Label 200: Label
201: 20(ptr) AccessChain 9(color) 102 202: 21(ptr) AccessChain 9(color) 20
202: 6(float) Load 201 203: 6(float) Load 202
203: 6(float) FAdd 202 89 204: 6(float) FAdd 203 93
Store 201 203 Store 202 204
Branch 196 Branch 201
196: Label 205: Label
204: 20(ptr) AccessChain 9(color) 70 206: 21(ptr) AccessChain 9(color) 107
205: 6(float) Load 204 207: 6(float) Load 206
206: 16(bool) FOrdLessThan 205 193 208: 6(float) FAdd 207 93
SelectionMerge 208 None Store 206 208
BranchConditional 206 207 208 Branch 201
207: Label 201: Label
209: 20(ptr) AccessChain 9(color) 61 209: 21(ptr) AccessChain 9(color) 73
210: 6(float) Load 209 210: 6(float) Load 209
211: 20(ptr) AccessChain 9(color) 102 211: 17(bool) FOrdLessThan 210 198
212: 6(float) Load 211 SelectionMerge 213 None
213: 16(bool) FOrdGreaterThan 210 212 BranchConditional 211 212 213
SelectionMerge 215 None 212: Label
BranchConditional 213 214 215 214: 21(ptr) AccessChain 9(color) 64
214: Label 215: 6(float) Load 214
Branch 215 216: 21(ptr) AccessChain 9(color) 107
215: Label 217: 6(float) Load 216
Branch 208 218: 17(bool) FOrdGreaterThan 215 217
208: Label SelectionMerge 220 None
216: 135(int) Load 184(i) BranchConditional 218 219 220
217: 135(int) IAdd 216 152 219: Label
Store 184(i) 217 Branch 220
Branch 185 220: Label
186: Label Branch 213
Store 218(i) 138 213: Label
Branch 219 Branch 192
219: Label 192: Label
222: 135(int) Load 218(i) 221: 141(int) Load 188(i)
224: 16(bool) SLessThan 222 223 222: 141(int) IAdd 221 159
LoopMerge 220 219 None Store 188(i) 222
BranchConditional 224 221 220 Branch 189
221: Label 191: Label
225: 20(ptr) AccessChain 9(color) 61 Store 223(i) 144
226: 6(float) Load 225 Branch 224
227: 16(bool) FOrdLessThan 226 193 224: Label
SelectionMerge 229 None 228: 141(int) Load 223(i)
BranchConditional 227 228 233 230: 17(bool) SLessThan 228 229
228: Label LoopMerge 226 227 None
230: 20(ptr) AccessChain 9(color) 19 BranchConditional 230 225 226
231: 6(float) Load 230 225: Label
232: 6(float) FAdd 231 89 231: 21(ptr) AccessChain 9(color) 64
Store 230 232 232: 6(float) Load 231
Branch 229 233: 17(bool) FOrdLessThan 232 198
233: Label SelectionMerge 235 None
234: 20(ptr) AccessChain 9(color) 102 BranchConditional 233 234 239
235: 6(float) Load 234 234: Label
236: 6(float) FAdd 235 89 236: 21(ptr) AccessChain 9(color) 20
Store 234 236 237: 6(float) Load 236
Branch 229 238: 6(float) FAdd 237 93
229: Label Store 236 238
237: 135(int) Load 218(i) Branch 235
238: 135(int) IAdd 237 152 239: Label
Store 218(i) 238 240: 21(ptr) AccessChain 9(color) 107
Branch 219 241: 6(float) Load 240
220: Label 242: 6(float) FAdd 241 93
Store 239(i) 138 Store 240 242
Branch 240 Branch 235
240: Label 235: Label
243: 135(int) Load 239(i) Branch 227
244: 16(bool) SLessThan 243 175 227: Label
LoopMerge 241 240 None 243: 141(int) Load 223(i)
BranchConditional 244 242 241 244: 141(int) IAdd 243 159
242: Label Store 223(i) 244
245: 6(float) Load 105(d3) Branch 224
246: 20(ptr) AccessChain 9(color) 61 226: Label
247: 6(float) Load 246 Store 245(i) 144
248: 6(float) FAdd 247 245 Branch 246
249: 20(ptr) AccessChain 9(color) 61 246: Label
Store 249 248 250: 141(int) Load 245(i)
250: 20(ptr) AccessChain 9(color) 19 251: 17(bool) SLessThan 250 179
251: 6(float) Load 250 LoopMerge 248 249 None
252: 6(float) Load 126(d4) BranchConditional 251 247 248
253: 16(bool) FOrdLessThan 251 252 247: Label
SelectionMerge 255 None 252: 6(float) Load 110(d3)
BranchConditional 253 254 255 253: 21(ptr) AccessChain 9(color) 64
254: Label 254: 6(float) Load 253
256: 135(int) Load 239(i) 255: 6(float) FAdd 254 252
257: 135(int) IAdd 256 152 256: 21(ptr) AccessChain 9(color) 64
Store 239(i) 257 Store 256 255
Branch 240 257: 21(ptr) AccessChain 9(color) 20
255: Label 258: 6(float) Load 257
259: 20(ptr) AccessChain 9(color) 70 259: 6(float) Load 132(d4)
260: 6(float) Load 259 260: 17(bool) FOrdLessThan 258 259
261: 6(float) FAdd 260 89 SelectionMerge 262 None
Store 259 261 BranchConditional 260 261 262
262: 135(int) Load 239(i) 261: Label
263: 135(int) IAdd 262 152 Branch 249
Store 239(i) 263 262: Label
Branch 240 264: 21(ptr) AccessChain 9(color) 73
241: Label 265: 6(float) Load 264
Store 264(i) 138 266: 6(float) FAdd 265 93
Branch 265 Store 264 266
265: Label Branch 249
268: 135(int) Load 264(i) 249: Label
269: 16(bool) SLessThan 268 175 267: 141(int) Load 245(i)
LoopMerge 266 265 None 268: 141(int) IAdd 267 159
BranchConditional 269 267 266 Store 245(i) 268
267: Label Branch 246
270: 6(float) Load 105(d3) 248: Label
271: 20(ptr) AccessChain 9(color) 61 Store 269(i) 144
272: 6(float) Load 271 Branch 270
273: 6(float) FAdd 272 270 270: Label
274: 20(ptr) AccessChain 9(color) 61 274: 141(int) Load 269(i)
Store 274 273 275: 17(bool) SLessThan 274 179
275: 20(ptr) AccessChain 9(color) 19 LoopMerge 272 273 None
276: 6(float) Load 275 BranchConditional 275 271 272
277: 6(float) Load 126(d4) 271: Label
278: 16(bool) FOrdLessThan 276 277 276: 6(float) Load 110(d3)
SelectionMerge 280 None 277: 21(ptr) AccessChain 9(color) 64
BranchConditional 278 279 280 278: 6(float) Load 277
279: Label 279: 6(float) FAdd 278 276
Branch 266 280: 21(ptr) AccessChain 9(color) 64
280: Label Store 280 279
282: 20(ptr) AccessChain 9(color) 70 281: 21(ptr) AccessChain 9(color) 20
283: 6(float) Load 282 282: 6(float) Load 281
284: 6(float) FAdd 283 89 283: 6(float) Load 132(d4)
Store 282 284 284: 17(bool) FOrdLessThan 282 283
285: 135(int) Load 264(i) SelectionMerge 286 None
286: 135(int) IAdd 285 152 BranchConditional 284 285 286
Store 264(i) 286 285: Label
Branch 265 Branch 272
266: Label 286: Label
Branch 287 288: 21(ptr) AccessChain 9(color) 73
287: Label 289: 6(float) Load 288
290: 16(bool) Phi 17 266 169 306 169 314 290: 6(float) FAdd 289 93
LoopMerge 288 287 None Store 288 290
Branch 291 Branch 273
291: Label 273: Label
SelectionMerge 289 None 291: 141(int) Load 269(i)
BranchConditional 290 289 292 292: 141(int) IAdd 291 159
292: Label Store 269(i) 292
293: 20(ptr) AccessChain 9(color) 61 Branch 270
294: 6(float) Load 293 272: Label
295: 6(float) Load 126(d4) Branch 293
296: 16(bool) FOrdLessThan 294 295 293: Label
SelectionMerge 297 None LoopMerge 295 296 None
BranchConditional 296 297 288 Branch 294
297: Label 294: Label
Branch 289 298: 7(fvec4) Load 297(bigColor4)
289: Label 299: 7(fvec4) Load 9(color)
299: 7(fvec4) Load 298(bigColor4) 300: 7(fvec4) FAdd 299 298
300: 7(fvec4) Load 9(color) Store 9(color) 300
301: 7(fvec4) FAdd 300 299 301: 21(ptr) AccessChain 9(color) 20
Store 9(color) 301 302: 6(float) Load 301
302: 20(ptr) AccessChain 9(color) 19 303: 6(float) Load 132(d4)
303: 6(float) Load 302 304: 17(bool) FOrdLessThan 302 303
304: 6(float) Load 126(d4) SelectionMerge 306 None
305: 16(bool) FOrdLessThan 303 304 BranchConditional 304 305 306
SelectionMerge 307 None 305: Label
BranchConditional 305 306 307 Branch 296
306: Label 306: Label
Branch 287 308: 21(ptr) AccessChain 9(color) 107
307: Label 309: 6(float) Load 308
309: 20(ptr) AccessChain 9(color) 102 310: 6(float) Load 132(d4)
310: 6(float) Load 309 311: 17(bool) FOrdLessThan 309 310
311: 6(float) Load 126(d4) SelectionMerge 313 None
312: 16(bool) FOrdLessThan 310 311 BranchConditional 311 312 319
SelectionMerge 314 None 312: Label
BranchConditional 312 313 320 314: 6(float) Load 132(d4)
313: Label 315: 21(ptr) AccessChain 9(color) 107
315: 6(float) Load 126(d4) 316: 6(float) Load 315
316: 20(ptr) AccessChain 9(color) 102 317: 6(float) FAdd 316 314
317: 6(float) Load 316 318: 21(ptr) AccessChain 9(color) 107
318: 6(float) FAdd 317 315 Store 318 317
319: 20(ptr) AccessChain 9(color) 102 Branch 313
Store 319 318 319: Label
Branch 314 320: 6(float) Load 132(d4)
320: Label 321: 21(ptr) AccessChain 9(color) 20
321: 6(float) Load 126(d4) 322: 6(float) Load 321
322: 20(ptr) AccessChain 9(color) 19 323: 6(float) FAdd 322 320
323: 6(float) Load 322 324: 21(ptr) AccessChain 9(color) 20
324: 6(float) FAdd 323 321 Store 324 323
325: 20(ptr) AccessChain 9(color) 19 Branch 313
Store 325 324 313: Label
Branch 314 Branch 296
314: Label 296: Label
Branch 287 325: 21(ptr) AccessChain 9(color) 64
288: Label 326: 6(float) Load 325
Branch 326 327: 6(float) Load 132(d4)
326: Label 328: 17(bool) FOrdLessThan 326 327
329: 16(bool) Phi 17 288 169 347 BranchConditional 328 293 295
LoopMerge 327 326 None 295: Label
Branch 329
329: Label
LoopMerge 331 332 None
Branch 330 Branch 330
330: Label 330: Label
SelectionMerge 328 None 334: 7(fvec4) Load 333(bigColor5)
BranchConditional 329 328 331 335: 7(fvec4) Load 9(color)
331: Label 336: 7(fvec4) FAdd 335 334
332: 20(ptr) AccessChain 9(color) 19 Store 9(color) 336
333: 6(float) Load 332 337: 21(ptr) AccessChain 9(color) 107
335: 6(float) Load 334(d5) 338: 6(float) Load 337
336: 16(bool) FOrdLessThan 333 335 340: 6(float) Load 339(d5)
SelectionMerge 337 None 341: 17(bool) FOrdLessThan 338 340
BranchConditional 336 337 327 SelectionMerge 343 None
337: Label BranchConditional 341 342 343
Branch 328 342: Label
328: Label 344: 6(float) Load 339(d5)
339: 7(fvec4) Load 338(bigColor5) 345: 21(ptr) AccessChain 9(color) 107
340: 7(fvec4) Load 9(color) 346: 6(float) Load 345
341: 7(fvec4) FAdd 340 339 347: 6(float) FAdd 346 344
Store 9(color) 341 348: 21(ptr) AccessChain 9(color) 107
342: 20(ptr) AccessChain 9(color) 102 Store 348 347
343: 6(float) Load 342 Branch 343
344: 6(float) Load 334(d5) 343: Label
345: 16(bool) FOrdLessThan 343 344 Branch 332
SelectionMerge 347 None 332: Label
BranchConditional 345 346 347 349: 21(ptr) AccessChain 9(color) 20
346: Label 350: 6(float) Load 349
348: 6(float) Load 334(d5) 351: 6(float) Load 339(d5)
349: 20(ptr) AccessChain 9(color) 102 352: 17(bool) FOrdLessThan 350 351
350: 6(float) Load 349 BranchConditional 352 329 331
351: 6(float) FAdd 350 348 331: Label
352: 20(ptr) AccessChain 9(color) 102 353: 21(ptr) AccessChain 9(color) 20
Store 352 351
Branch 347
347: Label
Branch 326
327: Label
353: 20(ptr) AccessChain 9(color) 19
354: 6(float) Load 353 354: 6(float) Load 353
356: 6(float) Load 355(d6) 356: 6(float) Load 355(d6)
357: 16(bool) FOrdLessThan 354 356 357: 17(bool) FOrdLessThan 354 356
SelectionMerge 359 None SelectionMerge 359 None
BranchConditional 357 358 371 BranchConditional 357 358 372
358: Label 358: Label
Branch 360 Branch 360
360: Label 360: Label
363: 20(ptr) AccessChain 9(color) 102 364: 21(ptr) AccessChain 9(color) 107
364: 6(float) Load 363 365: 6(float) Load 364
365: 6(float) Load 355(d6) 366: 6(float) Load 355(d6)
366: 16(bool) FOrdLessThan 364 365 367: 17(bool) FOrdLessThan 365 366
LoopMerge 361 360 None LoopMerge 362 363 None
BranchConditional 366 362 361 BranchConditional 367 361 362
362: Label 361: Label
368: 7(fvec4) Load 367(bigColor6) 369: 7(fvec4) Load 368(bigColor6)
369: 7(fvec4) Load 9(color) 370: 7(fvec4) Load 9(color)
370: 7(fvec4) FAdd 369 368 371: 7(fvec4) FAdd 370 369
Store 9(color) 370 Store 9(color) 371
Branch 363
363: Label
Branch 360 Branch 360
361: Label 362: Label
Branch 359 Branch 359
371: Label
Branch 372
372: Label 372: Label
375: 20(ptr) AccessChain 9(color) 61 Branch 373
376: 6(float) Load 375 373: Label
377: 6(float) Load 355(d6) 377: 21(ptr) AccessChain 9(color) 64
378: 16(bool) FOrdLessThan 376 377 378: 6(float) Load 377
LoopMerge 373 372 None 379: 6(float) Load 355(d6)
BranchConditional 378 374 373 380: 17(bool) FOrdLessThan 378 379
LoopMerge 375 376 None
BranchConditional 380 374 375
374: Label 374: Label
379: 49(ptr) AccessChain 367(bigColor6) 61 381: 51(ptr) AccessChain 368(bigColor6) 64
380: 6(float) Load 379
381: 20(ptr) AccessChain 9(color) 61
382: 6(float) Load 381 382: 6(float) Load 381
383: 6(float) FAdd 382 380 383: 21(ptr) AccessChain 9(color) 64
384: 20(ptr) AccessChain 9(color) 61 384: 6(float) Load 383
Store 384 383 385: 6(float) FAdd 384 382
Branch 372 386: 21(ptr) AccessChain 9(color) 64
373: Label Store 386 385
Branch 376
376: Label
Branch 373
375: Label
Branch 359 Branch 359
359: Label 359: Label
385: 20(ptr) AccessChain 9(color) 19 387: 21(ptr) AccessChain 9(color) 20
386: 6(float) Load 385 388: 6(float) Load 387
387: 6(float) Load 355(d6) 389: 6(float) Load 355(d6)
388: 16(bool) FOrdLessThan 386 387 390: 17(bool) FOrdLessThan 388 389
SelectionMerge 390 None SelectionMerge 392 None
BranchConditional 388 389 407 BranchConditional 390 391 410
389: Label
Branch 391
391: Label 391: Label
394: 20(ptr) AccessChain 9(color) 102 Branch 393
395: 6(float) Load 394 393: Label
396: 6(float) Load 355(d6) 397: 21(ptr) AccessChain 9(color) 107
397: 16(bool) FOrdLessThan 395 396 398: 6(float) Load 397
LoopMerge 392 391 None 399: 6(float) Load 355(d6)
BranchConditional 397 393 392 400: 17(bool) FOrdLessThan 398 399
393: Label LoopMerge 395 396 None
398: 7(fvec4) Load 367(bigColor6) BranchConditional 400 394 395
399: 7(fvec4) Load 9(color) 394: Label
400: 7(fvec4) FAdd 399 398 401: 7(fvec4) Load 368(bigColor6)
Store 9(color) 400 402: 7(fvec4) Load 9(color)
402: 6(float) Load 401(d7) 403: 7(fvec4) FAdd 402 401
403: 16(bool) FOrdLessThan 402 89 Store 9(color) 403
SelectionMerge 405 None 405: 6(float) Load 404(d7)
BranchConditional 403 404 405 406: 17(bool) FOrdLessThan 405 93
404: Label SelectionMerge 408 None
Branch 392 BranchConditional 406 407 408
405: Label 407: Label
Branch 391 Branch 395
392: Label 408: Label
Branch 390 Branch 396
407: Label 396: Label
Branch 408 Branch 393
408: Label 395: Label
411: 20(ptr) AccessChain 9(color) 61 Branch 392
412: 6(float) Load 411 410: Label
413: 6(float) Load 355(d6) Branch 411
414: 16(bool) FOrdLessThan 412 413 411: Label
LoopMerge 409 408 None 415: 21(ptr) AccessChain 9(color) 64
BranchConditional 414 410 409 416: 6(float) Load 415
410: Label 417: 6(float) Load 355(d6)
415: 49(ptr) AccessChain 367(bigColor6) 61 418: 17(bool) FOrdLessThan 416 417
416: 6(float) Load 415 LoopMerge 413 414 None
417: 20(ptr) AccessChain 9(color) 61 BranchConditional 418 412 413
418: 6(float) Load 417 412: Label
419: 6(float) FAdd 418 416 419: 51(ptr) AccessChain 368(bigColor6) 64
420: 20(ptr) AccessChain 9(color) 61 420: 6(float) Load 419
Store 420 419 421: 21(ptr) AccessChain 9(color) 64
Branch 408 422: 6(float) Load 421
409: Label 423: 6(float) FAdd 422 420
Branch 390 424: 21(ptr) AccessChain 9(color) 64
390: Label Store 424 423
Branch 421 Branch 414
421: Label 414: Label
424: 16(bool) Phi 17 390 169 441 Branch 411
LoopMerge 422 421 None 413: Label
Branch 392
392: Label
Branch 425 Branch 425
425: Label 425: Label
SelectionMerge 423 None LoopMerge 427 428 None
BranchConditional 424 423 426 Branch 426
426: Label 426: Label
SelectionMerge 427 None 429: 6(float) Load 404(d7)
BranchConditional 17 427 422 431: 17(bool) FOrdLessThan 429 430
427: Label SelectionMerge 433 None
Branch 423 BranchConditional 431 432 433
423: Label 432: Label
428: 6(float) Load 401(d7) Branch 427
430: 16(bool) FOrdLessThan 428 429 433: Label
SelectionMerge 432 None 436: 7(fvec4) Load 435(bigColor7)
BranchConditional 430 431 432 437: 7(fvec4) Load 9(color)
431: Label 438: 7(fvec4) FAdd 437 436
Branch 422 Store 9(color) 438
432: Label 439: 6(float) Load 404(d7)
435: 7(fvec4) Load 434(bigColor7) 440: 17(bool) FOrdLessThan 439 93
436: 7(fvec4) Load 9(color) SelectionMerge 442 None
437: 7(fvec4) FAdd 436 435 BranchConditional 440 441 442
Store 9(color) 437 441: Label
438: 6(float) Load 401(d7) 443: 21(ptr) AccessChain 9(color) 64
439: 16(bool) FOrdLessThan 438 89 444: 6(float) Load 443
SelectionMerge 441 None 445: 6(float) FAdd 444 93
BranchConditional 439 440 441 Store 443 445
440: Label Branch 427
442: 20(ptr) AccessChain 9(color) 61 442: Label
443: 6(float) Load 442 447: 7(fvec4) Load 11(BaseColor)
444: 6(float) FAdd 443 89 448: 7(fvec4) Load 9(color)
Store 442 444 449: 7(fvec4) FAdd 448 447
Branch 422 Store 9(color) 449
441: Label Branch 428
446: 7(fvec4) Load 11(BaseColor) 428: Label
447: 7(fvec4) Load 9(color) BranchConditional 18 425 427
448: 7(fvec4) FAdd 447 446 427: Label
Store 9(color) 448 Branch 450
Branch 421 450: Label
422: Label LoopMerge 452 453 None
Branch 449 Branch 451
449: Label 451: Label
452: 16(bool) Phi 17 422 169 472 455: 6(float) Load 454(d8)
LoopMerge 450 449 None 456: 17(bool) FOrdLessThan 455 430
SelectionMerge 458 None
BranchConditional 456 457 458
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 Branch 453
453: Label 453: Label
SelectionMerge 451 None 486: 21(ptr) AccessChain 9(color) 64
BranchConditional 452 451 454 487: 6(float) Load 486
454: Label 488: 6(float) Load 454(d8)
455: 20(ptr) AccessChain 9(color) 61 489: 17(bool) FOrdLessThan 487 488
456: 6(float) Load 455 BranchConditional 489 450 452
458: 6(float) Load 457(d8) 452: Label
459: 16(bool) FOrdLessThan 456 458 Branch 490
SelectionMerge 460 None 490: Label
BranchConditional 459 460 450 494: 21(ptr) AccessChain 9(color) 73
460: Label 495: 6(float) Load 494
Branch 451 497: 6(float) Load 496(d9)
451: Label 498: 17(bool) FOrdLessThan 495 497
461: 6(float) Load 457(d8) LoopMerge 492 493 None
462: 16(bool) FOrdLessThan 461 429 BranchConditional 498 491 492
SelectionMerge 464 None 491: Label
BranchConditional 462 463 464 499: 6(float) Load 496(d9)
463: Label 500: 6(float) Load 454(d8)
Branch 450 501: 17(bool) FOrdGreaterThan 499 500
464: Label SelectionMerge 503 None
466: 7(fvec4) Load 434(bigColor7) BranchConditional 501 502 503
467: 7(fvec4) Load 9(color) 502: Label
468: 7(fvec4) FAdd 467 466 504: 21(ptr) AccessChain 9(color) 20
Store 9(color) 468 505: 6(float) Load 504
469: 6(float) Load 457(d8) 506: 6(float) Load 404(d7)
470: 16(bool) FOrdLessThan 469 89 507: 17(bool) FOrdLessThanEqual 505 506
SelectionMerge 472 None SelectionMerge 509 None
BranchConditional 470 471 472 BranchConditional 507 508 509
471: Label 508: Label
473: 20(ptr) AccessChain 9(color) 61 510: 21(ptr) AccessChain 9(color) 64
474: 6(float) Load 473 511: 6(float) Load 510
475: 6(float) FAdd 474 89 513: 17(bool) FOrdEqual 511 512
Store 473 475 SelectionMerge 515 None
476: 6(float) Load 457(d8) BranchConditional 513 514 519
478: 16(bool) FOrdLessThan 476 477 514: Label
SelectionMerge 480 None 516: 21(ptr) AccessChain 9(color) 73
BranchConditional 478 479 484 517: 6(float) Load 516
479: Label 518: 6(float) FAdd 517 93
481: 20(ptr) AccessChain 9(color) 102 Store 516 518
482: 6(float) Load 481 Branch 515
483: 6(float) FAdd 482 89 519: Label
Store 481 483 Branch 492
Branch 480 515: Label
484: Label Branch 509
485: 20(ptr) AccessChain 9(color) 19 509: Label
486: 6(float) Load 485 Branch 503
487: 6(float) FAdd 486 89 503: Label
Store 485 487 Branch 493
Branch 480 493: Label
480: Label Branch 490
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 492: Label
495: 20(ptr) AccessChain 9(color) 70 Branch 521
496: 6(float) Load 495 521: Label
498: 6(float) Load 497(d9) 525: 21(ptr) AccessChain 9(color) 64
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 526: 6(float) Load 525
528: 6(float) Load 527(d10) 528: 6(float) Load 527(d10)
529: 16(bool) FOrdLessThan 526 528 529: 17(bool) FOrdLessThan 526 528
LoopMerge 523 522 None LoopMerge 523 524 None
BranchConditional 529 524 523 BranchConditional 529 522 523
524: Label 522: Label
530: 20(ptr) AccessChain 9(color) 102 530: 21(ptr) AccessChain 9(color) 107
531: 6(float) Load 530 531: 6(float) Load 530
532: 6(float) FAdd 531 89 532: 6(float) FAdd 531 93
Store 530 532 Store 530 532
533: 20(ptr) AccessChain 9(color) 102 533: 21(ptr) AccessChain 9(color) 107
534: 6(float) Load 533 534: 6(float) Load 533
536: 6(float) Load 535(d11) 536: 6(float) Load 535(d11)
537: 16(bool) FOrdLessThan 534 536 537: 17(bool) FOrdLessThan 534 536
SelectionMerge 539 None SelectionMerge 539 None
BranchConditional 537 538 539 BranchConditional 537 538 539
538: Label 538: Label
540: 20(ptr) AccessChain 9(color) 61 540: 21(ptr) AccessChain 9(color) 64
541: 6(float) Load 540 541: 6(float) Load 540
542: 6(float) FAdd 541 89 542: 6(float) FAdd 541 93
Store 540 542 Store 540 542
543: 20(ptr) AccessChain 9(color) 70 543: 21(ptr) AccessChain 9(color) 73
544: 6(float) Load 543 544: 6(float) Load 543
546: 6(float) Load 545(d12) 546: 6(float) Load 545(d12)
547: 16(bool) FOrdLessThan 544 546 547: 17(bool) FOrdLessThan 544 546
SelectionMerge 549 None SelectionMerge 549 None
BranchConditional 547 548 553 BranchConditional 547 548 553
548: Label 548: Label
550: 20(ptr) AccessChain 9(color) 70 550: 21(ptr) AccessChain 9(color) 73
551: 6(float) Load 550 551: 6(float) Load 550
552: 6(float) FAdd 551 89 552: 6(float) FAdd 551 93
Store 550 552 Store 550 552
Branch 549 Branch 549
553: Label 553: Label
554: 20(ptr) AccessChain 9(color) 19 554: 21(ptr) AccessChain 9(color) 20
555: 6(float) Load 554 555: 6(float) Load 554
556: 6(float) FAdd 555 89 556: 6(float) FAdd 555 93
Store 554 556 Store 554 556
Branch 549 Branch 549
549: Label 549: Label
Branch 522 Branch 524
539: Label 539: Label
558: 7(fvec4) Load 9(color) 558: 7(fvec4) Load 9(color)
559: 7(fvec4) CompositeConstruct 89 89 89 89 559: 7(fvec4) CompositeConstruct 93 93 93 93
560: 7(fvec4) FAdd 558 559 560: 7(fvec4) FAdd 558 559
Store 9(color) 560 Store 9(color) 560
Branch 523 Branch 523
524: Label
Branch 521
523: Label 523: Label
Branch 562 Branch 562
562: Label 562: Label
565: 20(ptr) AccessChain 9(color) 19 566: 21(ptr) AccessChain 9(color) 20
566: 6(float) Load 565 567: 6(float) Load 566
568: 16(bool) FOrdLessThan 566 567 569: 17(bool) FOrdLessThan 567 568
LoopMerge 563 562 None LoopMerge 564 565 None
BranchConditional 568 564 563 BranchConditional 569 563 564
564: Label 563: Label
570: 7(fvec4) Load 569(bigColor8) 571: 7(fvec4) Load 570(bigColor8)
571: 7(fvec4) Load 9(color) 572: 7(fvec4) Load 9(color)
572: 7(fvec4) FAdd 571 570 573: 7(fvec4) FAdd 572 571
Store 9(color) 572 Store 9(color) 573
573: 20(ptr) AccessChain 9(color) 61 574: 21(ptr) AccessChain 9(color) 64
574: 6(float) Load 573 575: 6(float) Load 574
575: 6(float) Load 457(d8) 576: 6(float) Load 454(d8)
576: 16(bool) FOrdLessThan 574 575 577: 17(bool) FOrdLessThan 575 576
SelectionMerge 578 None SelectionMerge 579 None
BranchConditional 576 577 578 BranchConditional 577 578 579
577: Label 578: Label
579: 20(ptr) AccessChain 9(color) 70 580: 21(ptr) AccessChain 9(color) 73
580: 6(float) Load 579 581: 6(float) Load 580
581: 6(float) Load 355(d6) 582: 6(float) Load 355(d6)
582: 16(bool) FOrdLessThan 580 581 583: 17(bool) FOrdLessThan 581 582
SelectionMerge 584 None SelectionMerge 585 None
BranchConditional 582 583 584 BranchConditional 583 584 585
583: Label 584: Label
Branch 562 Branch 565
584: Label 585: Label
Branch 578 Branch 579
578: Label 579: Label
586: 49(ptr) AccessChain 569(bigColor8) 19 587: 51(ptr) AccessChain 570(bigColor8) 20
587: 6(float) Load 586 588: 6(float) Load 587
588: 20(ptr) AccessChain 9(color) 102 589: 21(ptr) AccessChain 9(color) 107
589: 6(float) Load 588 590: 6(float) Load 589
590: 6(float) FAdd 589 587 591: 6(float) FAdd 590 588
591: 20(ptr) AccessChain 9(color) 102 592: 21(ptr) AccessChain 9(color) 107
Store 591 590 Store 592 591
Branch 565
565: Label
Branch 562 Branch 562
563: Label 564: Label
592: 7(fvec4) Load 9(color) 593: 7(fvec4) Load 9(color)
593: 7(fvec4) CompositeConstruct 89 89 89 89 594: 7(fvec4) CompositeConstruct 93 93 93 93
594: 7(fvec4) FAdd 592 593 595: 7(fvec4) FAdd 593 594
Store 9(color) 594 Store 9(color) 595
597: 7(fvec4) Load 9(color) 598: 7(fvec4) Load 9(color)
Store 596(gl_FragColor) 597 Store 597(gl_FragColor) 598
Branch 598 Branch 599
598: Label 599: Label
601: 20(ptr) AccessChain 9(color) 19 603: 21(ptr) AccessChain 9(color) 20
602: 6(float) Load 601 604: 6(float) Load 603
604: 6(float) Load 603(d14) 606: 6(float) Load 605(d14)
605: 16(bool) FOrdLessThan 602 604 607: 17(bool) FOrdLessThan 604 606
LoopMerge 599 598 None LoopMerge 601 602 None
BranchConditional 605 600 599 BranchConditional 607 600 601
600: Label 600: Label
606: 20(ptr) AccessChain 9(color) 102 608: 21(ptr) AccessChain 9(color) 107
607: 6(float) Load 606 609: 6(float) Load 608
609: 6(float) Load 608(d15) 611: 6(float) Load 610(d15)
610: 16(bool) FOrdLessThan 607 609 612: 17(bool) FOrdLessThan 609 611
SelectionMerge 612 None SelectionMerge 614 None
BranchConditional 610 611 614 BranchConditional 612 613 616
611: Label 613: Label
Return Return
614: Label 616: Label
615: 7(fvec4) Load 9(color) 617: 7(fvec4) Load 9(color)
616: 7(fvec4) CompositeConstruct 89 89 89 89 618: 7(fvec4) CompositeConstruct 93 93 93 93
617: 7(fvec4) FAdd 615 616 619: 7(fvec4) FAdd 617 618
Store 9(color) 617 Store 9(color) 619
Branch 612 Branch 614
612: Label 614: Label
Branch 598 Branch 602
599: Label 602: Label
618: 7(fvec4) Load 9(color) Branch 599
619: 7(fvec4) CompositeConstruct 89 89 89 89 601: Label
620: 7(fvec4) FAdd 618 619 620: 7(fvec4) Load 9(color)
Store 9(color) 620 621: 7(fvec4) CompositeConstruct 93 93 93 93
Branch 621 622: 7(fvec4) FAdd 620 621
621: Label Store 9(color) 622
624: 20(ptr) AccessChain 9(color) 70 Branch 623
625: 6(float) Load 624 623: Label
627: 6(float) Load 626(d16) 627: 21(ptr) AccessChain 9(color) 73
628: 16(bool) FOrdLessThan 625 627 628: 6(float) Load 627
LoopMerge 622 621 None 630: 6(float) Load 629(d16)
BranchConditional 628 623 622 631: 17(bool) FOrdLessThan 628 630
623: Label LoopMerge 625 626 None
629: 20(ptr) AccessChain 9(color) 70 BranchConditional 631 624 625
630: 6(float) Load 629 624: Label
631: 6(float) FAdd 630 89 632: 21(ptr) AccessChain 9(color) 73
Store 629 631 633: 6(float) Load 632
Branch 621 634: 6(float) FAdd 633 93
622: Label Store 632 634
Branch 632 Branch 626
632: Label 626: Label
635: 20(ptr) AccessChain 9(color) 70 Branch 623
636: 6(float) Load 635 625: Label
637: 6(float) Load 97(d2) Branch 635
638: 16(bool) FOrdLessThan 636 637 635: Label
SelectionMerge 640 None 639: 21(ptr) AccessChain 9(color) 73
BranchConditional 638 639 640 640: 6(float) Load 639
639: Label 641: 6(float) Load 102(d2)
641: 20(ptr) AccessChain 9(color) 102 642: 17(bool) FOrdLessThan 640 641
642: 6(float) Load 641 SelectionMerge 644 None
643: 6(float) Load 105(d3) BranchConditional 642 643 644
644: 16(bool) FOrdLessThan 642 643 643: Label
Branch 640 645: 21(ptr) AccessChain 9(color) 107
640: Label 646: 6(float) Load 645
645: 16(bool) Phi 638 632 644 639 647: 6(float) Load 110(d3)
LoopMerge 633 632 None 648: 17(bool) FOrdLessThan 646 647
BranchConditional 645 634 633 Branch 644
634: Label 644: Label
646: 7(fvec4) Load 109(bigColor1_2) 649: 17(bool) Phi 642 635 648 643
647: 7(fvec4) Load 9(color) LoopMerge 637 638 None
648: 7(fvec4) FAdd 647 646 BranchConditional 649 636 637
Store 9(color) 648 636: Label
649: 20(ptr) AccessChain 9(color) 61 650: 7(fvec4) Load 114(bigColor1_2)
650: 6(float) Load 649 651: 7(fvec4) Load 9(color)
651: 6(float) Load 105(d3) 652: 7(fvec4) FAdd 651 650
652: 16(bool) FOrdLessThan 650 651 Store 9(color) 652
SelectionMerge 654 None 653: 21(ptr) AccessChain 9(color) 64
BranchConditional 652 653 654 654: 6(float) Load 653
653: Label 655: 6(float) Load 110(d3)
656: 17(bool) FOrdLessThan 654 655
SelectionMerge 658 None
BranchConditional 656 657 658
657: Label
Return Return
654: Label 658: Label
Branch 632 Branch 638
633: Label 638: Label
Branch 656 Branch 635
656: Label 637: Label
659: 16(bool) Phi 17 633 169 674
LoopMerge 657 656 None
Branch 660 Branch 660
660: Label 660: Label
SelectionMerge 658 None LoopMerge 662 663 None
BranchConditional 659 658 661 Branch 661
661: Label 661: Label
662: 20(ptr) AccessChain 9(color) 19 664: 21(ptr) AccessChain 9(color) 107
663: 6(float) Load 662 665: 6(float) Load 664
665: 6(float) Load 664(d17) 667: 6(float) Load 666(d18)
666: 16(bool) FOrdLessThan 663 665 668: 17(bool) FOrdLessThan 665 667
SelectionMerge 667 None SelectionMerge 670 None
BranchConditional 666 667 657 BranchConditional 668 669 670
667: Label 669: 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 Return
674: Label 670: Label
676: 7(fvec4) Load 9(color) 672: 7(fvec4) Load 9(color)
677: 7(fvec4) CompositeConstruct 89 89 89 89 673: 7(fvec4) CompositeConstruct 93 93 93 93
678: 7(fvec4) FAdd 676 677 674: 7(fvec4) FAdd 672 673
Store 9(color) 678 Store 9(color) 674
Branch 656 Branch 663
657: Label 663: Label
Branch 679 675: 21(ptr) AccessChain 9(color) 20
679: Label 676: 6(float) Load 675
682: 20(ptr) AccessChain 9(color) 102 678: 6(float) Load 677(d17)
683: 6(float) Load 682 679: 17(bool) FOrdLessThan 676 678
684: 6(float) Load 626(d16) BranchConditional 679 660 662
685: 16(bool) FOrdLessThan 683 684 662: Label
LoopMerge 680 679 None Branch 680
BranchConditional 685 681 680 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 681: Label
686: 20(ptr) AccessChain 9(color) 70 688: 21(ptr) AccessChain 9(color) 73
687: 6(float) Load 686 689: 6(float) Load 688
688: 6(float) Load 626(d16) 690: 6(float) Load 629(d16)
689: 16(bool) FOrdLessThan 687 688 691: 17(bool) FOrdLessThan 689 690
SelectionMerge 691 None SelectionMerge 693 None
BranchConditional 689 690 693 BranchConditional 691 692 695
690: Label 692: Label
Kill Kill
693: Label 695: Label
694: 7(fvec4) Load 9(color) 696: 7(fvec4) Load 9(color)
695: 7(fvec4) CompositeConstruct 89 89 89 89 697: 7(fvec4) CompositeConstruct 93 93 93 93
696: 7(fvec4) FAdd 694 695 698: 7(fvec4) FAdd 696 697
Store 9(color) 696 Store 9(color) 698
Branch 691 Branch 693
691: Label 693: Label
Branch 679 Branch 683
680: Label 683: Label
697: 7(fvec4) Load 9(color) Branch 680
698: 7(fvec4) CompositeConstruct 89 89 89 89 682: Label
699: 7(fvec4) FAdd 697 698 699: 7(fvec4) Load 9(color)
Store 9(color) 699 700: 7(fvec4) CompositeConstruct 93 93 93 93
700: 7(fvec4) Load 9(color) 701: 7(fvec4) FAdd 699 700
Store 596(gl_FragColor) 700 Store 9(color) 701
702: 7(fvec4) Load 9(color)
Store 597(gl_FragColor) 702
Return Return
FunctionEnd FunctionEnd
...@@ -7,64 +7,64 @@ Linked fragment stage: ...@@ -7,64 +7,64 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 191 // Id's are bound by 187
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 144 EntryPoint Fragment 4 "main" 11 140
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 130 Source GLSL 130
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 27 "d4" Name 18 "bigColor4"
Name 32 "bigColor4" Name 28 "d4"
Name 84 "d13" Name 80 "d13"
Name 144 "gl_FragColor" Name 140 "gl_FragColor"
Name 146 "bigColor" Name 142 "bigColor"
Name 147 "bigColor1_1" Name 143 "bigColor1_1"
Name 148 "bigColor1_2" Name 144 "bigColor1_2"
Name 149 "bigColor1_3" Name 145 "bigColor1_3"
Name 150 "bigColor2" Name 146 "bigColor2"
Name 151 "bigColor3" Name 147 "bigColor3"
Name 152 "bigColor5" Name 148 "bigColor5"
Name 153 "bigColor6" Name 149 "bigColor6"
Name 154 "bigColor7" Name 150 "bigColor7"
Name 155 "bigColor8" Name 151 "bigColor8"
Name 156 "d" Name 152 "d"
Name 157 "d2" Name 153 "d2"
Name 158 "d3" Name 154 "d3"
Name 159 "d5" Name 155 "d5"
Name 160 "d6" Name 156 "d6"
Name 161 "d7" Name 157 "d7"
Name 162 "d8" Name 158 "d8"
Name 163 "d9" Name 159 "d9"
Name 164 "d10" Name 160 "d10"
Name 165 "d11" Name 161 "d11"
Name 166 "d12" Name 162 "d12"
Name 167 "d14" Name 163 "d14"
Name 168 "d15" Name 164 "d15"
Name 169 "d16" Name 165 "d16"
Name 170 "d17" Name 166 "d17"
Name 171 "d18" Name 167 "d18"
Name 172 "d19" Name 168 "d19"
Name 173 "d20" Name 169 "d20"
Name 174 "d21" Name 170 "d21"
Name 175 "d22" Name 171 "d22"
Name 176 "d23" Name 172 "d23"
Name 177 "d24" Name 173 "d24"
Name 178 "d25" Name 174 "d25"
Name 179 "d26" Name 175 "d26"
Name 180 "d27" Name 176 "d27"
Name 181 "d28" Name 177 "d28"
Name 182 "d29" Name 178 "d29"
Name 183 "d30" Name 179 "d30"
Name 184 "d31" Name 180 "d31"
Name 185 "d32" Name 181 "d32"
Name 186 "d33" Name 182 "d33"
Name 187 "d34" Name 183 "d34"
Name 190 "Count" Name 186 "Count"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
...@@ -72,69 +72,67 @@ Linked fragment stage: ...@@ -72,69 +72,67 @@ Linked fragment stage:
8: TypePointer Function 7(fvec4) 8: TypePointer Function 7(fvec4)
10: TypePointer Input 7(fvec4) 10: TypePointer Input 7(fvec4)
11(BaseColor): 10(ptr) Variable Input 11(BaseColor): 10(ptr) Variable Input
17: TypeBool 17: TypePointer UniformConstant 7(fvec4)
18: 17(bool) ConstantTrue 18(bigColor4): 17(ptr) Variable UniformConstant
21: TypeInt 32 0 22: TypeInt 32 0
22: 21(int) Constant 2 23: 22(int) Constant 0
23: TypePointer Function 6(float) 24: TypePointer Function 6(float)
26: TypePointer UniformConstant 6(float) 27: TypePointer UniformConstant 6(float)
27(d4): 26(ptr) Variable UniformConstant 28(d4): 27(ptr) Variable UniformConstant
31: TypePointer UniformConstant 7(fvec4) 30: TypeBool
32(bigColor4): 31(ptr) Variable UniformConstant 34: 6(float) Constant 1073741824
36: 21(int) Constant 0 35: 22(int) Constant 2
43: 6(float) Constant 1073741824 48: 6(float) Constant 1065353216
56: 6(float) Constant 1065353216 51: 22(int) Constant 1
58: 17(bool) ConstantFalse 77: 22(int) Constant 3
60: 21(int) Constant 1 80(d13): 27(ptr) Variable UniformConstant
81: 21(int) Constant 3 139: TypePointer Output 7(fvec4)
84(d13): 26(ptr) Variable UniformConstant 140(gl_FragColor): 139(ptr) Variable Output
143: TypePointer Output 7(fvec4) 142(bigColor): 17(ptr) Variable UniformConstant
144(gl_FragColor): 143(ptr) Variable Output 143(bigColor1_1): 17(ptr) Variable UniformConstant
146(bigColor): 31(ptr) Variable UniformConstant 144(bigColor1_2): 17(ptr) Variable UniformConstant
147(bigColor1_1): 31(ptr) Variable UniformConstant 145(bigColor1_3): 17(ptr) Variable UniformConstant
148(bigColor1_2): 31(ptr) Variable UniformConstant 146(bigColor2): 17(ptr) Variable UniformConstant
149(bigColor1_3): 31(ptr) Variable UniformConstant 147(bigColor3): 17(ptr) Variable UniformConstant
150(bigColor2): 31(ptr) Variable UniformConstant 148(bigColor5): 17(ptr) Variable UniformConstant
151(bigColor3): 31(ptr) Variable UniformConstant 149(bigColor6): 17(ptr) Variable UniformConstant
152(bigColor5): 31(ptr) Variable UniformConstant 150(bigColor7): 17(ptr) Variable UniformConstant
153(bigColor6): 31(ptr) Variable UniformConstant 151(bigColor8): 17(ptr) Variable UniformConstant
154(bigColor7): 31(ptr) Variable UniformConstant 152(d): 27(ptr) Variable UniformConstant
155(bigColor8): 31(ptr) Variable UniformConstant 153(d2): 27(ptr) Variable UniformConstant
156(d): 26(ptr) Variable UniformConstant 154(d3): 27(ptr) Variable UniformConstant
157(d2): 26(ptr) Variable UniformConstant 155(d5): 27(ptr) Variable UniformConstant
158(d3): 26(ptr) Variable UniformConstant 156(d6): 27(ptr) Variable UniformConstant
159(d5): 26(ptr) Variable UniformConstant 157(d7): 27(ptr) Variable UniformConstant
160(d6): 26(ptr) Variable UniformConstant 158(d8): 27(ptr) Variable UniformConstant
161(d7): 26(ptr) Variable UniformConstant 159(d9): 27(ptr) Variable UniformConstant
162(d8): 26(ptr) Variable UniformConstant 160(d10): 27(ptr) Variable UniformConstant
163(d9): 26(ptr) Variable UniformConstant 161(d11): 27(ptr) Variable UniformConstant
164(d10): 26(ptr) Variable UniformConstant 162(d12): 27(ptr) Variable UniformConstant
165(d11): 26(ptr) Variable UniformConstant 163(d14): 27(ptr) Variable UniformConstant
166(d12): 26(ptr) Variable UniformConstant 164(d15): 27(ptr) Variable UniformConstant
167(d14): 26(ptr) Variable UniformConstant 165(d16): 27(ptr) Variable UniformConstant
168(d15): 26(ptr) Variable UniformConstant 166(d17): 27(ptr) Variable UniformConstant
169(d16): 26(ptr) Variable UniformConstant 167(d18): 27(ptr) Variable UniformConstant
170(d17): 26(ptr) Variable UniformConstant 168(d19): 27(ptr) Variable UniformConstant
171(d18): 26(ptr) Variable UniformConstant 169(d20): 27(ptr) Variable UniformConstant
172(d19): 26(ptr) Variable UniformConstant 170(d21): 27(ptr) Variable UniformConstant
173(d20): 26(ptr) Variable UniformConstant 171(d22): 27(ptr) Variable UniformConstant
174(d21): 26(ptr) Variable UniformConstant 172(d23): 27(ptr) Variable UniformConstant
175(d22): 26(ptr) Variable UniformConstant 173(d24): 27(ptr) Variable UniformConstant
176(d23): 26(ptr) Variable UniformConstant 174(d25): 27(ptr) Variable UniformConstant
177(d24): 26(ptr) Variable UniformConstant 175(d26): 27(ptr) Variable UniformConstant
178(d25): 26(ptr) Variable UniformConstant 176(d27): 27(ptr) Variable UniformConstant
179(d26): 26(ptr) Variable UniformConstant 177(d28): 27(ptr) Variable UniformConstant
180(d27): 26(ptr) Variable UniformConstant 178(d29): 27(ptr) Variable UniformConstant
181(d28): 26(ptr) Variable UniformConstant 179(d30): 27(ptr) Variable UniformConstant
182(d29): 26(ptr) Variable UniformConstant 180(d31): 27(ptr) Variable UniformConstant
183(d30): 26(ptr) Variable UniformConstant 181(d32): 27(ptr) Variable UniformConstant
184(d31): 26(ptr) Variable UniformConstant 182(d33): 27(ptr) Variable UniformConstant
185(d32): 26(ptr) Variable UniformConstant 183(d34): 27(ptr) Variable UniformConstant
186(d33): 26(ptr) Variable UniformConstant 184: TypeInt 32 1
187(d34): 26(ptr) Variable UniformConstant 185: TypePointer UniformConstant 184(int)
188: TypeInt 32 1 186(Count): 185(ptr) Variable UniformConstant
189: TypePointer UniformConstant 188(int)
190(Count): 189(ptr) Variable UniformConstant
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(color): 8(ptr) Variable Function 9(color): 8(ptr) Variable Function
...@@ -142,167 +140,162 @@ Linked fragment stage: ...@@ -142,167 +140,162 @@ Linked fragment stage:
Store 9(color) 12 Store 9(color) 12
Branch 13 Branch 13
13: Label 13: Label
16: 17(bool) Phi 18 5 58 52 58 66 LoopMerge 15 16 None
LoopMerge 14 13 None Branch 14
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 14: Label
Branch 78 19: 7(fvec4) Load 18(bigColor4)
78: Label 20: 7(fvec4) Load 9(color)
82: 23(ptr) AccessChain 9(color) 81 21: 7(fvec4) FAdd 20 19
83: 6(float) Load 82 Store 9(color) 21
85: 6(float) Load 84(d13) 25: 24(ptr) AccessChain 9(color) 23
86: 17(bool) FOrdLessThan 83 85 26: 6(float) Load 25
LoopMerge 79 78 None 29: 6(float) Load 28(d4)
BranchConditional 86 80 79 31: 30(bool) FOrdLessThan 26 29
80: Label SelectionMerge 33 None
87: 23(ptr) AccessChain 9(color) 22 BranchConditional 31 32 33
88: 6(float) Load 87 32: Label
89: 6(float) Load 84(d13) 36: 24(ptr) AccessChain 9(color) 35
90: 17(bool) FOrdLessThan 88 89 37: 6(float) Load 36
SelectionMerge 92 None 38: 6(float) FAdd 37 34
BranchConditional 90 91 96 39: 24(ptr) AccessChain 9(color) 35
91: Label 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
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
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
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
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) 93: 7(fvec4) Load 9(color)
94: 7(fvec4) CompositeConstruct 56 56 56 56 94: 7(fvec4) CompositeConstruct 48 48 48 48
95: 7(fvec4) FAdd 93 94 95: 7(fvec4) FSub 93 94
Store 9(color) 95 Store 9(color) 95
Branch 92 Branch 88
96: Label 88: Label
97: 7(fvec4) Load 9(color) 96: 7(fvec4) Load 18(bigColor4)
98: 7(fvec4) CompositeConstruct 56 56 56 56 97: 7(fvec4) Load 9(color)
99: 7(fvec4) FSub 97 98 98: 7(fvec4) FAdd 97 96
Store 9(color) 99 Store 9(color) 98
Branch 92 99: 24(ptr) AccessChain 9(color) 23
92: Label 100: 6(float) Load 99
100: 7(fvec4) Load 32(bigColor4) 101: 6(float) Load 28(d4)
101: 7(fvec4) Load 9(color) 102: 30(bool) FOrdLessThan 100 101
102: 7(fvec4) FAdd 101 100 SelectionMerge 104 None
Store 9(color) 102 BranchConditional 102 103 104
103: 23(ptr) AccessChain 9(color) 36 103: Label
104: 6(float) Load 103 105: 24(ptr) AccessChain 9(color) 35
105: 6(float) Load 27(d4) 106: 6(float) Load 105
106: 17(bool) FOrdLessThan 104 105 107: 6(float) FAdd 106 34
SelectionMerge 108 None 108: 24(ptr) AccessChain 9(color) 35
BranchConditional 106 107 108 Store 108 107
107: Label 109: 24(ptr) AccessChain 9(color) 35
109: 23(ptr) AccessChain 9(color) 22
110: 6(float) Load 109 110: 6(float) Load 109
111: 6(float) FAdd 110 43 111: 6(float) Load 28(d4)
112: 23(ptr) AccessChain 9(color) 22 112: 30(bool) FOrdLessThan 110 111
Store 112 111 SelectionMerge 114 None
113: 23(ptr) AccessChain 9(color) 22 BranchConditional 112 113 114
114: 6(float) Load 113 113: Label
115: 6(float) Load 27(d4) 115: 24(ptr) AccessChain 9(color) 23
116: 17(bool) FOrdLessThan 114 115 116: 6(float) Load 115
SelectionMerge 118 None 117: 6(float) FAdd 116 48
BranchConditional 116 117 118 Store 115 117
117: Label Branch 76
119: 23(ptr) AccessChain 9(color) 36 114: Label
120: 6(float) Load 119 Branch 104
121: 6(float) FAdd 120 56 104: Label
Store 119 121 119: 24(ptr) AccessChain 9(color) 51
Branch 78 120: 6(float) Load 119
118: Label 121: 6(float) Load 28(d4)
Branch 108 122: 30(bool) FOrdLessThan 120 121
108: Label SelectionMerge 124 None
123: 23(ptr) AccessChain 9(color) 60 BranchConditional 122 123 130
124: 6(float) Load 123 123: Label
125: 6(float) Load 27(d4) 125: 6(float) Load 28(d4)
126: 17(bool) FOrdLessThan 124 125 126: 24(ptr) AccessChain 9(color) 51
SelectionMerge 128 None 127: 6(float) Load 126
BranchConditional 126 127 134 128: 6(float) FAdd 127 125
127: Label 129: 24(ptr) AccessChain 9(color) 51
129: 6(float) Load 27(d4) Store 129 128
130: 23(ptr) AccessChain 9(color) 60 Branch 124
131: 6(float) Load 130 130: Label
132: 6(float) FAdd 131 129 131: 6(float) Load 28(d4)
133: 23(ptr) AccessChain 9(color) 60 132: 24(ptr) AccessChain 9(color) 23
Store 133 132 133: 6(float) Load 132
Branch 128 134: 6(float) FAdd 133 131
134: Label 135: 24(ptr) AccessChain 9(color) 23
135: 6(float) Load 27(d4) Store 135 134
136: 23(ptr) AccessChain 9(color) 36 Branch 124
137: 6(float) Load 136 124: Label
138: 6(float) FAdd 137 135 Branch 76
139: 23(ptr) AccessChain 9(color) 36 76: Label
Store 139 138 Branch 73
Branch 128 75: Label
128: Label 136: 7(fvec4) Load 9(color)
Branch 78 137: 7(fvec4) CompositeConstruct 48 48 48 48
79: Label 138: 7(fvec4) FAdd 136 137
140: 7(fvec4) Load 9(color) Store 9(color) 138
141: 7(fvec4) CompositeConstruct 56 56 56 56 141: 7(fvec4) Load 9(color)
142: 7(fvec4) FAdd 140 141 Store 140(gl_FragColor) 141
Store 9(color) 142
145: 7(fvec4) Load 9(color)
Store 144(gl_FragColor) 145
Return Return
FunctionEnd FunctionEnd
spv.merge-unreachable.frag
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 25
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9
ExecutionMode 4 OriginLowerLeft
Source GLSL 450
Name 4 "main"
Name 9 "v"
Decorate 9(v) Location 1
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Input 7(fvec4)
9(v): 8(ptr) Variable Input
11: 6(float) Constant 1036831949
12: 6(float) Constant 1045220557
13: 6(float) Constant 1050253722
14: 6(float) Constant 1053609165
15: 7(fvec4) ConstantComposite 11 12 13 14
16: TypeBool
17: TypeVector 16(bool) 4
4(main): 2 Function None 3
5: Label
10: 7(fvec4) Load 9(v)
18: 17(bvec4) FOrdEqual 10 15
19: 16(bool) All 18
SelectionMerge 21 None
BranchConditional 19 20 23
20: Label
Kill
23: Label
Return
21: Label
Return
FunctionEnd
...@@ -10,12 +10,12 @@ Linked fragment stage: ...@@ -10,12 +10,12 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 263 // Id's are bound by 265
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 73 221 EntryPoint Fragment 4 "main" 73 223
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source ESSL 310 Source ESSL 310
Name 4 "main" Name 4 "main"
...@@ -33,24 +33,24 @@ Linked fragment stage: ...@@ -33,24 +33,24 @@ Linked fragment stage:
Name 73 "x" Name 73 "x"
Name 127 "d" Name 127 "d"
Name 153 "i" Name 153 "i"
Name 171 "j" Name 172 "j"
Name 221 "color" Name 223 "color"
Name 227 "v" Name 229 "v"
Name 228 "param"
Name 230 "param" Name 230 "param"
Name 232 "param" Name 232 "param"
Name 240 "param" Name 234 "param"
Name 242 "param" Name 242 "param"
Name 244 "param" Name 244 "param"
Name 246 "param"
Decorate 58(local) RelaxedPrecision Decorate 58(local) RelaxedPrecision
Decorate 60(c) RelaxedPrecision Decorate 60(c) RelaxedPrecision
Decorate 71(f) RelaxedPrecision Decorate 71(f) RelaxedPrecision
Decorate 73(x) RelaxedPrecision Decorate 73(x) RelaxedPrecision
Decorate 127(d) RelaxedPrecision Decorate 127(d) RelaxedPrecision
Decorate 153(i) RelaxedPrecision Decorate 153(i) RelaxedPrecision
Decorate 171(j) RelaxedPrecision Decorate 172(j) RelaxedPrecision
Decorate 221(color) RelaxedPrecision Decorate 223(color) RelaxedPrecision
Decorate 227(v) RelaxedPrecision Decorate 229(v) RelaxedPrecision
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
...@@ -71,31 +71,31 @@ Linked fragment stage: ...@@ -71,31 +71,31 @@ Linked fragment stage:
73(x): 72(ptr) Variable Input 73(x): 72(ptr) Variable Input
127(d): 59(ptr) Variable UniformConstant 127(d): 59(ptr) Variable UniformConstant
154: 9(int) Constant 0 154: 9(int) Constant 0
159: 9(int) Constant 10 160: 9(int) Constant 10
160: TypeBool 161: TypeBool
172: 9(int) Constant 20 173: 9(int) Constant 20
177: 9(int) Constant 30 179: 9(int) Constant 30
182: 6(float) Constant 1120429670 184: 6(float) Constant 1120429670
202: 6(float) Constant 1079739679 204: 6(float) Constant 1079739679
220: TypePointer Output 6(float) 222: TypePointer Output 6(float)
221(color): 220(ptr) Variable Output 223(color): 222(ptr) Variable Output
226: TypePointer UniformConstant 7(fvec4) 228: TypePointer UniformConstant 7(fvec4)
227(v): 226(ptr) Variable UniformConstant 229(v): 228(ptr) Variable UniformConstant
235: TypeInt 32 0 237: TypeInt 32 0
236: 235(int) Constant 1 238: 237(int) Constant 1
247: 235(int) Constant 2 249: 237(int) Constant 2
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
58(local): 10(ptr) Variable Function 58(local): 10(ptr) Variable Function
71(f): 70(ptr) Variable Function 71(f): 70(ptr) Variable Function
153(i): 10(ptr) Variable Function 153(i): 10(ptr) Variable Function
171(j): 10(ptr) Variable Function 172(j): 10(ptr) Variable Function
228(param): 8(ptr) Variable Function
230(param): 8(ptr) Variable Function 230(param): 8(ptr) Variable Function
232(param): 10(ptr) Variable Function 232(param): 8(ptr) Variable Function
240(param): 8(ptr) Variable Function 234(param): 10(ptr) Variable Function
242(param): 8(ptr) Variable Function 242(param): 8(ptr) Variable Function
244(param): 10(ptr) Variable Function 244(param): 8(ptr) Variable Function
246(param): 10(ptr) Variable Function
61: 9(int) Load 60(c) 61: 9(int) Load 60(c)
Store 58(local) 61 Store 58(local) 61
62: 9(int) Load 58(local) 62: 9(int) Load 58(local)
...@@ -106,6 +106,11 @@ Linked fragment stage: ...@@ -106,6 +106,11 @@ Linked fragment stage:
Switch 65 68 Switch 65 68
case 1: 66 case 1: 66
case 2: 67 case 2: 67
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
66: Label 66: Label
74: 6(float) Load 73(x) 74: 6(float) Load 73(x)
75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74 75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74
...@@ -116,17 +121,19 @@ Linked fragment stage: ...@@ -116,17 +121,19 @@ Linked fragment stage:
78: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 77 78: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 77
Store 71(f) 78 Store 71(f) 78
Branch 69 Branch 69
68: Label
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 69: Label
83: 9(int) Load 60(c) 83: 9(int) Load 60(c)
SelectionMerge 87 None SelectionMerge 87 None
Switch 83 86 Switch 83 86
case 1: 84 case 1: 84
case 2: 85 case 2: 85
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
84: Label 84: Label
88: 6(float) Load 73(x) 88: 6(float) Load 73(x)
89: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 88 89: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 88
...@@ -141,13 +148,6 @@ Linked fragment stage: ...@@ -141,13 +148,6 @@ Linked fragment stage:
95: 6(float) FAdd 94 93 95: 6(float) FAdd 94 93
Store 71(f) 95 Store 71(f) 95
Branch 87 Branch 87
86: Label
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 87: Label
102: 9(int) Load 60(c) 102: 9(int) Load 60(c)
SelectionMerge 105 None SelectionMerge 105 None
...@@ -174,6 +174,13 @@ Linked fragment stage: ...@@ -174,6 +174,13 @@ Linked fragment stage:
Switch 117 120 Switch 117 120
case 1: 118 case 1: 118
case 2: 119 case 2: 119
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
118: Label 118: Label
122: 6(float) Load 73(x) 122: 6(float) Load 73(x)
123: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 122 123: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 122
...@@ -207,141 +214,138 @@ Linked fragment stage: ...@@ -207,141 +214,138 @@ Linked fragment stage:
Branch 131 Branch 131
131: Label 131: Label
Branch 121 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 121: Label
Store 153(i) 154 Store 153(i) 154
Branch 155 Branch 155
155: Label 155: Label
158: 9(int) Load 153(i) 159: 9(int) Load 153(i)
161: 160(bool) SLessThan 158 159 162: 161(bool) SLessThan 159 160
LoopMerge 156 155 None LoopMerge 157 158 None
BranchConditional 161 157 156 BranchConditional 162 156 157
157: Label 156: Label
162: 9(int) Load 60(c) 163: 9(int) Load 60(c)
SelectionMerge 166 None SelectionMerge 167 None
Switch 162 165 Switch 163 166
case 1: 163 case 1: 164
case 2: 164 case 2: 165
163: Label 166: Label
167: 6(float) Load 73(x) 198: 6(float) Load 73(x)
168: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 167 199: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 198
169: 6(float) Load 71(f) 200: 6(float) Load 71(f)
170: 6(float) FAdd 169 168 201: 6(float) FAdd 200 199
Store 71(f) 170 Store 71(f) 201
Store 171(j) 172 Branch 167
Branch 173 164: Label
173: Label 168: 6(float) Load 73(x)
176: 9(int) Load 171(j) 169: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 168
178: 160(bool) SLessThan 176 177 170: 6(float) Load 71(f)
LoopMerge 174 173 None 171: 6(float) FAdd 170 169
BranchConditional 178 175 174 Store 71(f) 171
Store 172(j) 173
Branch 174
174: Label
178: 9(int) Load 172(j)
180: 161(bool) SLessThan 178 179
LoopMerge 176 177 None
BranchConditional 180 175 176
175: Label 175: Label
179: 6(float) Load 71(f)
180: 6(float) FAdd 179 47
Store 71(f) 180
181: 6(float) Load 71(f) 181: 6(float) Load 71(f)
183: 160(bool) FOrdLessThan 181 182 182: 6(float) FAdd 181 47
SelectionMerge 185 None Store 71(f) 182
BranchConditional 183 184 185 183: 6(float) Load 71(f)
184: Label 185: 161(bool) FOrdLessThan 183 184
Branch 174 SelectionMerge 187 None
185: Label BranchConditional 185 186 187
187: 9(int) Load 171(j) 186: Label
188: 9(int) IAdd 187 63 Branch 176
Store 171(j) 188 187: Label
Branch 173 Branch 177
174: Label 177: Label
Branch 166 189: 9(int) Load 172(j)
164: Label 190: 9(int) IAdd 189 63
190: 6(float) Load 73(x) Store 172(j) 190
191: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 190 Branch 174
192: 6(float) Load 71(f) 176: Label
193: 6(float) FAdd 192 191 Branch 167
Store 71(f) 193
Branch 166
165: Label 165: Label
196: 6(float) Load 73(x) 192: 6(float) Load 73(x)
197: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 196 193: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 192
198: 6(float) Load 71(f) 194: 6(float) Load 71(f)
199: 6(float) FAdd 198 197 195: 6(float) FAdd 194 193
Store 71(f) 199 Store 71(f) 195
Branch 166 Branch 167
166: Label 167: Label
201: 6(float) Load 71(f) 203: 6(float) Load 71(f)
203: 160(bool) FOrdLessThan 201 202 205: 161(bool) FOrdLessThan 203 204
SelectionMerge 205 None SelectionMerge 207 None
BranchConditional 203 204 205 BranchConditional 205 206 207
204: Label 206: Label
Branch 156 Branch 157
205: Label 207: Label
207: 9(int) Load 153(i) Branch 158
208: 9(int) IAdd 207 63 158: Label
Store 153(i) 208 209: 9(int) Load 153(i)
210: 9(int) IAdd 209 63
Store 153(i) 210
Branch 155 Branch 155
156: Label 157: Label
209: 9(int) Load 60(c) 211: 9(int) Load 60(c)
SelectionMerge 212 None SelectionMerge 214 None
Switch 209 212 Switch 211 214
case 1: 210 case 1: 212
case 2: 211 case 2: 213
210: Label 212: Label
213: 6(float) Load 73(x) 215: 6(float) Load 73(x)
214: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 213 216: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 215
215: 6(float) Load 71(f) 217: 6(float) Load 71(f)
216: 6(float) FAdd 215 214 218: 6(float) FAdd 217 216
Store 71(f) 216 Store 71(f) 218
Branch 212 Branch 214
211: Label 213: Label
Branch 212 Branch 214
212: Label 214: Label
222: 6(float) Load 71(f) 224: 6(float) Load 71(f)
223: 9(int) Load 58(local) 225: 9(int) Load 58(local)
224: 6(float) ConvertSToF 223 226: 6(float) ConvertSToF 225
225: 6(float) FAdd 222 224 227: 6(float) FAdd 224 226
Store 221(color) 225 Store 223(color) 227
229: 7(fvec4) Load 227(v) 231: 7(fvec4) Load 229(v)
Store 228(param) 229
231: 7(fvec4) Load 227(v)
Store 230(param) 231 Store 230(param) 231
233: 9(int) Load 60(c) 233: 7(fvec4) Load 229(v)
Store 232(param) 233 Store 232(param) 233
234: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 228(param) 230(param) 232(param) 235: 9(int) Load 60(c)
237: 6(float) CompositeExtract 234 1 Store 234(param) 235
238: 6(float) Load 221(color) 236: 7(fvec4) FunctionCall 15(foo1(vf4;vf4;i1;) 230(param) 232(param) 234(param)
239: 6(float) FAdd 238 237 239: 6(float) CompositeExtract 236 1
Store 221(color) 239 240: 6(float) Load 223(color)
241: 7(fvec4) Load 227(v) 241: 6(float) FAdd 240 239
Store 240(param) 241 Store 223(color) 241
243: 7(fvec4) Load 227(v) 243: 7(fvec4) Load 229(v)
Store 242(param) 243 Store 242(param) 243
245: 9(int) Load 60(c) 245: 7(fvec4) Load 229(v)
Store 244(param) 245 Store 244(param) 245
246: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 240(param) 242(param) 244(param) 247: 9(int) Load 60(c)
248: 6(float) CompositeExtract 246 2 Store 246(param) 247
249: 6(float) Load 221(color) 248: 7(fvec4) FunctionCall 20(foo2(vf4;vf4;i1;) 242(param) 244(param) 246(param)
250: 6(float) FAdd 249 248 250: 6(float) CompositeExtract 248 2
Store 221(color) 250 251: 6(float) Load 223(color)
251: 9(int) Load 60(c) 252: 6(float) FAdd 251 250
SelectionMerge 254 None Store 223(color) 252
Switch 251 253 253: 9(int) Load 60(c)
case 0: 252 SelectionMerge 256 None
252: Label Switch 253 255
Branch 254 case 0: 254
253: Label 255: Label
Branch 254 Branch 256
254: Label 254: Label
258: 9(int) Load 60(c) Branch 256
SelectionMerge 260 None 256: Label
Switch 258 259 260: 9(int) Load 60(c)
259: Label SelectionMerge 262 None
Branch 260 Switch 260 261
260: Label 261: Label
Branch 262
262: Label
Return Return
FunctionEnd FunctionEnd
15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11 15(foo1(vf4;vf4;i1;): 7(fvec4) Function None 11
......
...@@ -5,82 +5,78 @@ Linked vertex stage: ...@@ -5,82 +5,78 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 42 // Id's are bound by 43
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 40 41 EntryPoint Vertex 4 "main" 41 42
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 17 "A" Name 18 "A"
Name 25 "B" Name 26 "B"
Name 27 "C" Name 28 "C"
Name 37 "D" Name 38 "D"
Name 40 "gl_VertexID" Name 41 "gl_VertexID"
Name 41 "gl_InstanceID" Name 42 "gl_InstanceID"
Decorate 40(gl_VertexID) BuiltIn VertexId Decorate 41(gl_VertexID) BuiltIn VertexId
Decorate 41(gl_InstanceID) BuiltIn InstanceId Decorate 42(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: 6(int) Constant 10 15: 6(int) Constant 10
15: TypeBool 16: TypeBool
18: 6(int) Constant 1 19: 6(int) Constant 1
20: 6(int) Constant 2 21: 6(int) Constant 2
29: 6(int) Constant 5 30: 6(int) Constant 5
38: 6(int) Constant 3 39: 6(int) Constant 3
39: TypePointer Input 6(int) 40: TypePointer Input 6(int)
40(gl_VertexID): 39(ptr) Variable Input 41(gl_VertexID): 40(ptr) Variable Input
41(gl_InstanceID): 39(ptr) Variable Input 42(gl_InstanceID): 40(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
17(A): 7(ptr) Variable Function 18(A): 7(ptr) Variable Function
25(B): 7(ptr) Variable Function 26(B): 7(ptr) Variable Function
27(C): 7(ptr) Variable Function 28(C): 7(ptr) Variable Function
37(D): 7(ptr) Variable Function 38(D): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
13: 6(int) Load 8(i) 14: 6(int) Load 8(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 11 10 None LoopMerge 12 13 None
BranchConditional 16 12 11 BranchConditional 17 11 12
12: Label 11: Label
Store 17(A) 18 Store 18(A) 19
19: 6(int) Load 8(i) 20: 6(int) Load 8(i)
21: 6(int) SMod 19 20 22: 6(int) SMod 20 21
22: 15(bool) IEqual 21 9 23: 16(bool) IEqual 22 9
SelectionMerge 24 None SelectionMerge 25 None
BranchConditional 22 23 24 BranchConditional 23 24 25
23: Label 24: Label
Store 25(B) 20 Store 26(B) 21
Branch 10 Branch 13
26: Label 25: Label
Store 27(C) 20 29: 6(int) Load 8(i)
Branch 24 31: 6(int) SMod 29 30
24: Label 32: 16(bool) IEqual 31 9
28: 6(int) Load 8(i) SelectionMerge 34 None
30: 6(int) SMod 28 29 BranchConditional 32 33 34
31: 15(bool) IEqual 30 9 33: Label
SelectionMerge 33 None Store 26(B) 21
BranchConditional 31 32 33 Branch 12
32: Label 34: Label
Store 25(B) 20 36: 6(int) Load 8(i)
Branch 11 37: 6(int) IAdd 36 19
34: Label Store 8(i) 37
Store 27(C) 20 Branch 13
Branch 33 13: Label
33: Label
35: 6(int) Load 8(i)
36: 6(int) IAdd 35 18
Store 8(i) 36
Branch 10 Branch 10
11: Label 12: Label
Store 37(D) 38 Store 38(D) 39
Return Return
FunctionEnd FunctionEnd
...@@ -5,45 +5,47 @@ Linked vertex stage: ...@@ -5,45 +5,47 @@ Linked vertex stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 23 // Id's are bound by 24
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 21 22 EntryPoint Vertex 4 "main" 22 23
Source ESSL 300 Source ESSL 300
Name 4 "main" Name 4 "main"
Name 8 "i" Name 8 "i"
Name 21 "gl_VertexID" Name 22 "gl_VertexID"
Name 22 "gl_InstanceID" Name 23 "gl_InstanceID"
Decorate 21(gl_VertexID) BuiltIn VertexId Decorate 22(gl_VertexID) BuiltIn VertexId
Decorate 22(gl_InstanceID) BuiltIn InstanceId Decorate 23(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeInt 32 1 6: TypeInt 32 1
7: TypePointer Function 6(int) 7: TypePointer Function 6(int)
9: 6(int) Constant 0 9: 6(int) Constant 0
14: 6(int) Constant 10 15: 6(int) Constant 10
15: TypeBool 16: TypeBool
18: 6(int) Constant 1 19: 6(int) Constant 1
20: TypePointer Input 6(int) 21: TypePointer Input 6(int)
21(gl_VertexID): 20(ptr) Variable Input 22(gl_VertexID): 21(ptr) Variable Input
22(gl_InstanceID): 20(ptr) Variable Input 23(gl_InstanceID): 21(ptr) Variable Input
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
8(i): 7(ptr) Variable Function 8(i): 7(ptr) Variable Function
Store 8(i) 9 Store 8(i) 9
Branch 10 Branch 10
10: Label 10: Label
13: 6(int) Load 8(i) 14: 6(int) Load 8(i)
16: 15(bool) SLessThan 13 14 17: 16(bool) SLessThan 14 15
LoopMerge 11 10 None LoopMerge 12 13 None
BranchConditional 16 12 11 BranchConditional 17 11 12
12: Label 11: Label
17: 6(int) Load 8(i) 18: 6(int) Load 8(i)
19: 6(int) IAdd 17 18 20: 6(int) IAdd 18 19
Store 8(i) 19 Store 8(i) 20
Branch 13
13: Label
Branch 10 Branch 10
11: Label 12: Label
Return Return
FunctionEnd FunctionEnd
...@@ -5,20 +5,20 @@ Linked fragment stage: ...@@ -5,20 +5,20 @@ Linked fragment stage:
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 34 // Id's are bound by 35
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 11 32 EntryPoint Fragment 4 "main" 11 33
ExecutionMode 4 OriginLowerLeft ExecutionMode 4 OriginLowerLeft
Source GLSL 110 Source GLSL 110
Name 4 "main" Name 4 "main"
Name 9 "color" Name 9 "color"
Name 11 "BaseColor" Name 11 "BaseColor"
Name 22 "d" Name 23 "d"
Name 27 "bigColor" Name 28 "bigColor"
Name 32 "gl_FragColor" Name 33 "gl_FragColor"
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
...@@ -26,16 +26,16 @@ Linked fragment stage: ...@@ -26,16 +26,16 @@ Linked fragment stage:
8: TypePointer Function 7(fvec4) 8: TypePointer Function 7(fvec4)
10: TypePointer Input 7(fvec4) 10: TypePointer Input 7(fvec4)
11(BaseColor): 10(ptr) Variable Input 11(BaseColor): 10(ptr) Variable Input
16: TypeInt 32 0 17: TypeInt 32 0
17: 16(int) Constant 0 18: 17(int) Constant 0
18: TypePointer Function 6(float) 19: TypePointer Function 6(float)
21: TypePointer UniformConstant 6(float) 22: TypePointer UniformConstant 6(float)
22(d): 21(ptr) Variable UniformConstant 23(d): 22(ptr) Variable UniformConstant
24: TypeBool 25: TypeBool
26: TypePointer UniformConstant 7(fvec4) 27: TypePointer UniformConstant 7(fvec4)
27(bigColor): 26(ptr) Variable UniformConstant 28(bigColor): 27(ptr) Variable UniformConstant
31: TypePointer Output 7(fvec4) 32: TypePointer Output 7(fvec4)
32(gl_FragColor): 31(ptr) Variable Output 33(gl_FragColor): 32(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
9(color): 8(ptr) Variable Function 9(color): 8(ptr) Variable Function
...@@ -43,20 +43,22 @@ Linked fragment stage: ...@@ -43,20 +43,22 @@ Linked fragment stage:
Store 9(color) 12 Store 9(color) 12
Branch 13 Branch 13
13: Label 13: Label
19: 18(ptr) AccessChain 9(color) 17 20: 19(ptr) AccessChain 9(color) 18
20: 6(float) Load 19 21: 6(float) Load 20
23: 6(float) Load 22(d) 24: 6(float) Load 23(d)
25: 24(bool) FOrdLessThan 20 23 26: 25(bool) FOrdLessThan 21 24
LoopMerge 14 13 None LoopMerge 15 16 None
BranchConditional 25 15 14 BranchConditional 26 14 15
15: Label 14: Label
28: 7(fvec4) Load 27(bigColor) 29: 7(fvec4) Load 28(bigColor)
29: 7(fvec4) Load 9(color) 30: 7(fvec4) Load 9(color)
30: 7(fvec4) FAdd 29 28 31: 7(fvec4) FAdd 30 29
Store 9(color) 30 Store 9(color) 31
Branch 16
16: Label
Branch 13 Branch 13
14: Label 15: Label
33: 7(fvec4) Load 9(color) 34: 7(fvec4) Load 9(color)
Store 32(gl_FragColor) 33 Store 33(gl_FragColor) 34
Return Return
FunctionEnd FunctionEnd
#version 300 es
void main() {
switch (gl_InstanceID) {
case 0: return;
case 1: gl_Position = vec4(0.0); break;
case 2: return;
case 3: return;
}
gl_Position.x += 0.123;
}
#version 450
layout(location=0) out highp int r;
void main() {
int i;
for (i=0; i<10; i++);
r = i;
}
#version 450
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; }
}
#version 450
layout(location=1) in highp vec4 v;
void main (void)
{
if (v == vec4(0.1,0.2,0.3,0.4)) discard;
else return;
}
...@@ -5,6 +5,8 @@ spv.do-simple.vert ...@@ -5,6 +5,8 @@ spv.do-simple.vert
spv.do-while-continue-break.vert spv.do-while-continue-break.vert
spv.for-continue-break.vert spv.for-continue-break.vert
spv.for-simple.vert spv.for-simple.vert
spv.for-notest.vert
spv.for-nobody.vert
spv.while-continue-break.vert spv.while-continue-break.vert
spv.while-simple.vert spv.while-simple.vert
# vulkan-specific tests # vulkan-specific tests
...@@ -32,6 +34,7 @@ spv.always-discard.frag ...@@ -32,6 +34,7 @@ spv.always-discard.frag
spv.always-discard2.frag spv.always-discard2.frag
spv.bitCast.frag spv.bitCast.frag
spv.bool.vert spv.bool.vert
spv.branch-return.vert
spv.conditionalDiscard.frag spv.conditionalDiscard.frag
spv.conversion.frag spv.conversion.frag
spv.dataOut.frag spv.dataOut.frag
...@@ -56,6 +59,7 @@ spv.loopsArtificial.frag ...@@ -56,6 +59,7 @@ spv.loopsArtificial.frag
spv.matFun.vert spv.matFun.vert
spv.matrix.frag spv.matrix.frag
spv.matrix2.frag spv.matrix2.frag
spv.merge-unreachable.frag
spv.newTexture.frag spv.newTexture.frag
spv.nonSquare.vert spv.nonSquare.vert
spv.Operations.frag spv.Operations.frag
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment