SPIR-V: Aggressively prune unreachable merge, continue target
More aggressively prune unreachable code as follows. When no control flow edges reach a merge block or continue target: - delete their contents so that: - a merge block becomes OpLabel, then OpUnreachable - a continue target becomes OpLabel, then an OpBranch back to the loop header - any basic block which is dominated by such a merge block or continue target is removed as well. - decorations targeting the removed instructions are removed. Enables the SPIR-V builder post-processing step the GLSLANG_WEB case.
This commit is contained in:
parent
b131630e7c
commit
8c3d5b4b6c
@ -1630,11 +1630,11 @@ void TGlslangToSpvTraverser::finishSpv()
|
|||||||
for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it)
|
for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it)
|
||||||
entryPoint->addIdOperand(*it);
|
entryPoint->addIdOperand(*it);
|
||||||
|
|
||||||
#ifndef GLSLANG_WEB
|
|
||||||
// Add capabilities, extensions, remove unneeded decorations, etc.,
|
// Add capabilities, extensions, remove unneeded decorations, etc.,
|
||||||
// based on the resulting SPIR-V.
|
// based on the resulting SPIR-V.
|
||||||
|
// Note: WebGPU code generation must have the opportunity to aggressively
|
||||||
|
// prune unreachable merge blocks and continue targets.
|
||||||
builder.postProcess();
|
builder.postProcess();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the SPV into 'out'.
|
// Write the SPV into 'out'.
|
||||||
|
@ -61,17 +61,22 @@ namespace {
|
|||||||
// Use by calling visit() on the root block.
|
// Use by calling visit() on the root block.
|
||||||
class ReadableOrderTraverser {
|
class ReadableOrderTraverser {
|
||||||
public:
|
public:
|
||||||
explicit ReadableOrderTraverser(std::function<void(Block*)> callback) : callback_(callback) {}
|
ReadableOrderTraverser(std::function<void(Block*, spv::ReachReason, Block*)> callback)
|
||||||
|
: callback_(callback) {}
|
||||||
// Visits the block if it hasn't been visited already and isn't currently
|
// Visits the block if it hasn't been visited already and isn't currently
|
||||||
// being delayed. Invokes callback(block), then descends into its
|
// being delayed. Invokes callback(block, why, header), then descends into its
|
||||||
// successors. Delays merge-block and continue-block processing until all
|
// successors. Delays merge-block and continue-block processing until all
|
||||||
// the branches have been completed.
|
// the branches have been completed. If |block| is an unreachable merge block or
|
||||||
void visit(Block* block)
|
// an unreachable continue target, then |header| is the corresponding header block.
|
||||||
|
void visit(Block* block, spv::ReachReason why, Block* header)
|
||||||
{
|
{
|
||||||
assert(block);
|
assert(block);
|
||||||
|
if (why == spv::ReachViaControlFlow) {
|
||||||
|
reachableViaControlFlow_.insert(block);
|
||||||
|
}
|
||||||
if (visited_.count(block) || delayed_.count(block))
|
if (visited_.count(block) || delayed_.count(block))
|
||||||
return;
|
return;
|
||||||
callback_(block);
|
callback_(block, why, header);
|
||||||
visited_.insert(block);
|
visited_.insert(block);
|
||||||
Block* mergeBlock = nullptr;
|
Block* mergeBlock = nullptr;
|
||||||
Block* continueBlock = nullptr;
|
Block* continueBlock = nullptr;
|
||||||
@ -87,27 +92,40 @@ public:
|
|||||||
delayed_.insert(continueBlock);
|
delayed_.insert(continueBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto successors = block->getSuccessors();
|
if (why == spv::ReachViaControlFlow) {
|
||||||
|
const auto& successors = block->getSuccessors();
|
||||||
for (auto it = successors.cbegin(); it != successors.cend(); ++it)
|
for (auto it = successors.cbegin(); it != successors.cend(); ++it)
|
||||||
visit(*it);
|
visit(*it, why, nullptr);
|
||||||
|
}
|
||||||
if (continueBlock) {
|
if (continueBlock) {
|
||||||
|
const spv::ReachReason continueWhy =
|
||||||
|
(reachableViaControlFlow_.count(continueBlock) > 0)
|
||||||
|
? spv::ReachViaControlFlow
|
||||||
|
: spv::ReachDeadContinue;
|
||||||
delayed_.erase(continueBlock);
|
delayed_.erase(continueBlock);
|
||||||
visit(continueBlock);
|
visit(continueBlock, continueWhy, block);
|
||||||
}
|
}
|
||||||
if (mergeBlock) {
|
if (mergeBlock) {
|
||||||
|
const spv::ReachReason mergeWhy =
|
||||||
|
(reachableViaControlFlow_.count(mergeBlock) > 0)
|
||||||
|
? spv::ReachViaControlFlow
|
||||||
|
: spv::ReachDeadMerge;
|
||||||
delayed_.erase(mergeBlock);
|
delayed_.erase(mergeBlock);
|
||||||
visit(mergeBlock);
|
visit(mergeBlock, mergeWhy, block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::function<void(Block*)> callback_;
|
std::function<void(Block*, spv::ReachReason, Block*)> callback_;
|
||||||
// Whether a block has already been visited or is being delayed.
|
// Whether a block has already been visited or is being delayed.
|
||||||
std::unordered_set<Block *> visited_, delayed_;
|
std::unordered_set<Block *> visited_, delayed_;
|
||||||
|
|
||||||
|
// The set of blocks that actually are reached via control flow.
|
||||||
|
std::unordered_set<Block *> reachableViaControlFlow_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void spv::inReadableOrder(Block* root, std::function<void(Block*)> callback)
|
void spv::inReadableOrder(Block* root, std::function<void(Block*, spv::ReachReason, Block*)> callback)
|
||||||
{
|
{
|
||||||
ReadableOrderTraverser(callback).visit(root);
|
ReadableOrderTraverser(callback).visit(root, spv::ReachViaControlFlow, nullptr);
|
||||||
}
|
}
|
||||||
|
@ -689,8 +689,6 @@ public:
|
|||||||
|
|
||||||
// Hook to visit each instruction in a block in a function
|
// Hook to visit each instruction in a block in a function
|
||||||
void postProcess(Instruction&);
|
void postProcess(Instruction&);
|
||||||
// Hook to visit each instruction in a reachable block in a function.
|
|
||||||
void postProcessReachable(const Instruction&);
|
|
||||||
// Hook to visit each non-32-bit sized float/int operation in a block.
|
// Hook to visit each non-32-bit sized float/int operation in a block.
|
||||||
void postProcessType(const Instruction&, spv::Id typeId);
|
void postProcessType(const Instruction&, spv::Id typeId);
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -319,16 +320,14 @@ void Builder::postProcess(Instruction& inst)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called for each instruction in a reachable block.
|
|
||||||
void Builder::postProcessReachable(const Instruction&)
|
|
||||||
{
|
|
||||||
// did have code here, but questionable to do so without deleting the instructions
|
|
||||||
}
|
|
||||||
|
|
||||||
// comment in header
|
// comment in header
|
||||||
void Builder::postProcess()
|
void Builder::postProcess()
|
||||||
{
|
{
|
||||||
|
// reachableBlocks is the set of blockss reached via control flow, or which are
|
||||||
|
// unreachable continue targert or unreachable merge.
|
||||||
std::unordered_set<const Block*> reachableBlocks;
|
std::unordered_set<const Block*> reachableBlocks;
|
||||||
|
std::unordered_map<Block*, Block*> headerForUnreachableContinue;
|
||||||
|
std::unordered_set<Block*> unreachableMerges;
|
||||||
std::unordered_set<Id> unreachableDefinitions;
|
std::unordered_set<Id> unreachableDefinitions;
|
||||||
// Collect IDs defined in unreachable blocks. For each function, label the
|
// Collect IDs defined in unreachable blocks. For each function, label the
|
||||||
// reachable blocks first. Then for each unreachable block, collect the
|
// reachable blocks first. Then for each unreachable block, collect the
|
||||||
@ -336,16 +335,41 @@ void Builder::postProcess()
|
|||||||
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
|
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
|
||||||
Function* f = *fi;
|
Function* f = *fi;
|
||||||
Block* entry = f->getEntryBlock();
|
Block* entry = f->getEntryBlock();
|
||||||
inReadableOrder(entry, [&reachableBlocks](const Block* b) { reachableBlocks.insert(b); });
|
inReadableOrder(entry,
|
||||||
|
[&reachableBlocks, &unreachableMerges, &headerForUnreachableContinue]
|
||||||
|
(Block* b, ReachReason why, Block* header) {
|
||||||
|
reachableBlocks.insert(b);
|
||||||
|
if (why == ReachDeadContinue) headerForUnreachableContinue[b] = header;
|
||||||
|
if (why == ReachDeadMerge) unreachableMerges.insert(b);
|
||||||
|
});
|
||||||
for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) {
|
for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) {
|
||||||
Block* b = *bi;
|
Block* b = *bi;
|
||||||
if (reachableBlocks.count(b) == 0) {
|
if (unreachableMerges.count(b) != 0 || headerForUnreachableContinue.count(b) != 0) {
|
||||||
for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ii++)
|
auto ii = b->getInstructions().cbegin();
|
||||||
|
++ii; // Keep potential decorations on the label.
|
||||||
|
for (; ii != b->getInstructions().cend(); ++ii)
|
||||||
|
unreachableDefinitions.insert(ii->get()->getResultId());
|
||||||
|
} else if (reachableBlocks.count(b) == 0) {
|
||||||
|
// The normal case for unreachable code. All definitions are considered dead.
|
||||||
|
for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ++ii)
|
||||||
unreachableDefinitions.insert(ii->get()->getResultId());
|
unreachableDefinitions.insert(ii->get()->getResultId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Modify unreachable merge blocks and unreachable continue targets.
|
||||||
|
// Delete their contents.
|
||||||
|
for (auto mergeIter = unreachableMerges.begin(); mergeIter != unreachableMerges.end(); ++mergeIter) {
|
||||||
|
(*mergeIter)->rewriteAsCanonicalUnreachableMerge();
|
||||||
|
}
|
||||||
|
for (auto continueIter = headerForUnreachableContinue.begin();
|
||||||
|
continueIter != headerForUnreachableContinue.end();
|
||||||
|
++continueIter) {
|
||||||
|
Block* continue_target = continueIter->first;
|
||||||
|
Block* header = continueIter->second;
|
||||||
|
continue_target->rewriteAsCanonicalUnreachableContinue(header);
|
||||||
|
}
|
||||||
|
|
||||||
// Remove unneeded decorations, for unreachable instructions
|
// Remove unneeded decorations, for unreachable instructions
|
||||||
decorations.erase(std::remove_if(decorations.begin(), decorations.end(),
|
decorations.erase(std::remove_if(decorations.begin(), decorations.end(),
|
||||||
[&unreachableDefinitions](std::unique_ptr<Instruction>& I) -> bool {
|
[&unreachableDefinitions](std::unique_ptr<Instruction>& I) -> bool {
|
||||||
@ -374,13 +398,6 @@ void Builder::postProcess()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// process all reachable instructions...
|
|
||||||
for (auto bi = reachableBlocks.cbegin(); bi != reachableBlocks.cend(); ++bi) {
|
|
||||||
const Block* block = *bi;
|
|
||||||
const auto function = [this](const std::unique_ptr<Instruction>& inst) { postProcessReachable(*inst.get()); };
|
|
||||||
std::for_each(block->getInstructions().begin(), block->getInstructions().end(), function);
|
|
||||||
}
|
|
||||||
|
|
||||||
// process all block-contained instructions
|
// process all block-contained instructions
|
||||||
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
|
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
|
||||||
Function* f = *fi;
|
Function* f = *fi;
|
||||||
|
@ -226,6 +226,36 @@ public:
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change this block into a canonical dead merge block. Delete instructions
|
||||||
|
// as necessary. A canonical dead merge block has only an OpLabel and an
|
||||||
|
// OpUnreachable.
|
||||||
|
void rewriteAsCanonicalUnreachableMerge() {
|
||||||
|
assert(localVariables.empty());
|
||||||
|
// Delete all instructions except for the label.
|
||||||
|
assert(instructions.size() > 0);
|
||||||
|
instructions.resize(1);
|
||||||
|
successors.clear();
|
||||||
|
Instruction* unreachable = new Instruction(OpUnreachable);
|
||||||
|
addInstruction(std::unique_ptr<Instruction>(unreachable));
|
||||||
|
}
|
||||||
|
// Change this block into a canonical dead continue target branching to the
|
||||||
|
// given header ID. Delete instructions as necessary. A canonical dead continue
|
||||||
|
// target has only an OpLabel and an unconditional branch back to the corresponding
|
||||||
|
// header.
|
||||||
|
void rewriteAsCanonicalUnreachableContinue(Block* header) {
|
||||||
|
assert(localVariables.empty());
|
||||||
|
// Delete all instructions except for the label.
|
||||||
|
assert(instructions.size() > 0);
|
||||||
|
instructions.resize(1);
|
||||||
|
successors.clear();
|
||||||
|
// Add OpBranch back to the header.
|
||||||
|
assert(header != nullptr);
|
||||||
|
Instruction* branch = new Instruction(OpBranch);
|
||||||
|
branch->addIdOperand(header->getId());
|
||||||
|
addInstruction(std::move(std::unique_ptr<Instruction>(branch)));
|
||||||
|
successors.push_back(header);
|
||||||
|
}
|
||||||
|
|
||||||
bool isTerminated() const
|
bool isTerminated() const
|
||||||
{
|
{
|
||||||
switch (instructions.back()->getOpCode()) {
|
switch (instructions.back()->getOpCode()) {
|
||||||
@ -235,6 +265,7 @@ public:
|
|||||||
case OpKill:
|
case OpKill:
|
||||||
case OpReturn:
|
case OpReturn:
|
||||||
case OpReturnValue:
|
case OpReturnValue:
|
||||||
|
case OpUnreachable:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@ -268,10 +299,24 @@ protected:
|
|||||||
bool unreachable;
|
bool unreachable;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// The different reasons for reaching a block in the inReadableOrder traversal.
|
||||||
|
typedef enum ReachReason {
|
||||||
|
// Reachable from the entry block via transfers of control, i.e. branches.
|
||||||
|
ReachViaControlFlow = 0,
|
||||||
|
// A continue target that is not reachable via control flow.
|
||||||
|
ReachDeadContinue,
|
||||||
|
// A merge block that is not reachable via control flow.
|
||||||
|
ReachDeadMerge
|
||||||
|
};
|
||||||
|
|
||||||
// Traverses the control-flow graph rooted at root in an order suited for
|
// Traverses the control-flow graph rooted at root in an order suited for
|
||||||
// readable code generation. Invokes callback at every node in the traversal
|
// readable code generation. Invokes callback at every node in the traversal
|
||||||
// order.
|
// order. The callback arguments are:
|
||||||
void inReadableOrder(Block* root, std::function<void(Block*)> callback);
|
// - the block,
|
||||||
|
// - the reason we reached the block,
|
||||||
|
// - if the reason was that block is an unreachable continue or unreachable merge block
|
||||||
|
// then the last parameter is the corresponding header block.
|
||||||
|
void inReadableOrder(Block* root, std::function<void(Block*, ReachReason, Block* header)> callback);
|
||||||
|
|
||||||
//
|
//
|
||||||
// SPIR-V IR Function.
|
// SPIR-V IR Function.
|
||||||
@ -321,7 +366,7 @@ public:
|
|||||||
parameterInstructions[p]->dump(out);
|
parameterInstructions[p]->dump(out);
|
||||||
|
|
||||||
// Blocks
|
// Blocks
|
||||||
inReadableOrder(blocks[0], [&out](const Block* b) { b->dump(out); });
|
inReadableOrder(blocks[0], [&out](const Block* b, ReachReason, Block*) { b->dump(out); });
|
||||||
Instruction end(0, 0, OpFunctionEnd);
|
Instruction end(0, 0, OpFunctionEnd);
|
||||||
end.dump(out);
|
end.dump(out);
|
||||||
}
|
}
|
||||||
|
@ -240,6 +240,5 @@ Validation failed
|
|||||||
60: 7(fvec4) CompositeConstruct 59 59 59 59
|
60: 7(fvec4) CompositeConstruct 59 59 59 59
|
||||||
ReturnValue 60
|
ReturnValue 60
|
||||||
30: Label
|
30: Label
|
||||||
62: 7(fvec4) Undef
|
Unreachable
|
||||||
ReturnValue 62
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -2,68 +2,95 @@ hlsl.doLoop.frag
|
|||||||
Shader version: 500
|
Shader version: 500
|
||||||
gl_FragCoord origin is upper left
|
gl_FragCoord origin is upper left
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:2 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
|
0:1 Function Definition: f0( ( temp void)
|
||||||
0:2 Function Parameters:
|
0:1 Function Parameters:
|
||||||
0:2 'input' ( in float)
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:3 Loop with condition not tested first: Unroll
|
0:2 Loop with condition not tested first: Unroll
|
||||||
0:3 Loop Condition
|
0:2 Loop Condition
|
||||||
0:3 Constant:
|
0:2 Constant:
|
||||||
0:3 false (const bool)
|
0:2 false (const bool)
|
||||||
0:3 No loop body
|
0:2 No loop body
|
||||||
0:4 Loop with condition not tested first: Unroll
|
0:5 Function Definition: f1( ( temp void)
|
||||||
0:4 Loop Condition
|
0:5 Function Parameters:
|
||||||
0:4 Constant:
|
|
||||||
0:4 false (const bool)
|
|
||||||
0:4 No loop body
|
|
||||||
0:5 Loop with condition not tested first
|
|
||||||
0:5 Loop Condition
|
|
||||||
0:5 Compare Greater Than ( temp bool)
|
|
||||||
0:5 'input' ( in float)
|
|
||||||
0:5 Constant:
|
|
||||||
0:5 2.000000
|
|
||||||
0:5 Loop Body
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:5 Branch: Return with expression
|
0:6 Loop with condition not tested first: Unroll
|
||||||
0:5 Construct vec4 ( temp 4-component vector of float)
|
|
||||||
0:5 'input' ( in float)
|
|
||||||
0:6 Loop with condition not tested first
|
|
||||||
0:6 Loop Condition
|
0:6 Loop Condition
|
||||||
0:6 Compare Less Than ( temp bool)
|
|
||||||
0:6 'input' ( in float)
|
|
||||||
0:6 Constant:
|
0:6 Constant:
|
||||||
0:6 10.000000
|
0:6 false (const bool)
|
||||||
0:6 Loop Body
|
0:6 No loop body
|
||||||
0:6 Pre-Increment ( temp float)
|
0:9 Function Definition: f2(f1; ( temp float)
|
||||||
0:6 'input' ( in float)
|
0:9 Function Parameters:
|
||||||
0:7 Loop with condition not tested first
|
0:9 'input' ( in float)
|
||||||
0:7 Loop Condition
|
|
||||||
0:7 Compare Less Than ( temp bool)
|
|
||||||
0:7 Pre-Increment ( temp float)
|
|
||||||
0:7 'input' ( in float)
|
|
||||||
0:7 Constant:
|
|
||||||
0:7 10.000000
|
|
||||||
0:7 Loop Body
|
|
||||||
0:7 Loop with condition tested first
|
|
||||||
0:7 Loop Condition
|
|
||||||
0:7 Compare Less Than ( temp bool)
|
|
||||||
0:7 Pre-Increment ( temp float)
|
|
||||||
0:7 'input' ( in float)
|
|
||||||
0:7 Constant:
|
|
||||||
0:7 10.000000
|
|
||||||
0:7 No loop body
|
|
||||||
0:8 Branch: Return with expression
|
|
||||||
0:8 Construct vec4 ( temp 4-component vector of float)
|
|
||||||
0:8 'input' ( in float)
|
|
||||||
0:2 Function Definition: PixelShaderFunction( ( temp void)
|
|
||||||
0:2 Function Parameters:
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:2 move second child to first child ( temp float)
|
0:10 Loop with condition not tested first
|
||||||
|
0:10 Loop Condition
|
||||||
|
0:10 Compare Greater Than ( temp bool)
|
||||||
|
0:10 'input' ( in float)
|
||||||
|
0:10 Constant:
|
||||||
|
0:10 2.000000
|
||||||
|
0:10 Loop Body
|
||||||
|
0:? Sequence
|
||||||
|
0:10 Branch: Return with expression
|
||||||
|
0:10 Construct float ( temp float)
|
||||||
|
0:10 Construct vec4 ( temp 4-component vector of float)
|
||||||
|
0:10 'input' ( in float)
|
||||||
|
0:13 Function Definition: f3(f1; ( temp void)
|
||||||
|
0:13 Function Parameters:
|
||||||
|
0:13 'input' ( in float)
|
||||||
|
0:? Sequence
|
||||||
|
0:14 Loop with condition not tested first
|
||||||
|
0:14 Loop Condition
|
||||||
|
0:14 Compare Less Than ( temp bool)
|
||||||
|
0:14 'input' ( in float)
|
||||||
|
0:14 Constant:
|
||||||
|
0:14 10.000000
|
||||||
|
0:14 Loop Body
|
||||||
|
0:14 Pre-Increment ( temp float)
|
||||||
|
0:14 'input' ( in float)
|
||||||
|
0:17 Function Definition: f4(f1; ( temp void)
|
||||||
|
0:17 Function Parameters:
|
||||||
|
0:17 'input' ( in float)
|
||||||
|
0:? Sequence
|
||||||
|
0:18 Loop with condition not tested first
|
||||||
|
0:18 Loop Condition
|
||||||
|
0:18 Compare Less Than ( temp bool)
|
||||||
|
0:18 Pre-Increment ( temp float)
|
||||||
|
0:18 'input' ( in float)
|
||||||
|
0:18 Constant:
|
||||||
|
0:18 10.000000
|
||||||
|
0:18 Loop Body
|
||||||
|
0:18 Loop with condition tested first
|
||||||
|
0:18 Loop Condition
|
||||||
|
0:18 Compare Less Than ( temp bool)
|
||||||
|
0:18 Pre-Increment ( temp float)
|
||||||
|
0:18 'input' ( in float)
|
||||||
|
0:18 Constant:
|
||||||
|
0:18 10.000000
|
||||||
|
0:18 No loop body
|
||||||
|
0:22 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
|
||||||
|
0:22 Function Parameters:
|
||||||
|
0:22 'input' ( in float)
|
||||||
|
0:? Sequence
|
||||||
|
0:23 Function Call: f0( ( temp void)
|
||||||
|
0:24 Function Call: f1( ( temp void)
|
||||||
|
0:25 Function Call: f2(f1; ( temp float)
|
||||||
|
0:25 'input' ( in float)
|
||||||
|
0:26 Function Call: f3(f1; ( temp void)
|
||||||
|
0:26 'input' ( in float)
|
||||||
|
0:27 Function Call: f4(f1; ( temp void)
|
||||||
|
0:27 'input' ( in float)
|
||||||
|
0:28 Branch: Return with expression
|
||||||
|
0:28 Construct vec4 ( temp 4-component vector of float)
|
||||||
|
0:28 'input' ( in float)
|
||||||
|
0:22 Function Definition: PixelShaderFunction( ( temp void)
|
||||||
|
0:22 Function Parameters:
|
||||||
|
0:? Sequence
|
||||||
|
0:22 move second child to first child ( temp float)
|
||||||
0:? 'input' ( temp float)
|
0:? 'input' ( temp float)
|
||||||
0:? 'input' (layout( location=0) in float)
|
0:? 'input' (layout( location=0) in float)
|
||||||
0:2 move second child to first child ( temp 4-component vector of float)
|
0:22 move second child to first child ( temp 4-component vector of float)
|
||||||
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
||||||
0:2 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
|
0:22 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
|
||||||
0:? 'input' ( temp float)
|
0:? 'input' ( temp float)
|
||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
||||||
@ -76,68 +103,95 @@ Linked fragment stage:
|
|||||||
Shader version: 500
|
Shader version: 500
|
||||||
gl_FragCoord origin is upper left
|
gl_FragCoord origin is upper left
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:2 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
|
0:1 Function Definition: f0( ( temp void)
|
||||||
0:2 Function Parameters:
|
0:1 Function Parameters:
|
||||||
0:2 'input' ( in float)
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:3 Loop with condition not tested first: Unroll
|
0:2 Loop with condition not tested first: Unroll
|
||||||
0:3 Loop Condition
|
0:2 Loop Condition
|
||||||
0:3 Constant:
|
0:2 Constant:
|
||||||
0:3 false (const bool)
|
0:2 false (const bool)
|
||||||
0:3 No loop body
|
0:2 No loop body
|
||||||
0:4 Loop with condition not tested first: Unroll
|
0:5 Function Definition: f1( ( temp void)
|
||||||
0:4 Loop Condition
|
0:5 Function Parameters:
|
||||||
0:4 Constant:
|
|
||||||
0:4 false (const bool)
|
|
||||||
0:4 No loop body
|
|
||||||
0:5 Loop with condition not tested first
|
|
||||||
0:5 Loop Condition
|
|
||||||
0:5 Compare Greater Than ( temp bool)
|
|
||||||
0:5 'input' ( in float)
|
|
||||||
0:5 Constant:
|
|
||||||
0:5 2.000000
|
|
||||||
0:5 Loop Body
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:5 Branch: Return with expression
|
0:6 Loop with condition not tested first: Unroll
|
||||||
0:5 Construct vec4 ( temp 4-component vector of float)
|
|
||||||
0:5 'input' ( in float)
|
|
||||||
0:6 Loop with condition not tested first
|
|
||||||
0:6 Loop Condition
|
0:6 Loop Condition
|
||||||
0:6 Compare Less Than ( temp bool)
|
|
||||||
0:6 'input' ( in float)
|
|
||||||
0:6 Constant:
|
0:6 Constant:
|
||||||
0:6 10.000000
|
0:6 false (const bool)
|
||||||
0:6 Loop Body
|
0:6 No loop body
|
||||||
0:6 Pre-Increment ( temp float)
|
0:9 Function Definition: f2(f1; ( temp float)
|
||||||
0:6 'input' ( in float)
|
0:9 Function Parameters:
|
||||||
0:7 Loop with condition not tested first
|
0:9 'input' ( in float)
|
||||||
0:7 Loop Condition
|
|
||||||
0:7 Compare Less Than ( temp bool)
|
|
||||||
0:7 Pre-Increment ( temp float)
|
|
||||||
0:7 'input' ( in float)
|
|
||||||
0:7 Constant:
|
|
||||||
0:7 10.000000
|
|
||||||
0:7 Loop Body
|
|
||||||
0:7 Loop with condition tested first
|
|
||||||
0:7 Loop Condition
|
|
||||||
0:7 Compare Less Than ( temp bool)
|
|
||||||
0:7 Pre-Increment ( temp float)
|
|
||||||
0:7 'input' ( in float)
|
|
||||||
0:7 Constant:
|
|
||||||
0:7 10.000000
|
|
||||||
0:7 No loop body
|
|
||||||
0:8 Branch: Return with expression
|
|
||||||
0:8 Construct vec4 ( temp 4-component vector of float)
|
|
||||||
0:8 'input' ( in float)
|
|
||||||
0:2 Function Definition: PixelShaderFunction( ( temp void)
|
|
||||||
0:2 Function Parameters:
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:2 move second child to first child ( temp float)
|
0:10 Loop with condition not tested first
|
||||||
|
0:10 Loop Condition
|
||||||
|
0:10 Compare Greater Than ( temp bool)
|
||||||
|
0:10 'input' ( in float)
|
||||||
|
0:10 Constant:
|
||||||
|
0:10 2.000000
|
||||||
|
0:10 Loop Body
|
||||||
|
0:? Sequence
|
||||||
|
0:10 Branch: Return with expression
|
||||||
|
0:10 Construct float ( temp float)
|
||||||
|
0:10 Construct vec4 ( temp 4-component vector of float)
|
||||||
|
0:10 'input' ( in float)
|
||||||
|
0:13 Function Definition: f3(f1; ( temp void)
|
||||||
|
0:13 Function Parameters:
|
||||||
|
0:13 'input' ( in float)
|
||||||
|
0:? Sequence
|
||||||
|
0:14 Loop with condition not tested first
|
||||||
|
0:14 Loop Condition
|
||||||
|
0:14 Compare Less Than ( temp bool)
|
||||||
|
0:14 'input' ( in float)
|
||||||
|
0:14 Constant:
|
||||||
|
0:14 10.000000
|
||||||
|
0:14 Loop Body
|
||||||
|
0:14 Pre-Increment ( temp float)
|
||||||
|
0:14 'input' ( in float)
|
||||||
|
0:17 Function Definition: f4(f1; ( temp void)
|
||||||
|
0:17 Function Parameters:
|
||||||
|
0:17 'input' ( in float)
|
||||||
|
0:? Sequence
|
||||||
|
0:18 Loop with condition not tested first
|
||||||
|
0:18 Loop Condition
|
||||||
|
0:18 Compare Less Than ( temp bool)
|
||||||
|
0:18 Pre-Increment ( temp float)
|
||||||
|
0:18 'input' ( in float)
|
||||||
|
0:18 Constant:
|
||||||
|
0:18 10.000000
|
||||||
|
0:18 Loop Body
|
||||||
|
0:18 Loop with condition tested first
|
||||||
|
0:18 Loop Condition
|
||||||
|
0:18 Compare Less Than ( temp bool)
|
||||||
|
0:18 Pre-Increment ( temp float)
|
||||||
|
0:18 'input' ( in float)
|
||||||
|
0:18 Constant:
|
||||||
|
0:18 10.000000
|
||||||
|
0:18 No loop body
|
||||||
|
0:22 Function Definition: @PixelShaderFunction(f1; ( temp 4-component vector of float)
|
||||||
|
0:22 Function Parameters:
|
||||||
|
0:22 'input' ( in float)
|
||||||
|
0:? Sequence
|
||||||
|
0:23 Function Call: f0( ( temp void)
|
||||||
|
0:24 Function Call: f1( ( temp void)
|
||||||
|
0:25 Function Call: f2(f1; ( temp float)
|
||||||
|
0:25 'input' ( in float)
|
||||||
|
0:26 Function Call: f3(f1; ( temp void)
|
||||||
|
0:26 'input' ( in float)
|
||||||
|
0:27 Function Call: f4(f1; ( temp void)
|
||||||
|
0:27 'input' ( in float)
|
||||||
|
0:28 Branch: Return with expression
|
||||||
|
0:28 Construct vec4 ( temp 4-component vector of float)
|
||||||
|
0:28 'input' ( in float)
|
||||||
|
0:22 Function Definition: PixelShaderFunction( ( temp void)
|
||||||
|
0:22 Function Parameters:
|
||||||
|
0:? Sequence
|
||||||
|
0:22 move second child to first child ( temp float)
|
||||||
0:? 'input' ( temp float)
|
0:? 'input' ( temp float)
|
||||||
0:? 'input' (layout( location=0) in float)
|
0:? 'input' (layout( location=0) in float)
|
||||||
0:2 move second child to first child ( temp 4-component vector of float)
|
0:22 move second child to first child ( temp 4-component vector of float)
|
||||||
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
||||||
0:2 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
|
0:22 Function Call: @PixelShaderFunction(f1; ( temp 4-component vector of float)
|
||||||
0:? 'input' ( temp float)
|
0:? 'input' ( temp float)
|
||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
||||||
@ -145,127 +199,176 @@ gl_FragCoord origin is upper left
|
|||||||
|
|
||||||
// Module Version 10000
|
// Module Version 10000
|
||||||
// Generated by (magic number): 80007
|
// Generated by (magic number): 80007
|
||||||
// Id's are bound by 71
|
// Id's are bound by 99
|
||||||
|
|
||||||
Capability Shader
|
Capability Shader
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
EntryPoint Fragment 4 "PixelShaderFunction" 64 67
|
EntryPoint Fragment 4 "PixelShaderFunction" 92 95
|
||||||
ExecutionMode 4 OriginUpperLeft
|
ExecutionMode 4 OriginUpperLeft
|
||||||
Source HLSL 500
|
Source HLSL 500
|
||||||
Name 4 "PixelShaderFunction"
|
Name 4 "PixelShaderFunction"
|
||||||
Name 11 "@PixelShaderFunction(f1;"
|
Name 6 "f0("
|
||||||
Name 10 "input"
|
Name 8 "f1("
|
||||||
Name 62 "input"
|
Name 14 "f2(f1;"
|
||||||
Name 64 "input"
|
Name 13 "input"
|
||||||
Name 67 "@entryPointOutput"
|
Name 18 "f3(f1;"
|
||||||
Name 68 "param"
|
Name 17 "input"
|
||||||
Decorate 64(input) Location 0
|
Name 21 "f4(f1;"
|
||||||
Decorate 67(@entryPointOutput) Location 0
|
Name 20 "input"
|
||||||
|
Name 26 "@PixelShaderFunction(f1;"
|
||||||
|
Name 25 "input"
|
||||||
|
Name 77 "param"
|
||||||
|
Name 80 "param"
|
||||||
|
Name 83 "param"
|
||||||
|
Name 90 "input"
|
||||||
|
Name 92 "input"
|
||||||
|
Name 95 "@entryPointOutput"
|
||||||
|
Name 96 "param"
|
||||||
|
Decorate 92(input) Location 0
|
||||||
|
Decorate 95(@entryPointOutput) Location 0
|
||||||
2: TypeVoid
|
2: TypeVoid
|
||||||
3: TypeFunction 2
|
3: TypeFunction 2
|
||||||
6: TypeFloat 32
|
10: TypeFloat 32
|
||||||
7: TypePointer Function 6(float)
|
11: TypePointer Function 10(float)
|
||||||
8: TypeVector 6(float) 4
|
12: TypeFunction 10(float) 11(ptr)
|
||||||
9: TypeFunction 8(fvec4) 7(ptr)
|
16: TypeFunction 2 11(ptr)
|
||||||
17: TypeBool
|
23: TypeVector 10(float) 4
|
||||||
18: 17(bool) ConstantFalse
|
24: TypeFunction 23(fvec4) 11(ptr)
|
||||||
31: 6(float) Constant 1073741824
|
32: TypeBool
|
||||||
38: 6(float) Constant 1065353216
|
33: 32(bool) ConstantFalse
|
||||||
41: 6(float) Constant 1092616192
|
47: 10(float) Constant 1073741824
|
||||||
63: TypePointer Input 6(float)
|
55: 10(float) Constant 1065353216
|
||||||
64(input): 63(ptr) Variable Input
|
58: 10(float) Constant 1092616192
|
||||||
66: TypePointer Output 8(fvec4)
|
91: TypePointer Input 10(float)
|
||||||
67(@entryPointOutput): 66(ptr) Variable Output
|
92(input): 91(ptr) Variable Input
|
||||||
|
94: TypePointer Output 23(fvec4)
|
||||||
|
95(@entryPointOutput): 94(ptr) Variable Output
|
||||||
4(PixelShaderFunction): 2 Function None 3
|
4(PixelShaderFunction): 2 Function None 3
|
||||||
5: Label
|
5: Label
|
||||||
62(input): 7(ptr) Variable Function
|
90(input): 11(ptr) Variable Function
|
||||||
68(param): 7(ptr) Variable Function
|
96(param): 11(ptr) Variable Function
|
||||||
65: 6(float) Load 64(input)
|
93: 10(float) Load 92(input)
|
||||||
Store 62(input) 65
|
Store 90(input) 93
|
||||||
69: 6(float) Load 62(input)
|
97: 10(float) Load 90(input)
|
||||||
Store 68(param) 69
|
Store 96(param) 97
|
||||||
70: 8(fvec4) FunctionCall 11(@PixelShaderFunction(f1;) 68(param)
|
98: 23(fvec4) FunctionCall 26(@PixelShaderFunction(f1;) 96(param)
|
||||||
Store 67(@entryPointOutput) 70
|
Store 95(@entryPointOutput) 98
|
||||||
Return
|
Return
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
11(@PixelShaderFunction(f1;): 8(fvec4) Function None 9
|
6(f0(): 2 Function None 3
|
||||||
10(input): 7(ptr) FunctionParameter
|
7: Label
|
||||||
12: Label
|
Branch 28
|
||||||
Branch 13
|
28: Label
|
||||||
13: Label
|
LoopMerge 30 31 Unroll
|
||||||
LoopMerge 15 16 Unroll
|
Branch 29
|
||||||
Branch 14
|
29: Label
|
||||||
14: Label
|
Branch 31
|
||||||
Branch 16
|
31: Label
|
||||||
16: Label
|
BranchConditional 33 28 30
|
||||||
BranchConditional 18 13 15
|
30: Label
|
||||||
15: Label
|
Return
|
||||||
Branch 19
|
FunctionEnd
|
||||||
19: Label
|
8(f1(): 2 Function None 3
|
||||||
LoopMerge 21 22 Unroll
|
9: Label
|
||||||
Branch 20
|
|
||||||
20: Label
|
|
||||||
Branch 22
|
|
||||||
22: Label
|
|
||||||
BranchConditional 18 19 21
|
|
||||||
21: Label
|
|
||||||
Branch 23
|
|
||||||
23: Label
|
|
||||||
LoopMerge 25 26 None
|
|
||||||
Branch 24
|
|
||||||
24: Label
|
|
||||||
27: 6(float) Load 10(input)
|
|
||||||
28: 8(fvec4) CompositeConstruct 27 27 27 27
|
|
||||||
ReturnValue 28
|
|
||||||
26: Label
|
|
||||||
30: 6(float) Load 10(input)
|
|
||||||
32: 17(bool) FOrdGreaterThan 30 31
|
|
||||||
BranchConditional 32 23 25
|
|
||||||
25: Label
|
|
||||||
Branch 33
|
|
||||||
33: Label
|
|
||||||
LoopMerge 35 36 None
|
|
||||||
Branch 34
|
Branch 34
|
||||||
34: Label
|
34: Label
|
||||||
37: 6(float) Load 10(input)
|
LoopMerge 36 37 Unroll
|
||||||
39: 6(float) FAdd 37 38
|
Branch 35
|
||||||
Store 10(input) 39
|
|
||||||
Branch 36
|
|
||||||
36: Label
|
|
||||||
40: 6(float) Load 10(input)
|
|
||||||
42: 17(bool) FOrdLessThan 40 41
|
|
||||||
BranchConditional 42 33 35
|
|
||||||
35: Label
|
35: Label
|
||||||
Branch 43
|
Branch 37
|
||||||
43: Label
|
37: Label
|
||||||
LoopMerge 45 46 None
|
BranchConditional 33 34 36
|
||||||
Branch 44
|
36: Label
|
||||||
44: Label
|
Return
|
||||||
Branch 47
|
FunctionEnd
|
||||||
47: Label
|
14(f2(f1;): 10(float) Function None 12
|
||||||
LoopMerge 49 50 None
|
13(input): 11(ptr) FunctionParameter
|
||||||
Branch 51
|
15: Label
|
||||||
51: Label
|
Branch 38
|
||||||
52: 6(float) Load 10(input)
|
38: Label
|
||||||
53: 6(float) FAdd 52 38
|
LoopMerge 40 41 None
|
||||||
Store 10(input) 53
|
Branch 39
|
||||||
54: 17(bool) FOrdLessThan 53 41
|
39: Label
|
||||||
BranchConditional 54 48 49
|
42: 10(float) Load 13(input)
|
||||||
48: Label
|
43: 23(fvec4) CompositeConstruct 42 42 42 42
|
||||||
|
44: 10(float) CompositeExtract 43 0
|
||||||
|
ReturnValue 44
|
||||||
|
41: Label
|
||||||
|
Branch 38
|
||||||
|
40: Label
|
||||||
|
Unreachable
|
||||||
|
FunctionEnd
|
||||||
|
18(f3(f1;): 2 Function None 16
|
||||||
|
17(input): 11(ptr) FunctionParameter
|
||||||
|
19: Label
|
||||||
Branch 50
|
Branch 50
|
||||||
50: Label
|
50: Label
|
||||||
Branch 47
|
LoopMerge 52 53 None
|
||||||
49: Label
|
Branch 51
|
||||||
Branch 46
|
51: Label
|
||||||
46: Label
|
54: 10(float) Load 17(input)
|
||||||
55: 6(float) Load 10(input)
|
56: 10(float) FAdd 54 55
|
||||||
56: 6(float) FAdd 55 38
|
Store 17(input) 56
|
||||||
Store 10(input) 56
|
Branch 53
|
||||||
57: 17(bool) FOrdLessThan 56 41
|
53: Label
|
||||||
BranchConditional 57 43 45
|
57: 10(float) Load 17(input)
|
||||||
45: Label
|
59: 32(bool) FOrdLessThan 57 58
|
||||||
58: 6(float) Load 10(input)
|
BranchConditional 59 50 52
|
||||||
59: 8(fvec4) CompositeConstruct 58 58 58 58
|
52: Label
|
||||||
ReturnValue 59
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
21(f4(f1;): 2 Function None 16
|
||||||
|
20(input): 11(ptr) FunctionParameter
|
||||||
|
22: Label
|
||||||
|
Branch 60
|
||||||
|
60: Label
|
||||||
|
LoopMerge 62 63 None
|
||||||
|
Branch 61
|
||||||
|
61: Label
|
||||||
|
Branch 64
|
||||||
|
64: Label
|
||||||
|
LoopMerge 66 67 None
|
||||||
|
Branch 68
|
||||||
|
68: Label
|
||||||
|
69: 10(float) Load 20(input)
|
||||||
|
70: 10(float) FAdd 69 55
|
||||||
|
Store 20(input) 70
|
||||||
|
71: 32(bool) FOrdLessThan 70 58
|
||||||
|
BranchConditional 71 65 66
|
||||||
|
65: Label
|
||||||
|
Branch 67
|
||||||
|
67: Label
|
||||||
|
Branch 64
|
||||||
|
66: Label
|
||||||
|
Branch 63
|
||||||
|
63: Label
|
||||||
|
72: 10(float) Load 20(input)
|
||||||
|
73: 10(float) FAdd 72 55
|
||||||
|
Store 20(input) 73
|
||||||
|
74: 32(bool) FOrdLessThan 73 58
|
||||||
|
BranchConditional 74 60 62
|
||||||
|
62: Label
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
26(@PixelShaderFunction(f1;): 23(fvec4) Function None 24
|
||||||
|
25(input): 11(ptr) FunctionParameter
|
||||||
|
27: Label
|
||||||
|
77(param): 11(ptr) Variable Function
|
||||||
|
80(param): 11(ptr) Variable Function
|
||||||
|
83(param): 11(ptr) Variable Function
|
||||||
|
75: 2 FunctionCall 6(f0()
|
||||||
|
76: 2 FunctionCall 8(f1()
|
||||||
|
78: 10(float) Load 25(input)
|
||||||
|
Store 77(param) 78
|
||||||
|
79: 10(float) FunctionCall 14(f2(f1;) 77(param)
|
||||||
|
81: 10(float) Load 25(input)
|
||||||
|
Store 80(param) 81
|
||||||
|
82: 2 FunctionCall 18(f3(f1;) 80(param)
|
||||||
|
84: 10(float) Load 25(input)
|
||||||
|
Store 83(param) 84
|
||||||
|
85: 2 FunctionCall 21(f4(f1;) 83(param)
|
||||||
|
86: 10(float) Load 25(input)
|
||||||
|
87: 23(fvec4) CompositeConstruct 86 86 86 86
|
||||||
|
ReturnValue 87
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,104 +2,116 @@ hlsl.if.frag
|
|||||||
Shader version: 500
|
Shader version: 500
|
||||||
gl_FragCoord origin is upper left
|
gl_FragCoord origin is upper left
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
|
0:1 Function Definition: f0(vf4; ( temp 4-component vector of float)
|
||||||
0:2 Function Parameters:
|
0:1 Function Parameters:
|
||||||
|
0:1 'input' ( in 4-component vector of float)
|
||||||
|
0:? Sequence
|
||||||
|
0:2 Test condition and select ( temp void)
|
||||||
|
0:2 Condition
|
||||||
|
0:2 all ( temp bool)
|
||||||
|
0:2 Equal ( temp 4-component vector of bool)
|
||||||
0:2 'input' ( in 4-component vector of float)
|
0:2 'input' ( in 4-component vector of float)
|
||||||
|
0:2 'input' ( in 4-component vector of float)
|
||||||
|
0:2 true case
|
||||||
|
0:3 Branch: Return with expression
|
||||||
|
0:3 'input' ( in 4-component vector of float)
|
||||||
|
0:2 false case
|
||||||
|
0:5 Branch: Return with expression
|
||||||
|
0:5 Negate value ( temp 4-component vector of float)
|
||||||
|
0:5 'input' ( in 4-component vector of float)
|
||||||
|
0:8 Function Definition: f1(vf4; ( temp 4-component vector of float)
|
||||||
|
0:8 Function Parameters:
|
||||||
|
0:8 'input' ( in 4-component vector of float)
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:3 Test condition and select ( temp void)
|
0:9 Test condition and select ( temp void)
|
||||||
0:3 Condition
|
0:9 Condition
|
||||||
0:3 all ( temp bool)
|
0:9 all ( temp bool)
|
||||||
0:3 Equal ( temp 4-component vector of bool)
|
0:9 Equal ( temp 4-component vector of bool)
|
||||||
0:3 'input' ( in 4-component vector of float)
|
|
||||||
0:3 'input' ( in 4-component vector of float)
|
|
||||||
0:3 true case
|
|
||||||
0:4 Branch: Return with expression
|
|
||||||
0:4 'input' ( in 4-component vector of float)
|
|
||||||
0:6 Test condition and select ( temp void)
|
|
||||||
0:6 Condition
|
|
||||||
0:6 all ( temp bool)
|
|
||||||
0:6 Equal ( temp 4-component vector of bool)
|
|
||||||
0:6 'input' ( in 4-component vector of float)
|
|
||||||
0:6 'input' ( in 4-component vector of float)
|
|
||||||
0:6 true case
|
|
||||||
0:7 Branch: Return with expression
|
|
||||||
0:7 'input' ( in 4-component vector of float)
|
|
||||||
0:6 false case
|
|
||||||
0:9 Branch: Return with expression
|
|
||||||
0:9 Negate value ( temp 4-component vector of float)
|
|
||||||
0:9 'input' ( in 4-component vector of float)
|
0:9 'input' ( in 4-component vector of float)
|
||||||
0:11 Test condition and select ( temp void)
|
0:9 'input' ( in 4-component vector of float)
|
||||||
0:11 Condition
|
0:9 true case
|
||||||
0:11 all ( temp bool)
|
|
||||||
0:11 Equal ( temp 4-component vector of bool)
|
|
||||||
0:11 'input' ( in 4-component vector of float)
|
|
||||||
0:11 'input' ( in 4-component vector of float)
|
|
||||||
0:11 true case is null
|
|
||||||
0:14 Test condition and select ( temp void)
|
|
||||||
0:14 Condition
|
|
||||||
0:14 all ( temp bool)
|
|
||||||
0:14 Equal ( temp 4-component vector of bool)
|
|
||||||
0:14 'input' ( in 4-component vector of float)
|
|
||||||
0:14 'input' ( in 4-component vector of float)
|
|
||||||
0:14 true case is null
|
|
||||||
0:19 Test condition and select ( temp void): Flatten
|
|
||||||
0:19 Condition
|
|
||||||
0:19 all ( temp bool)
|
|
||||||
0:19 Equal ( temp 4-component vector of bool)
|
|
||||||
0:19 'input' ( in 4-component vector of float)
|
|
||||||
0:19 'input' ( in 4-component vector of float)
|
|
||||||
0:19 true case
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:20 Branch: Return with expression
|
0:10 Branch: Return with expression
|
||||||
0:20 'input' ( in 4-component vector of float)
|
0:10 'input' ( in 4-component vector of float)
|
||||||
|
0:9 false case
|
||||||
|
0:? Sequence
|
||||||
|
0:12 Branch: Return with expression
|
||||||
|
0:12 Negate value ( temp 4-component vector of float)
|
||||||
|
0:12 'input' ( in 4-component vector of float)
|
||||||
|
0:17 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
|
||||||
|
0:17 Function Parameters:
|
||||||
|
0:17 'input' ( in 4-component vector of float)
|
||||||
|
0:? Sequence
|
||||||
|
0:18 Test condition and select ( temp void)
|
||||||
|
0:18 Condition
|
||||||
|
0:18 all ( temp bool)
|
||||||
|
0:18 Equal ( temp 4-component vector of bool)
|
||||||
|
0:18 'input' ( in 4-component vector of float)
|
||||||
|
0:18 'input' ( in 4-component vector of float)
|
||||||
|
0:18 true case
|
||||||
|
0:19 Branch: Return with expression
|
||||||
|
0:19 'input' ( in 4-component vector of float)
|
||||||
|
0:21 Function Call: f0(vf4; ( temp 4-component vector of float)
|
||||||
|
0:21 'input' ( in 4-component vector of float)
|
||||||
0:23 Test condition and select ( temp void)
|
0:23 Test condition and select ( temp void)
|
||||||
0:23 Condition
|
0:23 Condition
|
||||||
0:23 all ( temp bool)
|
0:23 all ( temp bool)
|
||||||
0:23 Equal ( temp 4-component vector of bool)
|
0:23 Equal ( temp 4-component vector of bool)
|
||||||
0:23 'input' ( in 4-component vector of float)
|
0:23 'input' ( in 4-component vector of float)
|
||||||
0:23 'input' ( in 4-component vector of float)
|
0:23 'input' ( in 4-component vector of float)
|
||||||
0:23 true case
|
0:23 true case is null
|
||||||
0:? Sequence
|
0:26 Test condition and select ( temp void)
|
||||||
0:24 Branch: Return with expression
|
0:26 Condition
|
||||||
0:24 'input' ( in 4-component vector of float)
|
0:26 all ( temp bool)
|
||||||
0:23 false case
|
0:26 Equal ( temp 4-component vector of bool)
|
||||||
0:? Sequence
|
|
||||||
0:26 Branch: Return with expression
|
|
||||||
0:26 Negate value ( temp 4-component vector of float)
|
|
||||||
0:26 'input' ( in 4-component vector of float)
|
0:26 'input' ( in 4-component vector of float)
|
||||||
0:30 Test condition and select ( temp void)
|
0:26 'input' ( in 4-component vector of float)
|
||||||
0:30 Condition
|
0:26 true case is null
|
||||||
0:30 Convert float to bool ( temp bool)
|
0:31 Test condition and select ( temp void): Flatten
|
||||||
0:30 move second child to first child ( temp float)
|
0:31 Condition
|
||||||
0:30 'ii' ( temp float)
|
0:31 all ( temp bool)
|
||||||
0:30 direct index ( temp float)
|
0:31 Equal ( temp 4-component vector of bool)
|
||||||
0:30 'input' ( in 4-component vector of float)
|
0:31 'input' ( in 4-component vector of float)
|
||||||
0:30 Constant:
|
0:31 'input' ( in 4-component vector of float)
|
||||||
0:30 2 (const int)
|
0:31 true case
|
||||||
0:30 true case
|
|
||||||
0:31 Pre-Increment ( temp float)
|
|
||||||
0:31 'ii' ( temp float)
|
|
||||||
0:32 Pre-Increment ( temp int)
|
|
||||||
0:32 'ii' ( temp int)
|
|
||||||
0:33 Test condition and select ( temp void)
|
|
||||||
0:33 Condition
|
|
||||||
0:33 Compare Equal ( temp bool)
|
|
||||||
0:33 Convert int to float ( temp float)
|
|
||||||
0:33 'ii' ( temp int)
|
|
||||||
0:33 Constant:
|
|
||||||
0:33 1.000000
|
|
||||||
0:33 true case
|
|
||||||
0:34 Pre-Increment ( temp int)
|
|
||||||
0:34 'ii' ( temp int)
|
|
||||||
0:2 Function Definition: PixelShaderFunction( ( temp void)
|
|
||||||
0:2 Function Parameters:
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:2 move second child to first child ( temp 4-component vector of float)
|
0:32 Branch: Return with expression
|
||||||
|
0:32 'input' ( in 4-component vector of float)
|
||||||
|
0:35 Function Call: f1(vf4; ( temp 4-component vector of float)
|
||||||
|
0:35 'input' ( in 4-component vector of float)
|
||||||
|
0:38 Test condition and select ( temp void)
|
||||||
|
0:38 Condition
|
||||||
|
0:38 Convert float to bool ( temp bool)
|
||||||
|
0:38 move second child to first child ( temp float)
|
||||||
|
0:38 'ii' ( temp float)
|
||||||
|
0:38 direct index ( temp float)
|
||||||
|
0:38 'input' ( in 4-component vector of float)
|
||||||
|
0:38 Constant:
|
||||||
|
0:38 2 (const int)
|
||||||
|
0:38 true case
|
||||||
|
0:39 Pre-Increment ( temp float)
|
||||||
|
0:39 'ii' ( temp float)
|
||||||
|
0:40 Pre-Increment ( temp int)
|
||||||
|
0:40 'ii' ( temp int)
|
||||||
|
0:41 Test condition and select ( temp void)
|
||||||
|
0:41 Condition
|
||||||
|
0:41 Compare Equal ( temp bool)
|
||||||
|
0:41 Convert int to float ( temp float)
|
||||||
|
0:41 'ii' ( temp int)
|
||||||
|
0:41 Constant:
|
||||||
|
0:41 1.000000
|
||||||
|
0:41 true case
|
||||||
|
0:42 Pre-Increment ( temp int)
|
||||||
|
0:42 'ii' ( temp int)
|
||||||
|
0:17 Function Definition: PixelShaderFunction( ( temp void)
|
||||||
|
0:17 Function Parameters:
|
||||||
|
0:? Sequence
|
||||||
|
0:17 move second child to first child ( temp 4-component vector of float)
|
||||||
0:? 'input' ( temp 4-component vector of float)
|
0:? 'input' ( temp 4-component vector of float)
|
||||||
0:? 'input' (layout( location=0) in 4-component vector of float)
|
0:? 'input' (layout( location=0) in 4-component vector of float)
|
||||||
0:2 move second child to first child ( temp 4-component vector of float)
|
0:17 move second child to first child ( temp 4-component vector of float)
|
||||||
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
||||||
0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
|
0:17 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
|
||||||
0:? 'input' ( temp 4-component vector of float)
|
0:? 'input' ( temp 4-component vector of float)
|
||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
||||||
@ -112,104 +124,116 @@ Linked fragment stage:
|
|||||||
Shader version: 500
|
Shader version: 500
|
||||||
gl_FragCoord origin is upper left
|
gl_FragCoord origin is upper left
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:2 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
|
0:1 Function Definition: f0(vf4; ( temp 4-component vector of float)
|
||||||
0:2 Function Parameters:
|
0:1 Function Parameters:
|
||||||
|
0:1 'input' ( in 4-component vector of float)
|
||||||
|
0:? Sequence
|
||||||
|
0:2 Test condition and select ( temp void)
|
||||||
|
0:2 Condition
|
||||||
|
0:2 all ( temp bool)
|
||||||
|
0:2 Equal ( temp 4-component vector of bool)
|
||||||
0:2 'input' ( in 4-component vector of float)
|
0:2 'input' ( in 4-component vector of float)
|
||||||
|
0:2 'input' ( in 4-component vector of float)
|
||||||
|
0:2 true case
|
||||||
|
0:3 Branch: Return with expression
|
||||||
|
0:3 'input' ( in 4-component vector of float)
|
||||||
|
0:2 false case
|
||||||
|
0:5 Branch: Return with expression
|
||||||
|
0:5 Negate value ( temp 4-component vector of float)
|
||||||
|
0:5 'input' ( in 4-component vector of float)
|
||||||
|
0:8 Function Definition: f1(vf4; ( temp 4-component vector of float)
|
||||||
|
0:8 Function Parameters:
|
||||||
|
0:8 'input' ( in 4-component vector of float)
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:3 Test condition and select ( temp void)
|
0:9 Test condition and select ( temp void)
|
||||||
0:3 Condition
|
0:9 Condition
|
||||||
0:3 all ( temp bool)
|
0:9 all ( temp bool)
|
||||||
0:3 Equal ( temp 4-component vector of bool)
|
0:9 Equal ( temp 4-component vector of bool)
|
||||||
0:3 'input' ( in 4-component vector of float)
|
|
||||||
0:3 'input' ( in 4-component vector of float)
|
|
||||||
0:3 true case
|
|
||||||
0:4 Branch: Return with expression
|
|
||||||
0:4 'input' ( in 4-component vector of float)
|
|
||||||
0:6 Test condition and select ( temp void)
|
|
||||||
0:6 Condition
|
|
||||||
0:6 all ( temp bool)
|
|
||||||
0:6 Equal ( temp 4-component vector of bool)
|
|
||||||
0:6 'input' ( in 4-component vector of float)
|
|
||||||
0:6 'input' ( in 4-component vector of float)
|
|
||||||
0:6 true case
|
|
||||||
0:7 Branch: Return with expression
|
|
||||||
0:7 'input' ( in 4-component vector of float)
|
|
||||||
0:6 false case
|
|
||||||
0:9 Branch: Return with expression
|
|
||||||
0:9 Negate value ( temp 4-component vector of float)
|
|
||||||
0:9 'input' ( in 4-component vector of float)
|
0:9 'input' ( in 4-component vector of float)
|
||||||
0:11 Test condition and select ( temp void)
|
0:9 'input' ( in 4-component vector of float)
|
||||||
0:11 Condition
|
0:9 true case
|
||||||
0:11 all ( temp bool)
|
|
||||||
0:11 Equal ( temp 4-component vector of bool)
|
|
||||||
0:11 'input' ( in 4-component vector of float)
|
|
||||||
0:11 'input' ( in 4-component vector of float)
|
|
||||||
0:11 true case is null
|
|
||||||
0:14 Test condition and select ( temp void)
|
|
||||||
0:14 Condition
|
|
||||||
0:14 all ( temp bool)
|
|
||||||
0:14 Equal ( temp 4-component vector of bool)
|
|
||||||
0:14 'input' ( in 4-component vector of float)
|
|
||||||
0:14 'input' ( in 4-component vector of float)
|
|
||||||
0:14 true case is null
|
|
||||||
0:19 Test condition and select ( temp void): Flatten
|
|
||||||
0:19 Condition
|
|
||||||
0:19 all ( temp bool)
|
|
||||||
0:19 Equal ( temp 4-component vector of bool)
|
|
||||||
0:19 'input' ( in 4-component vector of float)
|
|
||||||
0:19 'input' ( in 4-component vector of float)
|
|
||||||
0:19 true case
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:20 Branch: Return with expression
|
0:10 Branch: Return with expression
|
||||||
0:20 'input' ( in 4-component vector of float)
|
0:10 'input' ( in 4-component vector of float)
|
||||||
|
0:9 false case
|
||||||
|
0:? Sequence
|
||||||
|
0:12 Branch: Return with expression
|
||||||
|
0:12 Negate value ( temp 4-component vector of float)
|
||||||
|
0:12 'input' ( in 4-component vector of float)
|
||||||
|
0:17 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
|
||||||
|
0:17 Function Parameters:
|
||||||
|
0:17 'input' ( in 4-component vector of float)
|
||||||
|
0:? Sequence
|
||||||
|
0:18 Test condition and select ( temp void)
|
||||||
|
0:18 Condition
|
||||||
|
0:18 all ( temp bool)
|
||||||
|
0:18 Equal ( temp 4-component vector of bool)
|
||||||
|
0:18 'input' ( in 4-component vector of float)
|
||||||
|
0:18 'input' ( in 4-component vector of float)
|
||||||
|
0:18 true case
|
||||||
|
0:19 Branch: Return with expression
|
||||||
|
0:19 'input' ( in 4-component vector of float)
|
||||||
|
0:21 Function Call: f0(vf4; ( temp 4-component vector of float)
|
||||||
|
0:21 'input' ( in 4-component vector of float)
|
||||||
0:23 Test condition and select ( temp void)
|
0:23 Test condition and select ( temp void)
|
||||||
0:23 Condition
|
0:23 Condition
|
||||||
0:23 all ( temp bool)
|
0:23 all ( temp bool)
|
||||||
0:23 Equal ( temp 4-component vector of bool)
|
0:23 Equal ( temp 4-component vector of bool)
|
||||||
0:23 'input' ( in 4-component vector of float)
|
0:23 'input' ( in 4-component vector of float)
|
||||||
0:23 'input' ( in 4-component vector of float)
|
0:23 'input' ( in 4-component vector of float)
|
||||||
0:23 true case
|
0:23 true case is null
|
||||||
0:? Sequence
|
0:26 Test condition and select ( temp void)
|
||||||
0:24 Branch: Return with expression
|
0:26 Condition
|
||||||
0:24 'input' ( in 4-component vector of float)
|
0:26 all ( temp bool)
|
||||||
0:23 false case
|
0:26 Equal ( temp 4-component vector of bool)
|
||||||
0:? Sequence
|
|
||||||
0:26 Branch: Return with expression
|
|
||||||
0:26 Negate value ( temp 4-component vector of float)
|
|
||||||
0:26 'input' ( in 4-component vector of float)
|
0:26 'input' ( in 4-component vector of float)
|
||||||
0:30 Test condition and select ( temp void)
|
0:26 'input' ( in 4-component vector of float)
|
||||||
0:30 Condition
|
0:26 true case is null
|
||||||
0:30 Convert float to bool ( temp bool)
|
0:31 Test condition and select ( temp void): Flatten
|
||||||
0:30 move second child to first child ( temp float)
|
0:31 Condition
|
||||||
0:30 'ii' ( temp float)
|
0:31 all ( temp bool)
|
||||||
0:30 direct index ( temp float)
|
0:31 Equal ( temp 4-component vector of bool)
|
||||||
0:30 'input' ( in 4-component vector of float)
|
0:31 'input' ( in 4-component vector of float)
|
||||||
0:30 Constant:
|
0:31 'input' ( in 4-component vector of float)
|
||||||
0:30 2 (const int)
|
0:31 true case
|
||||||
0:30 true case
|
|
||||||
0:31 Pre-Increment ( temp float)
|
|
||||||
0:31 'ii' ( temp float)
|
|
||||||
0:32 Pre-Increment ( temp int)
|
|
||||||
0:32 'ii' ( temp int)
|
|
||||||
0:33 Test condition and select ( temp void)
|
|
||||||
0:33 Condition
|
|
||||||
0:33 Compare Equal ( temp bool)
|
|
||||||
0:33 Convert int to float ( temp float)
|
|
||||||
0:33 'ii' ( temp int)
|
|
||||||
0:33 Constant:
|
|
||||||
0:33 1.000000
|
|
||||||
0:33 true case
|
|
||||||
0:34 Pre-Increment ( temp int)
|
|
||||||
0:34 'ii' ( temp int)
|
|
||||||
0:2 Function Definition: PixelShaderFunction( ( temp void)
|
|
||||||
0:2 Function Parameters:
|
|
||||||
0:? Sequence
|
0:? Sequence
|
||||||
0:2 move second child to first child ( temp 4-component vector of float)
|
0:32 Branch: Return with expression
|
||||||
|
0:32 'input' ( in 4-component vector of float)
|
||||||
|
0:35 Function Call: f1(vf4; ( temp 4-component vector of float)
|
||||||
|
0:35 'input' ( in 4-component vector of float)
|
||||||
|
0:38 Test condition and select ( temp void)
|
||||||
|
0:38 Condition
|
||||||
|
0:38 Convert float to bool ( temp bool)
|
||||||
|
0:38 move second child to first child ( temp float)
|
||||||
|
0:38 'ii' ( temp float)
|
||||||
|
0:38 direct index ( temp float)
|
||||||
|
0:38 'input' ( in 4-component vector of float)
|
||||||
|
0:38 Constant:
|
||||||
|
0:38 2 (const int)
|
||||||
|
0:38 true case
|
||||||
|
0:39 Pre-Increment ( temp float)
|
||||||
|
0:39 'ii' ( temp float)
|
||||||
|
0:40 Pre-Increment ( temp int)
|
||||||
|
0:40 'ii' ( temp int)
|
||||||
|
0:41 Test condition and select ( temp void)
|
||||||
|
0:41 Condition
|
||||||
|
0:41 Compare Equal ( temp bool)
|
||||||
|
0:41 Convert int to float ( temp float)
|
||||||
|
0:41 'ii' ( temp int)
|
||||||
|
0:41 Constant:
|
||||||
|
0:41 1.000000
|
||||||
|
0:41 true case
|
||||||
|
0:42 Pre-Increment ( temp int)
|
||||||
|
0:42 'ii' ( temp int)
|
||||||
|
0:17 Function Definition: PixelShaderFunction( ( temp void)
|
||||||
|
0:17 Function Parameters:
|
||||||
|
0:? Sequence
|
||||||
|
0:17 move second child to first child ( temp 4-component vector of float)
|
||||||
0:? 'input' ( temp 4-component vector of float)
|
0:? 'input' ( temp 4-component vector of float)
|
||||||
0:? 'input' (layout( location=0) in 4-component vector of float)
|
0:? 'input' (layout( location=0) in 4-component vector of float)
|
||||||
0:2 move second child to first child ( temp 4-component vector of float)
|
0:17 move second child to first child ( temp 4-component vector of float)
|
||||||
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
||||||
0:2 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
|
0:17 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
|
||||||
0:? 'input' ( temp 4-component vector of float)
|
0:? 'input' ( temp 4-component vector of float)
|
||||||
0:? Linker Objects
|
0:? Linker Objects
|
||||||
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
|
||||||
@ -217,154 +241,178 @@ gl_FragCoord origin is upper left
|
|||||||
|
|
||||||
// Module Version 10000
|
// Module Version 10000
|
||||||
// Generated by (magic number): 80007
|
// Generated by (magic number): 80007
|
||||||
// Id's are bound by 103
|
// Id's are bound by 117
|
||||||
|
|
||||||
Capability Shader
|
Capability Shader
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
MemoryModel Logical GLSL450
|
MemoryModel Logical GLSL450
|
||||||
EntryPoint Fragment 4 "PixelShaderFunction" 96 99
|
EntryPoint Fragment 4 "PixelShaderFunction" 110 113
|
||||||
ExecutionMode 4 OriginUpperLeft
|
ExecutionMode 4 OriginUpperLeft
|
||||||
Source HLSL 500
|
Source HLSL 500
|
||||||
Name 4 "PixelShaderFunction"
|
Name 4 "PixelShaderFunction"
|
||||||
Name 11 "@PixelShaderFunction(vf4;"
|
Name 11 "f0(vf4;"
|
||||||
Name 10 "input"
|
Name 10 "input"
|
||||||
Name 68 "ii"
|
Name 14 "f1(vf4;"
|
||||||
|
Name 13 "input"
|
||||||
|
Name 17 "@PixelShaderFunction(vf4;"
|
||||||
|
Name 16 "input"
|
||||||
|
Name 55 "param"
|
||||||
|
Name 78 "param"
|
||||||
Name 82 "ii"
|
Name 82 "ii"
|
||||||
Name 94 "input"
|
Name 96 "ii"
|
||||||
Name 96 "input"
|
Name 108 "input"
|
||||||
Name 99 "@entryPointOutput"
|
Name 110 "input"
|
||||||
Name 100 "param"
|
Name 113 "@entryPointOutput"
|
||||||
Decorate 96(input) Location 0
|
Name 114 "param"
|
||||||
Decorate 99(@entryPointOutput) Location 0
|
Decorate 110(input) Location 0
|
||||||
|
Decorate 113(@entryPointOutput) Location 0
|
||||||
2: TypeVoid
|
2: TypeVoid
|
||||||
3: TypeFunction 2
|
3: TypeFunction 2
|
||||||
6: TypeFloat 32
|
6: TypeFloat 32
|
||||||
7: TypeVector 6(float) 4
|
7: TypeVector 6(float) 4
|
||||||
8: TypePointer Function 7(fvec4)
|
8: TypePointer Function 7(fvec4)
|
||||||
9: TypeFunction 7(fvec4) 8(ptr)
|
9: TypeFunction 7(fvec4) 8(ptr)
|
||||||
15: TypeBool
|
21: TypeBool
|
||||||
16: TypeVector 15(bool) 4
|
22: TypeVector 21(bool) 4
|
||||||
67: TypePointer Function 6(float)
|
81: TypePointer Function 6(float)
|
||||||
69: TypeInt 32 0
|
83: TypeInt 32 0
|
||||||
70: 69(int) Constant 2
|
84: 83(int) Constant 2
|
||||||
73: 6(float) Constant 0
|
87: 6(float) Constant 0
|
||||||
78: 6(float) Constant 1065353216
|
92: 6(float) Constant 1065353216
|
||||||
80: TypeInt 32 1
|
94: TypeInt 32 1
|
||||||
81: TypePointer Function 80(int)
|
95: TypePointer Function 94(int)
|
||||||
84: 80(int) Constant 1
|
98: 94(int) Constant 1
|
||||||
95: TypePointer Input 7(fvec4)
|
109: TypePointer Input 7(fvec4)
|
||||||
96(input): 95(ptr) Variable Input
|
110(input): 109(ptr) Variable Input
|
||||||
98: TypePointer Output 7(fvec4)
|
112: TypePointer Output 7(fvec4)
|
||||||
99(@entryPointOutput): 98(ptr) Variable Output
|
113(@entryPointOutput): 112(ptr) Variable Output
|
||||||
4(PixelShaderFunction): 2 Function None 3
|
4(PixelShaderFunction): 2 Function None 3
|
||||||
5: Label
|
5: Label
|
||||||
94(input): 8(ptr) Variable Function
|
108(input): 8(ptr) Variable Function
|
||||||
100(param): 8(ptr) Variable Function
|
114(param): 8(ptr) Variable Function
|
||||||
97: 7(fvec4) Load 96(input)
|
111: 7(fvec4) Load 110(input)
|
||||||
Store 94(input) 97
|
Store 108(input) 111
|
||||||
101: 7(fvec4) Load 94(input)
|
115: 7(fvec4) Load 108(input)
|
||||||
Store 100(param) 101
|
Store 114(param) 115
|
||||||
102: 7(fvec4) FunctionCall 11(@PixelShaderFunction(vf4;) 100(param)
|
116: 7(fvec4) FunctionCall 17(@PixelShaderFunction(vf4;) 114(param)
|
||||||
Store 99(@entryPointOutput) 102
|
Store 113(@entryPointOutput) 116
|
||||||
Return
|
Return
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
11(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9
|
11(f0(vf4;): 7(fvec4) Function None 9
|
||||||
10(input): 8(ptr) FunctionParameter
|
10(input): 8(ptr) FunctionParameter
|
||||||
12: Label
|
12: Label
|
||||||
68(ii): 67(ptr) Variable Function
|
19: 7(fvec4) Load 10(input)
|
||||||
82(ii): 81(ptr) Variable Function
|
20: 7(fvec4) Load 10(input)
|
||||||
13: 7(fvec4) Load 10(input)
|
23: 22(bvec4) FOrdEqual 19 20
|
||||||
14: 7(fvec4) Load 10(input)
|
24: 21(bool) All 23
|
||||||
17: 16(bvec4) FOrdEqual 13 14
|
SelectionMerge 26 None
|
||||||
18: 15(bool) All 17
|
BranchConditional 24 25 29
|
||||||
SelectionMerge 20 None
|
25: Label
|
||||||
BranchConditional 18 19 20
|
27: 7(fvec4) Load 10(input)
|
||||||
19: Label
|
ReturnValue 27
|
||||||
21: 7(fvec4) Load 10(input)
|
29: Label
|
||||||
ReturnValue 21
|
30: 7(fvec4) Load 10(input)
|
||||||
20: Label
|
31: 7(fvec4) FNegate 30
|
||||||
23: 7(fvec4) Load 10(input)
|
ReturnValue 31
|
||||||
24: 7(fvec4) Load 10(input)
|
26: Label
|
||||||
25: 16(bvec4) FOrdEqual 23 24
|
Unreachable
|
||||||
26: 15(bool) All 25
|
FunctionEnd
|
||||||
SelectionMerge 28 None
|
14(f1(vf4;): 7(fvec4) Function None 9
|
||||||
BranchConditional 26 27 31
|
13(input): 8(ptr) FunctionParameter
|
||||||
27: Label
|
15: Label
|
||||||
29: 7(fvec4) Load 10(input)
|
34: 7(fvec4) Load 13(input)
|
||||||
ReturnValue 29
|
35: 7(fvec4) Load 13(input)
|
||||||
31: Label
|
36: 22(bvec4) FOrdEqual 34 35
|
||||||
32: 7(fvec4) Load 10(input)
|
37: 21(bool) All 36
|
||||||
33: 7(fvec4) FNegate 32
|
SelectionMerge 39 None
|
||||||
ReturnValue 33
|
BranchConditional 37 38 42
|
||||||
28: Label
|
38: Label
|
||||||
35: 7(fvec4) Load 10(input)
|
40: 7(fvec4) Load 13(input)
|
||||||
36: 7(fvec4) Load 10(input)
|
ReturnValue 40
|
||||||
37: 16(bvec4) FOrdEqual 35 36
|
42: Label
|
||||||
38: 15(bool) All 37
|
43: 7(fvec4) Load 13(input)
|
||||||
SelectionMerge 40 None
|
44: 7(fvec4) FNegate 43
|
||||||
BranchConditional 38 39 40
|
ReturnValue 44
|
||||||
39: Label
|
39: Label
|
||||||
Branch 40
|
Unreachable
|
||||||
40: Label
|
FunctionEnd
|
||||||
41: 7(fvec4) Load 10(input)
|
17(@PixelShaderFunction(vf4;): 7(fvec4) Function None 9
|
||||||
42: 7(fvec4) Load 10(input)
|
16(input): 8(ptr) FunctionParameter
|
||||||
43: 16(bvec4) FOrdEqual 41 42
|
18: Label
|
||||||
44: 15(bool) All 43
|
55(param): 8(ptr) Variable Function
|
||||||
SelectionMerge 46 None
|
78(param): 8(ptr) Variable Function
|
||||||
BranchConditional 44 45 46
|
82(ii): 81(ptr) Variable Function
|
||||||
45: Label
|
96(ii): 95(ptr) Variable Function
|
||||||
Branch 46
|
47: 7(fvec4) Load 16(input)
|
||||||
46: Label
|
48: 7(fvec4) Load 16(input)
|
||||||
47: 7(fvec4) Load 10(input)
|
49: 22(bvec4) FOrdEqual 47 48
|
||||||
48: 7(fvec4) Load 10(input)
|
50: 21(bool) All 49
|
||||||
49: 16(bvec4) FOrdEqual 47 48
|
SelectionMerge 52 None
|
||||||
50: 15(bool) All 49
|
|
||||||
SelectionMerge 52 Flatten
|
|
||||||
BranchConditional 50 51 52
|
BranchConditional 50 51 52
|
||||||
51: Label
|
51: Label
|
||||||
53: 7(fvec4) Load 10(input)
|
53: 7(fvec4) Load 16(input)
|
||||||
ReturnValue 53
|
ReturnValue 53
|
||||||
52: Label
|
52: Label
|
||||||
55: 7(fvec4) Load 10(input)
|
56: 7(fvec4) Load 16(input)
|
||||||
56: 7(fvec4) Load 10(input)
|
Store 55(param) 56
|
||||||
57: 16(bvec4) FOrdEqual 55 56
|
57: 7(fvec4) FunctionCall 11(f0(vf4;) 55(param)
|
||||||
58: 15(bool) All 57
|
58: 7(fvec4) Load 16(input)
|
||||||
SelectionMerge 60 None
|
59: 7(fvec4) Load 16(input)
|
||||||
BranchConditional 58 59 63
|
60: 22(bvec4) FOrdEqual 58 59
|
||||||
59: Label
|
61: 21(bool) All 60
|
||||||
61: 7(fvec4) Load 10(input)
|
SelectionMerge 63 None
|
||||||
ReturnValue 61
|
BranchConditional 61 62 63
|
||||||
|
62: Label
|
||||||
|
Branch 63
|
||||||
63: Label
|
63: Label
|
||||||
64: 7(fvec4) Load 10(input)
|
64: 7(fvec4) Load 16(input)
|
||||||
65: 7(fvec4) FNegate 64
|
65: 7(fvec4) Load 16(input)
|
||||||
ReturnValue 65
|
66: 22(bvec4) FOrdEqual 64 65
|
||||||
60: Label
|
67: 21(bool) All 66
|
||||||
71: 67(ptr) AccessChain 10(input) 70
|
SelectionMerge 69 None
|
||||||
72: 6(float) Load 71
|
BranchConditional 67 68 69
|
||||||
Store 68(ii) 72
|
68: Label
|
||||||
74: 15(bool) FOrdNotEqual 72 73
|
Branch 69
|
||||||
SelectionMerge 76 None
|
69: Label
|
||||||
BranchConditional 74 75 76
|
70: 7(fvec4) Load 16(input)
|
||||||
|
71: 7(fvec4) Load 16(input)
|
||||||
|
72: 22(bvec4) FOrdEqual 70 71
|
||||||
|
73: 21(bool) All 72
|
||||||
|
SelectionMerge 75 Flatten
|
||||||
|
BranchConditional 73 74 75
|
||||||
|
74: Label
|
||||||
|
76: 7(fvec4) Load 16(input)
|
||||||
|
ReturnValue 76
|
||||||
75: Label
|
75: Label
|
||||||
77: 6(float) Load 68(ii)
|
79: 7(fvec4) Load 16(input)
|
||||||
79: 6(float) FAdd 77 78
|
Store 78(param) 79
|
||||||
Store 68(ii) 79
|
80: 7(fvec4) FunctionCall 14(f1(vf4;) 78(param)
|
||||||
Branch 76
|
85: 81(ptr) AccessChain 16(input) 84
|
||||||
76: Label
|
86: 6(float) Load 85
|
||||||
83: 80(int) Load 82(ii)
|
Store 82(ii) 86
|
||||||
85: 80(int) IAdd 83 84
|
88: 21(bool) FOrdNotEqual 86 87
|
||||||
Store 82(ii) 85
|
|
||||||
86: 80(int) Load 82(ii)
|
|
||||||
87: 6(float) ConvertSToF 86
|
|
||||||
88: 15(bool) FOrdEqual 87 78
|
|
||||||
SelectionMerge 90 None
|
SelectionMerge 90 None
|
||||||
BranchConditional 88 89 90
|
BranchConditional 88 89 90
|
||||||
89: Label
|
89: Label
|
||||||
91: 80(int) Load 82(ii)
|
91: 6(float) Load 82(ii)
|
||||||
92: 80(int) IAdd 91 84
|
93: 6(float) FAdd 91 92
|
||||||
Store 82(ii) 92
|
Store 82(ii) 93
|
||||||
Branch 90
|
Branch 90
|
||||||
90: Label
|
90: Label
|
||||||
93: 7(fvec4) Undef
|
97: 94(int) Load 96(ii)
|
||||||
ReturnValue 93
|
99: 94(int) IAdd 97 98
|
||||||
|
Store 96(ii) 99
|
||||||
|
100: 94(int) Load 96(ii)
|
||||||
|
101: 6(float) ConvertSToF 100
|
||||||
|
102: 21(bool) FOrdEqual 101 92
|
||||||
|
SelectionMerge 104 None
|
||||||
|
BranchConditional 102 103 104
|
||||||
|
103: Label
|
||||||
|
105: 94(int) Load 96(ii)
|
||||||
|
106: 94(int) IAdd 105 98
|
||||||
|
Store 96(ii) 106
|
||||||
|
Branch 104
|
||||||
|
104: Label
|
||||||
|
107: 7(fvec4) Undef
|
||||||
|
ReturnValue 107
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -305,6 +305,5 @@ gl_FragCoord origin is upper left
|
|||||||
66: 9(fvec4) CompositeConstruct 65 65 65 65
|
66: 9(fvec4) CompositeConstruct 65 65 65 65
|
||||||
ReturnValue 66
|
ReturnValue 66
|
||||||
45: Label
|
45: Label
|
||||||
68: 9(fvec4) Undef
|
Unreachable
|
||||||
ReturnValue 68
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -344,6 +344,5 @@ gl_FragCoord origin is upper left
|
|||||||
84: 9(fvec4) CompositeConstruct 83 83 83 83
|
84: 9(fvec4) CompositeConstruct 83 83 83 83
|
||||||
ReturnValue 84
|
ReturnValue 84
|
||||||
53: Label
|
53: Label
|
||||||
86: 9(fvec4) Undef
|
Unreachable
|
||||||
ReturnValue 86
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -303,6 +303,5 @@ gl_FragCoord origin is upper left
|
|||||||
66: 9(fvec4) CompositeConstruct 65 65 65 65
|
66: 9(fvec4) CompositeConstruct 65 65 65 65
|
||||||
ReturnValue 66
|
ReturnValue 66
|
||||||
45: Label
|
45: Label
|
||||||
68: 9(fvec4) Undef
|
Unreachable
|
||||||
ReturnValue 68
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -118,6 +118,5 @@ gl_FragCoord origin is upper left
|
|||||||
23: Label
|
23: Label
|
||||||
ReturnValue 24
|
ReturnValue 24
|
||||||
16: Label
|
16: Label
|
||||||
26: 7(fvec4) Undef
|
Unreachable
|
||||||
ReturnValue 26
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -88,7 +88,7 @@ remap.similar_1a.everything.frag
|
|||||||
22102: 649(ptr) Variable Function
|
22102: 649(ptr) Variable Function
|
||||||
24151: 12(int) Load 4408
|
24151: 12(int) Load 4408
|
||||||
13868: 9(bool) SGreaterThan 24151 2577
|
13868: 9(bool) SGreaterThan 24151 2577
|
||||||
SelectionMerge 22309 None
|
SelectionMerge 14966 None
|
||||||
BranchConditional 13868 9492 17416
|
BranchConditional 13868 9492 17416
|
||||||
9492: Label
|
9492: Label
|
||||||
15624: 12(int) Load 4408
|
15624: 12(int) Load 4408
|
||||||
@ -109,7 +109,6 @@ remap.similar_1a.everything.frag
|
|||||||
10505: 12(int) IAdd 11462 21176
|
10505: 12(int) IAdd 11462 21176
|
||||||
14626: 13(float) ConvertSToF 10505
|
14626: 13(float) ConvertSToF 10505
|
||||||
ReturnValue 14626
|
ReturnValue 14626
|
||||||
22309: Label
|
14966: Label
|
||||||
6429: 13(float) Undef
|
Unreachable
|
||||||
ReturnValue 6429
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -124,6 +124,5 @@ remap.similar_1a.none.frag
|
|||||||
68: 8(float) ConvertSToF 67
|
68: 8(float) ConvertSToF 67
|
||||||
ReturnValue 68
|
ReturnValue 68
|
||||||
43: Label
|
43: Label
|
||||||
70: 8(float) Undef
|
Unreachable
|
||||||
ReturnValue 70
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -93,7 +93,7 @@ remap.similar_1b.everything.frag
|
|||||||
22102: 649(ptr) Variable Function
|
22102: 649(ptr) Variable Function
|
||||||
24151: 12(int) Load 4408
|
24151: 12(int) Load 4408
|
||||||
13868: 9(bool) SGreaterThan 24151 2577
|
13868: 9(bool) SGreaterThan 24151 2577
|
||||||
SelectionMerge 22309 None
|
SelectionMerge 14966 None
|
||||||
BranchConditional 13868 10822 17416
|
BranchConditional 13868 10822 17416
|
||||||
10822: Label
|
10822: Label
|
||||||
22680: 12(int) Load 4408
|
22680: 12(int) Load 4408
|
||||||
@ -115,7 +115,6 @@ remap.similar_1b.everything.frag
|
|||||||
10505: 12(int) IAdd 11462 21176
|
10505: 12(int) IAdd 11462 21176
|
||||||
14626: 13(float) ConvertSToF 10505
|
14626: 13(float) ConvertSToF 10505
|
||||||
ReturnValue 14626
|
ReturnValue 14626
|
||||||
22309: Label
|
14966: Label
|
||||||
6429: 13(float) Undef
|
Unreachable
|
||||||
ReturnValue 6429
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -130,6 +130,5 @@ remap.similar_1b.none.frag
|
|||||||
73: 8(float) ConvertSToF 72
|
73: 8(float) ConvertSToF 72
|
||||||
ReturnValue 73
|
ReturnValue 73
|
||||||
46: Label
|
46: Label
|
||||||
75: 8(float) Undef
|
Unreachable
|
||||||
ReturnValue 75
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
spv.controlFlowAttributes.frag
|
spv.controlFlowAttributes.frag
|
||||||
WARNING: 0:20: 'unroll' : expected no arguments
|
WARNING: 0:27: 'unroll' : expected no arguments
|
||||||
WARNING: 0:21: 'dont_unroll' : expected no arguments
|
WARNING: 0:28: 'dont_unroll' : expected no arguments
|
||||||
WARNING: 0:22: 'dependency_infinite' : expected no arguments
|
WARNING: 0:29: 'dependency_infinite' : expected no arguments
|
||||||
WARNING: 0:23: 'dependency_length' : expected a single integer argument
|
WARNING: 0:30: 'dependency_length' : expected a single integer argument
|
||||||
WARNING: 0:24: '' : attribute with arguments not recognized, skipping
|
WARNING: 0:31: '' : attribute with arguments not recognized, skipping
|
||||||
WARNING: 0:25: '' : attribute with arguments not recognized, skipping
|
WARNING: 0:32: '' : attribute with arguments not recognized, skipping
|
||||||
WARNING: 0:26: '' : attribute with arguments not recognized, skipping
|
WARNING: 0:33: '' : attribute with arguments not recognized, skipping
|
||||||
|
|
||||||
Validation failed
|
Validation failed
|
||||||
// Module Version 10000
|
// Module Version 10000
|
||||||
// Generated by (magic number): 80007
|
// Generated by (magic number): 80007
|
||||||
// Id's are bound by 118
|
// Id's are bound by 123
|
||||||
|
|
||||||
Capability Shader
|
Capability Shader
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
@ -20,220 +20,231 @@ Validation failed
|
|||||||
Source GLSL 450
|
Source GLSL 450
|
||||||
SourceExtension "GL_EXT_control_flow_attributes"
|
SourceExtension "GL_EXT_control_flow_attributes"
|
||||||
Name 4 "main"
|
Name 4 "main"
|
||||||
Name 8 "i"
|
Name 6 "f0("
|
||||||
Name 36 "i"
|
Name 8 "f1("
|
||||||
Name 47 "cond"
|
Name 23 "i"
|
||||||
Name 60 "i"
|
Name 41 "i"
|
||||||
Name 79 "i"
|
Name 52 "cond"
|
||||||
|
Name 65 "i"
|
||||||
|
Name 84 "i"
|
||||||
2: TypeVoid
|
2: TypeVoid
|
||||||
3: TypeFunction 2
|
3: TypeFunction 2
|
||||||
6: TypeInt 32 1
|
19: TypeBool
|
||||||
7: TypePointer Function 6(int)
|
20: 19(bool) ConstantTrue
|
||||||
9: 6(int) Constant 0
|
21: TypeInt 32 1
|
||||||
16: 6(int) Constant 8
|
22: TypePointer Function 21(int)
|
||||||
17: TypeBool
|
24: 21(int) Constant 0
|
||||||
20: 6(int) Constant 1
|
31: 21(int) Constant 8
|
||||||
31: 17(bool) ConstantTrue
|
34: 21(int) Constant 1
|
||||||
46: TypePointer Private 17(bool)
|
51: TypePointer Private 19(bool)
|
||||||
47(cond): 46(ptr) Variable Private
|
52(cond): 51(ptr) Variable Private
|
||||||
54: 17(bool) ConstantFalse
|
59: 19(bool) ConstantFalse
|
||||||
55: 6(int) Constant 3
|
60: 21(int) Constant 3
|
||||||
4(main): 2 Function None 3
|
4(main): 2 Function None 3
|
||||||
5: Label
|
5: Label
|
||||||
8(i): 7(ptr) Variable Function
|
23(i): 22(ptr) Variable Function
|
||||||
36(i): 7(ptr) Variable Function
|
41(i): 22(ptr) Variable Function
|
||||||
60(i): 7(ptr) Variable Function
|
65(i): 22(ptr) Variable Function
|
||||||
79(i): 7(ptr) Variable Function
|
84(i): 22(ptr) Variable Function
|
||||||
Store 8(i) 9
|
Store 23(i) 24
|
||||||
Branch 10
|
|
||||||
10: Label
|
|
||||||
LoopMerge 12 13 Unroll
|
|
||||||
Branch 14
|
|
||||||
14: Label
|
|
||||||
15: 6(int) Load 8(i)
|
|
||||||
18: 17(bool) SLessThan 15 16
|
|
||||||
BranchConditional 18 11 12
|
|
||||||
11: Label
|
|
||||||
Branch 13
|
|
||||||
13: Label
|
|
||||||
19: 6(int) Load 8(i)
|
|
||||||
21: 6(int) IAdd 19 20
|
|
||||||
Store 8(i) 21
|
|
||||||
Branch 10
|
|
||||||
12: Label
|
|
||||||
Branch 22
|
|
||||||
22: Label
|
|
||||||
LoopMerge 24 25 DontUnroll
|
|
||||||
Branch 23
|
|
||||||
23: Label
|
|
||||||
Branch 25
|
Branch 25
|
||||||
25: Label
|
25: Label
|
||||||
Branch 22
|
LoopMerge 27 28 Unroll
|
||||||
24: Label
|
|
||||||
Branch 26
|
|
||||||
26: Label
|
|
||||||
LoopMerge 28 29 DontUnroll
|
|
||||||
Branch 30
|
|
||||||
30: Label
|
|
||||||
BranchConditional 31 27 28
|
|
||||||
27: Label
|
|
||||||
Branch 29
|
Branch 29
|
||||||
29: Label
|
29: Label
|
||||||
Branch 26
|
30: 21(int) Load 23(i)
|
||||||
|
32: 19(bool) SLessThan 30 31
|
||||||
|
BranchConditional 32 26 27
|
||||||
|
26: Label
|
||||||
|
Branch 28
|
||||||
28: Label
|
28: Label
|
||||||
Branch 32
|
33: 21(int) Load 23(i)
|
||||||
32: Label
|
35: 21(int) IAdd 33 34
|
||||||
LoopMerge 34 35 DependencyInfinite
|
Store 23(i) 35
|
||||||
Branch 33
|
Branch 25
|
||||||
33: Label
|
27: Label
|
||||||
Branch 35
|
36: 2 FunctionCall 6(f0()
|
||||||
35: Label
|
|
||||||
BranchConditional 31 32 34
|
|
||||||
34: Label
|
|
||||||
Store 36(i) 9
|
|
||||||
Branch 37
|
Branch 37
|
||||||
37: Label
|
37: Label
|
||||||
LoopMerge 39 40 DependencyLength 4
|
LoopMerge 39 40 DependencyInfinite
|
||||||
Branch 41
|
Branch 38
|
||||||
41: Label
|
|
||||||
42: 6(int) Load 36(i)
|
|
||||||
43: 17(bool) SLessThan 42 16
|
|
||||||
BranchConditional 43 38 39
|
|
||||||
38: Label
|
38: Label
|
||||||
Branch 40
|
Branch 40
|
||||||
40: Label
|
40: Label
|
||||||
44: 6(int) Load 36(i)
|
BranchConditional 20 37 39
|
||||||
45: 6(int) IAdd 44 20
|
|
||||||
Store 36(i) 45
|
|
||||||
Branch 37
|
|
||||||
39: Label
|
39: Label
|
||||||
48: 17(bool) Load 47(cond)
|
Store 41(i) 24
|
||||||
SelectionMerge 50 Flatten
|
Branch 42
|
||||||
BranchConditional 48 49 50
|
42: Label
|
||||||
49: Label
|
LoopMerge 44 45 DependencyLength 4
|
||||||
Branch 50
|
Branch 46
|
||||||
50: Label
|
46: Label
|
||||||
51: 17(bool) Load 47(cond)
|
47: 21(int) Load 41(i)
|
||||||
SelectionMerge 53 DontFlatten
|
48: 19(bool) SLessThan 47 31
|
||||||
BranchConditional 51 52 53
|
BranchConditional 48 43 44
|
||||||
52: Label
|
43: Label
|
||||||
Store 47(cond) 54
|
Branch 45
|
||||||
Branch 53
|
45: Label
|
||||||
53: Label
|
49: 21(int) Load 41(i)
|
||||||
SelectionMerge 57 DontFlatten
|
50: 21(int) IAdd 49 34
|
||||||
Switch 55 57
|
Store 41(i) 50
|
||||||
case 3: 56
|
Branch 42
|
||||||
56: Label
|
44: Label
|
||||||
Branch 57
|
53: 19(bool) Load 52(cond)
|
||||||
|
SelectionMerge 55 Flatten
|
||||||
|
BranchConditional 53 54 55
|
||||||
|
54: Label
|
||||||
|
Branch 55
|
||||||
|
55: Label
|
||||||
|
56: 19(bool) Load 52(cond)
|
||||||
|
SelectionMerge 58 DontFlatten
|
||||||
|
BranchConditional 56 57 58
|
||||||
57: Label
|
57: Label
|
||||||
Store 60(i) 9
|
Store 52(cond) 59
|
||||||
Branch 61
|
Branch 58
|
||||||
|
58: Label
|
||||||
|
SelectionMerge 62 DontFlatten
|
||||||
|
Switch 60 62
|
||||||
|
case 3: 61
|
||||||
61: Label
|
61: Label
|
||||||
LoopMerge 63 64 None
|
Branch 62
|
||||||
Branch 65
|
|
||||||
65: Label
|
|
||||||
66: 6(int) Load 60(i)
|
|
||||||
67: 17(bool) SLessThan 66 16
|
|
||||||
BranchConditional 67 62 63
|
|
||||||
62: Label
|
62: Label
|
||||||
Branch 64
|
Store 65(i) 24
|
||||||
64: Label
|
Branch 66
|
||||||
68: 6(int) Load 60(i)
|
66: Label
|
||||||
69: 6(int) IAdd 68 20
|
LoopMerge 68 69 None
|
||||||
Store 60(i) 69
|
|
||||||
Branch 61
|
|
||||||
63: Label
|
|
||||||
Branch 70
|
Branch 70
|
||||||
70: Label
|
70: Label
|
||||||
LoopMerge 72 73 None
|
71: 21(int) Load 65(i)
|
||||||
Branch 74
|
72: 19(bool) SLessThan 71 31
|
||||||
74: Label
|
BranchConditional 72 67 68
|
||||||
BranchConditional 31 71 72
|
67: Label
|
||||||
71: Label
|
Branch 69
|
||||||
Branch 73
|
69: Label
|
||||||
73: Label
|
73: 21(int) Load 65(i)
|
||||||
Branch 70
|
74: 21(int) IAdd 73 34
|
||||||
72: Label
|
Store 65(i) 74
|
||||||
|
Branch 66
|
||||||
|
68: Label
|
||||||
Branch 75
|
Branch 75
|
||||||
75: Label
|
75: Label
|
||||||
LoopMerge 77 78 None
|
LoopMerge 77 78 None
|
||||||
Branch 76
|
Branch 79
|
||||||
|
79: Label
|
||||||
|
BranchConditional 20 76 77
|
||||||
76: Label
|
76: Label
|
||||||
Branch 78
|
Branch 78
|
||||||
78: Label
|
78: Label
|
||||||
BranchConditional 31 75 77
|
Branch 75
|
||||||
77: Label
|
77: Label
|
||||||
Store 79(i) 9
|
|
||||||
Branch 80
|
Branch 80
|
||||||
80: Label
|
80: Label
|
||||||
LoopMerge 82 83 None
|
LoopMerge 82 83 None
|
||||||
Branch 84
|
Branch 81
|
||||||
84: Label
|
|
||||||
85: 6(int) Load 79(i)
|
|
||||||
86: 17(bool) SLessThan 85 16
|
|
||||||
BranchConditional 86 81 82
|
|
||||||
81: Label
|
81: Label
|
||||||
Branch 83
|
Branch 83
|
||||||
83: Label
|
83: Label
|
||||||
87: 6(int) Load 79(i)
|
BranchConditional 20 80 82
|
||||||
88: 6(int) IAdd 87 20
|
|
||||||
Store 79(i) 88
|
|
||||||
Branch 80
|
|
||||||
82: Label
|
82: Label
|
||||||
89: 17(bool) Load 47(cond)
|
Store 84(i) 24
|
||||||
SelectionMerge 91 None
|
Branch 85
|
||||||
BranchConditional 89 90 91
|
85: Label
|
||||||
90: Label
|
LoopMerge 87 88 None
|
||||||
Branch 91
|
Branch 89
|
||||||
91: Label
|
89: Label
|
||||||
92: 17(bool) Load 47(cond)
|
90: 21(int) Load 84(i)
|
||||||
SelectionMerge 94 None
|
91: 19(bool) SLessThan 90 31
|
||||||
BranchConditional 92 93 94
|
BranchConditional 91 86 87
|
||||||
93: Label
|
86: Label
|
||||||
Store 47(cond) 54
|
Branch 88
|
||||||
Branch 94
|
88: Label
|
||||||
94: Label
|
92: 21(int) Load 84(i)
|
||||||
|
93: 21(int) IAdd 92 34
|
||||||
|
Store 84(i) 93
|
||||||
|
Branch 85
|
||||||
|
87: Label
|
||||||
|
94: 19(bool) Load 52(cond)
|
||||||
SelectionMerge 96 None
|
SelectionMerge 96 None
|
||||||
Switch 55 96
|
BranchConditional 94 95 96
|
||||||
case 3: 95
|
|
||||||
95: Label
|
95: Label
|
||||||
Branch 96
|
Branch 96
|
||||||
96: Label
|
96: Label
|
||||||
|
97: 19(bool) Load 52(cond)
|
||||||
|
SelectionMerge 99 None
|
||||||
|
BranchConditional 97 98 99
|
||||||
|
98: Label
|
||||||
|
Store 52(cond) 59
|
||||||
Branch 99
|
Branch 99
|
||||||
99: Label
|
99: Label
|
||||||
LoopMerge 101 102 Unroll DontUnroll DependencyLength 2
|
SelectionMerge 101 None
|
||||||
Branch 103
|
Switch 60 101
|
||||||
103: Label
|
case 3: 100
|
||||||
104: 17(bool) Load 47(cond)
|
|
||||||
BranchConditional 104 100 101
|
|
||||||
100: Label
|
100: Label
|
||||||
Branch 102
|
Branch 101
|
||||||
102: Label
|
|
||||||
Branch 99
|
|
||||||
101: Label
|
101: Label
|
||||||
SelectionMerge 106 DontFlatten
|
Branch 104
|
||||||
Switch 55 106
|
104: Label
|
||||||
case 3: 105
|
LoopMerge 106 107 Unroll DontUnroll DependencyLength 2
|
||||||
|
Branch 108
|
||||||
|
108: Label
|
||||||
|
109: 19(bool) Load 52(cond)
|
||||||
|
BranchConditional 109 105 106
|
||||||
105: Label
|
105: Label
|
||||||
Branch 106
|
Branch 107
|
||||||
|
107: Label
|
||||||
|
Branch 104
|
||||||
106: Label
|
106: Label
|
||||||
109: 17(bool) Load 47(cond)
|
SelectionMerge 111 DontFlatten
|
||||||
SelectionMerge 111 Flatten
|
Switch 60 111
|
||||||
BranchConditional 109 110 111
|
case 3: 110
|
||||||
110: Label
|
110: Label
|
||||||
Branch 111
|
Branch 111
|
||||||
111: Label
|
111: Label
|
||||||
Branch 112
|
114: 19(bool) Load 52(cond)
|
||||||
112: Label
|
SelectionMerge 116 Flatten
|
||||||
LoopMerge 114 115 DependencyInfinite
|
BranchConditional 114 115 116
|
||||||
|
115: Label
|
||||||
Branch 116
|
Branch 116
|
||||||
116: Label
|
116: Label
|
||||||
117: 17(bool) Load 47(cond)
|
Branch 117
|
||||||
BranchConditional 117 113 114
|
117: Label
|
||||||
113: Label
|
LoopMerge 119 120 DependencyInfinite
|
||||||
Branch 115
|
Branch 121
|
||||||
115: Label
|
121: Label
|
||||||
Branch 112
|
122: 19(bool) Load 52(cond)
|
||||||
114: Label
|
BranchConditional 122 118 119
|
||||||
|
118: Label
|
||||||
|
Branch 120
|
||||||
|
120: Label
|
||||||
|
Branch 117
|
||||||
|
119: Label
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
6(f0(): 2 Function None 3
|
||||||
|
7: Label
|
||||||
|
Branch 10
|
||||||
|
10: Label
|
||||||
|
LoopMerge 12 13 DontUnroll
|
||||||
|
Branch 11
|
||||||
|
11: Label
|
||||||
|
Branch 13
|
||||||
|
13: Label
|
||||||
|
Branch 10
|
||||||
|
12: Label
|
||||||
|
Unreachable
|
||||||
|
FunctionEnd
|
||||||
|
8(f1(): 2 Function None 3
|
||||||
|
9: Label
|
||||||
|
Branch 14
|
||||||
|
14: Label
|
||||||
|
LoopMerge 16 17 DontUnroll
|
||||||
|
Branch 18
|
||||||
|
18: Label
|
||||||
|
BranchConditional 20 15 16
|
||||||
|
15: Label
|
||||||
|
Branch 17
|
||||||
|
17: Label
|
||||||
|
Branch 14
|
||||||
|
16: Label
|
||||||
Return
|
Return
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
54
Test/baseResults/spv.dead-after-continue.vert.out
Normal file
54
Test/baseResults/spv.dead-after-continue.vert.out
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
spv.dead-after-continue.vert
|
||||||
|
// Module Version 10000
|
||||||
|
// Generated by (magic number): 80007
|
||||||
|
// Id's are bound by 29
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint Vertex 4 "main" 20 28
|
||||||
|
Source GLSL 450
|
||||||
|
Name 4 "main"
|
||||||
|
Name 8 "i"
|
||||||
|
Name 20 "o"
|
||||||
|
Name 28 "c"
|
||||||
|
Decorate 20(o) Location 0
|
||||||
|
Decorate 28(c) Location 0
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
6: TypeInt 32 1
|
||||||
|
7: TypePointer Function 6(int)
|
||||||
|
9: 6(int) Constant 0
|
||||||
|
16: 6(int) Constant 5
|
||||||
|
17: TypeBool
|
||||||
|
19: TypePointer Output 6(int)
|
||||||
|
20(o): 19(ptr) Variable Output
|
||||||
|
21: 6(int) Constant 1
|
||||||
|
23: 6(int) Constant 2
|
||||||
|
26: 6(int) Constant 3
|
||||||
|
27: TypePointer Input 6(int)
|
||||||
|
28(c): 27(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 14
|
||||||
|
14: Label
|
||||||
|
15: 6(int) Load 8(i)
|
||||||
|
18: 17(bool) SLessThan 15 16
|
||||||
|
BranchConditional 18 11 12
|
||||||
|
11: Label
|
||||||
|
Store 20(o) 21
|
||||||
|
Branch 13
|
||||||
|
13: Label
|
||||||
|
24: 6(int) Load 8(i)
|
||||||
|
25: 6(int) IAdd 24 21
|
||||||
|
Store 8(i) 25
|
||||||
|
Branch 10
|
||||||
|
12: Label
|
||||||
|
Store 20(o) 26
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
31
Test/baseResults/spv.dead-after-discard.frag.out
Normal file
31
Test/baseResults/spv.dead-after-discard.frag.out
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
spv.dead-after-discard.frag
|
||||||
|
// Module Version 10000
|
||||||
|
// Generated by (magic number): 80007
|
||||||
|
// Id's are bound by 15
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint Fragment 4 "main" 8 14
|
||||||
|
ExecutionMode 4 OriginUpperLeft
|
||||||
|
Source GLSL 450
|
||||||
|
Name 4 "main"
|
||||||
|
Name 8 "o"
|
||||||
|
Name 14 "c"
|
||||||
|
Decorate 8(o) Location 0
|
||||||
|
Decorate 14(c) Location 0
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
6: TypeInt 32 1
|
||||||
|
7: TypePointer Output 6(int)
|
||||||
|
8(o): 7(ptr) Variable Output
|
||||||
|
9: 6(int) Constant 1
|
||||||
|
11: 6(int) Constant 3
|
||||||
|
12: TypeFloat 32
|
||||||
|
13: TypePointer Input 12(float)
|
||||||
|
14(c): 13(ptr) Variable Input
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
Store 8(o) 9
|
||||||
|
Kill
|
||||||
|
FunctionEnd
|
67
Test/baseResults/spv.dead-after-loop-break.vert.out
Normal file
67
Test/baseResults/spv.dead-after-loop-break.vert.out
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
spv.dead-after-loop-break.vert
|
||||||
|
// Module Version 10000
|
||||||
|
// Generated by (magic number): 80007
|
||||||
|
// Id's are bound by 36
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint Vertex 4 "main" 8 25
|
||||||
|
Source GLSL 450
|
||||||
|
Name 4 "main"
|
||||||
|
Name 8 "o"
|
||||||
|
Name 11 "i"
|
||||||
|
Name 25 "c"
|
||||||
|
Decorate 8(o) Location 0
|
||||||
|
Decorate 25(c) Location 0
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
6: TypeInt 32 1
|
||||||
|
7: TypePointer Output 6(int)
|
||||||
|
8(o): 7(ptr) Variable Output
|
||||||
|
9: 6(int) Constant 1
|
||||||
|
10: TypePointer Function 6(int)
|
||||||
|
12: 6(int) Constant 0
|
||||||
|
19: 6(int) Constant 5
|
||||||
|
20: TypeBool
|
||||||
|
22: 6(int) Constant 2
|
||||||
|
24: TypePointer Input 6(int)
|
||||||
|
25(c): 24(ptr) Variable Input
|
||||||
|
30: 6(int) Constant 3
|
||||||
|
32: 6(int) Constant 4
|
||||||
|
35: 6(int) Constant 6
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
11(i): 10(ptr) Variable Function
|
||||||
|
Store 8(o) 9
|
||||||
|
Store 11(i) 12
|
||||||
|
Branch 13
|
||||||
|
13: Label
|
||||||
|
LoopMerge 15 16 None
|
||||||
|
Branch 17
|
||||||
|
17: Label
|
||||||
|
18: 6(int) Load 11(i)
|
||||||
|
21: 20(bool) SLessThan 18 19
|
||||||
|
BranchConditional 21 14 15
|
||||||
|
14: Label
|
||||||
|
Store 8(o) 22
|
||||||
|
23: 6(int) Load 11(i)
|
||||||
|
26: 6(int) Load 25(c)
|
||||||
|
27: 20(bool) IEqual 23 26
|
||||||
|
SelectionMerge 29 None
|
||||||
|
BranchConditional 27 28 29
|
||||||
|
28: Label
|
||||||
|
Store 8(o) 30
|
||||||
|
Branch 15
|
||||||
|
29: Label
|
||||||
|
Store 8(o) 19
|
||||||
|
Branch 16
|
||||||
|
16: Label
|
||||||
|
33: 6(int) Load 11(i)
|
||||||
|
34: 6(int) IAdd 33 9
|
||||||
|
Store 11(i) 34
|
||||||
|
Branch 13
|
||||||
|
15: Label
|
||||||
|
Store 8(o) 35
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
29
Test/baseResults/spv.dead-after-return.vert.out
Normal file
29
Test/baseResults/spv.dead-after-return.vert.out
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
spv.dead-after-return.vert
|
||||||
|
// Module Version 10000
|
||||||
|
// Generated by (magic number): 80007
|
||||||
|
// Id's are bound by 14
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint Vertex 4 "main" 8 13
|
||||||
|
Source GLSL 450
|
||||||
|
Name 4 "main"
|
||||||
|
Name 8 "o"
|
||||||
|
Name 13 "c"
|
||||||
|
Decorate 8(o) Location 0
|
||||||
|
Decorate 13(c) Location 0
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
6: TypeInt 32 1
|
||||||
|
7: TypePointer Output 6(int)
|
||||||
|
8(o): 7(ptr) Variable Output
|
||||||
|
9: 6(int) Constant 1
|
||||||
|
11: 6(int) Constant 3
|
||||||
|
12: TypePointer Input 6(int)
|
||||||
|
13(c): 12(ptr) Variable Input
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
Store 8(o) 9
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
40
Test/baseResults/spv.dead-after-switch-break.vert.out
Normal file
40
Test/baseResults/spv.dead-after-switch-break.vert.out
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
spv.dead-after-switch-break.vert
|
||||||
|
// Module Version 10000
|
||||||
|
// Generated by (magic number): 80007
|
||||||
|
// Id's are bound by 21
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint Vertex 4 "main" 8 14
|
||||||
|
Source GLSL 450
|
||||||
|
Name 4 "main"
|
||||||
|
Name 8 "c"
|
||||||
|
Name 14 "o"
|
||||||
|
Decorate 8(c) Location 0
|
||||||
|
Decorate 14(o) Location 0
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
6: TypeInt 32 1
|
||||||
|
7: TypePointer Input 6(int)
|
||||||
|
8(c): 7(ptr) Variable Input
|
||||||
|
13: TypePointer Output 6(int)
|
||||||
|
14(o): 13(ptr) Variable Output
|
||||||
|
15: 6(int) Constant 1
|
||||||
|
17: 6(int) Constant 2
|
||||||
|
20: 6(int) Constant 3
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
9: 6(int) Load 8(c)
|
||||||
|
SelectionMerge 12 None
|
||||||
|
Switch 9 11
|
||||||
|
case 0: 10
|
||||||
|
11: Label
|
||||||
|
Branch 12
|
||||||
|
10: Label
|
||||||
|
Store 14(o) 15
|
||||||
|
Branch 12
|
||||||
|
12: Label
|
||||||
|
Store 14(o) 20
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
@ -0,0 +1,55 @@
|
|||||||
|
spv.dead-complex-continue-after-return.vert
|
||||||
|
// Module Version 10000
|
||||||
|
// Generated by (magic number): 80007
|
||||||
|
// Id's are bound by 31
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint Vertex 4 "main" 11 30
|
||||||
|
Source GLSL 450
|
||||||
|
Name 4 "main"
|
||||||
|
Name 8 "i"
|
||||||
|
Name 11 "o"
|
||||||
|
Name 30 "c"
|
||||||
|
Decorate 11(o) Location 0
|
||||||
|
Decorate 30(c) Location 0
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
6: TypeInt 32 1
|
||||||
|
7: TypePointer Function 6(int)
|
||||||
|
9: 6(int) Constant 0
|
||||||
|
10: TypePointer Output 6(int)
|
||||||
|
11(o): 10(ptr) Variable Output
|
||||||
|
12: 6(int) Constant 1
|
||||||
|
19: 6(int) Constant 5
|
||||||
|
20: TypeBool
|
||||||
|
22: 6(int) Constant 2
|
||||||
|
24: 6(int) Constant 3
|
||||||
|
27: 6(int) Constant 99
|
||||||
|
28: 6(int) Constant 4
|
||||||
|
29: TypePointer Input 6(int)
|
||||||
|
30(c): 29(ptr) Variable Input
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
8(i): 7(ptr) Variable Function
|
||||||
|
Store 8(i) 9
|
||||||
|
Store 11(o) 12
|
||||||
|
Store 8(i) 9
|
||||||
|
Branch 13
|
||||||
|
13: Label
|
||||||
|
LoopMerge 15 16 None
|
||||||
|
Branch 17
|
||||||
|
17: Label
|
||||||
|
18: 6(int) Load 8(i)
|
||||||
|
21: 20(bool) SLessThan 18 19
|
||||||
|
BranchConditional 21 14 15
|
||||||
|
14: Label
|
||||||
|
Store 11(o) 22
|
||||||
|
Return
|
||||||
|
16: Label
|
||||||
|
Branch 13
|
||||||
|
15: Label
|
||||||
|
Store 11(o) 28
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
@ -0,0 +1,51 @@
|
|||||||
|
spv.dead-complex-merge-after-return.vert
|
||||||
|
// Module Version 10000
|
||||||
|
// Generated by (magic number): 80007
|
||||||
|
// Id's are bound by 36
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint Vertex 4 "main" 11 27
|
||||||
|
Source GLSL 450
|
||||||
|
Name 4 "main"
|
||||||
|
Name 8 "i"
|
||||||
|
Name 11 "o"
|
||||||
|
Name 27 "c"
|
||||||
|
Decorate 11(o) Location 0
|
||||||
|
Decorate 27(c) Location 0
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
6: TypeInt 32 1
|
||||||
|
7: TypePointer Function 6(int)
|
||||||
|
9: 6(int) Constant 0
|
||||||
|
10: TypePointer Output 6(int)
|
||||||
|
11(o): 10(ptr) Variable Output
|
||||||
|
12: 6(int) Constant 1
|
||||||
|
17: 6(int) Constant 2
|
||||||
|
19: 6(int) Constant 3
|
||||||
|
22: 6(int) Constant 5
|
||||||
|
23: TypeBool
|
||||||
|
25: 6(int) Constant 4
|
||||||
|
26: TypePointer Input 6(int)
|
||||||
|
27(c): 26(ptr) Variable Input
|
||||||
|
32: 6(int) Constant 100
|
||||||
|
34: 6(int) Constant 200
|
||||||
|
35: 6(int) Constant 300
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
8(i): 7(ptr) Variable Function
|
||||||
|
Store 8(i) 9
|
||||||
|
Store 11(o) 12
|
||||||
|
Branch 13
|
||||||
|
13: Label
|
||||||
|
LoopMerge 15 16 None
|
||||||
|
Branch 14
|
||||||
|
14: Label
|
||||||
|
Store 11(o) 17
|
||||||
|
Return
|
||||||
|
16: Label
|
||||||
|
Branch 13
|
||||||
|
15: Label
|
||||||
|
Unreachable
|
||||||
|
FunctionEnd
|
@ -160,7 +160,7 @@ spv.earlyReturnDiscard.frag
|
|||||||
102: Label
|
102: Label
|
||||||
Return
|
Return
|
||||||
100: Label
|
100: Label
|
||||||
Branch 67
|
Unreachable
|
||||||
67: Label
|
67: Label
|
||||||
106: 7(fvec4) Load 9(color)
|
106: 7(fvec4) Load 9(color)
|
||||||
107: 7(fvec4) Load 13(color2)
|
107: 7(fvec4) Load 13(color2)
|
||||||
|
@ -38,5 +38,5 @@ spv.for-notest.vert
|
|||||||
Store 8(i) 19
|
Store 8(i) 19
|
||||||
Branch 10
|
Branch 10
|
||||||
12: Label
|
12: Label
|
||||||
Return
|
Unreachable
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -99,8 +99,7 @@ spv.forwardFun.frag
|
|||||||
45: Label
|
45: Label
|
||||||
ReturnValue 46
|
ReturnValue 46
|
||||||
42: Label
|
42: Label
|
||||||
48: 8(float) Undef
|
Unreachable
|
||||||
ReturnValue 48
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
16(foo(vf4;): 8(float) Function None 14
|
16(foo(vf4;): 8(float) Function None 14
|
||||||
15(bar): 13(ptr) FunctionParameter
|
15(bar): 13(ptr) FunctionParameter
|
||||||
|
@ -105,8 +105,7 @@ WARNING: 0:5: varying deprecated in version 130; may be removed in future releas
|
|||||||
44: Label
|
44: Label
|
||||||
ReturnValue 45
|
ReturnValue 45
|
||||||
41: Label
|
41: Label
|
||||||
47: 6(float) Undef
|
Unreachable
|
||||||
ReturnValue 47
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
18(missingReturn(): 6(float) Function None 15
|
18(missingReturn(): 6(float) Function None 15
|
||||||
19: Label
|
19: Label
|
||||||
|
@ -37,5 +37,5 @@ spv.merge-unreachable.frag
|
|||||||
23: Label
|
23: Label
|
||||||
Return
|
Return
|
||||||
21: Label
|
21: Label
|
||||||
Return
|
Unreachable
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
@ -1,9 +1,29 @@
|
|||||||
|
void f0() {
|
||||||
|
[unroll] do {} while (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void f1() {
|
||||||
|
[unroll] do {;} while (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
float f2(float input) {
|
||||||
|
do { return (float4)input; } while (input > 2.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void f3(float input) {
|
||||||
|
do ++input; while (input < 10.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void f4(float input) {
|
||||||
|
do while (++input < 10.0); while (++input < 10.0); // nest while inside do-while
|
||||||
|
}
|
||||||
|
|
||||||
float4 PixelShaderFunction(float input) : COLOR0
|
float4 PixelShaderFunction(float input) : COLOR0
|
||||||
{
|
{
|
||||||
[unroll] do {} while (false);
|
f0();
|
||||||
[unroll] do {;} while (false);
|
f1();
|
||||||
do { return (float4)input; } while (input > 2.0);
|
f2(input);
|
||||||
do ++input; while (input < 10.0);
|
f3(input);
|
||||||
do while (++input < 10.0); while (++input < 10.0); // nest while inside do-while
|
f4(input);
|
||||||
return (float4)input;
|
return (float4)input;
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,59 @@
|
|||||||
|
void f0() {
|
||||||
|
for (;;) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void f1(float4 input) {
|
||||||
|
for (++input; ; ) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void f2(float4 input) {
|
||||||
|
[unroll] for (; any(input != input); ) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
float f3(float4 input) {
|
||||||
|
for (; any(input != input); ) { return -input; }
|
||||||
|
}
|
||||||
|
|
||||||
|
float f4(float4 input) {
|
||||||
|
for (--input; any(input != input); input += 2) { return -input; }
|
||||||
|
}
|
||||||
|
|
||||||
|
void f5(float4 input) {
|
||||||
|
for (;;) if (input.x > 2.0) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
void f6(float4 input) {
|
||||||
|
for (;;) if (input.x > 2.0) continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void f99() {
|
||||||
|
for (int first = 0, second = 1; ;) first + second;
|
||||||
|
}
|
||||||
|
|
||||||
|
void f100(float ii) {
|
||||||
|
for (--ii, --ii, --ii;;) ii;
|
||||||
|
}
|
||||||
|
|
||||||
float4 PixelShaderFunction(float4 input) : COLOR0
|
float4 PixelShaderFunction(float4 input) : COLOR0
|
||||||
{
|
{
|
||||||
for (;;) ;
|
f0();
|
||||||
for (++input; ; ) ;
|
f1(input);
|
||||||
[unroll] for (; any(input != input); ) {}
|
f2(input);
|
||||||
for (; any(input != input); ) { return -input; }
|
f3(input);
|
||||||
for (--input; any(input != input); input += 2) { return -input; }
|
f4(input);
|
||||||
for (;;) if (input.x > 2.0) break;
|
f5(input);
|
||||||
for (;;) if (input.x > 2.0) continue;
|
f6(input);
|
||||||
|
|
||||||
float ii;
|
float ii;
|
||||||
for (int ii = -1; ii < 3; ++ii) if (ii == 2) continue;
|
for (int ii = -1; ii < 3; ++ii) if (ii == 2) continue;
|
||||||
--ii;
|
--ii;
|
||||||
for (int first = 0, second = 1; ;) first + second;
|
|
||||||
|
f99();
|
||||||
|
|
||||||
for ( int i = 0, count = int(ii); i < count; i++ );
|
for ( int i = 0, count = int(ii); i < count; i++ );
|
||||||
for (float first = 0, second[2], third; first < second[0]; ++second[1]) first + second[1] + third;
|
for (float first = 0, second[2], third; first < second[0]; ++second[1]) first + second[1] + third;
|
||||||
for (--ii, --ii, --ii;;) ii;
|
|
||||||
|
f100(ii);
|
||||||
|
|
||||||
|
return input;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,24 @@
|
|||||||
|
float4 f0(float4 input) {
|
||||||
|
if (all(input == input))
|
||||||
|
return input;
|
||||||
|
else
|
||||||
|
return -input;
|
||||||
|
}
|
||||||
|
|
||||||
|
float4 f1(float4 input) {
|
||||||
|
if (all(input == input)) {
|
||||||
|
return input;
|
||||||
|
} else {
|
||||||
|
return -input;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
float4 PixelShaderFunction(float4 input) : COLOR0
|
float4 PixelShaderFunction(float4 input) : COLOR0
|
||||||
{
|
{
|
||||||
if (all(input == input))
|
if (all(input == input))
|
||||||
return input;
|
return input;
|
||||||
|
|
||||||
if (all(input == input))
|
f0(input);
|
||||||
return input;
|
|
||||||
else
|
|
||||||
return -input;
|
|
||||||
|
|
||||||
if (all(input == input))
|
if (all(input == input))
|
||||||
;
|
;
|
||||||
@ -20,11 +32,7 @@ float4 PixelShaderFunction(float4 input) : COLOR0
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (all(input == input)) {
|
f1(input);
|
||||||
return input;
|
|
||||||
} else {
|
|
||||||
return -input;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ii;
|
int ii;
|
||||||
if (float ii = input.z)
|
if (float ii = input.z)
|
||||||
|
@ -4,11 +4,18 @@
|
|||||||
|
|
||||||
bool cond;
|
bool cond;
|
||||||
|
|
||||||
|
void f0() {
|
||||||
|
[[loop]] for (;;) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
void f1() {
|
||||||
|
[[dont_unroll]] while(true) { }
|
||||||
|
}
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
[[unroll]] for (int i = 0; i < 8; ++i) { }
|
[[unroll]] for (int i = 0; i < 8; ++i) { }
|
||||||
[[loop]] for (;;) { }
|
f0();
|
||||||
[[dont_unroll]] while(true) { }
|
|
||||||
[[dependency_infinite]] do { } while(true);
|
[[dependency_infinite]] do { } while(true);
|
||||||
[[dependency_length(1+3)]] for (int i = 0; i < 8; ++i) { }
|
[[dependency_length(1+3)]] for (int i = 0; i < 8; ++i) { }
|
||||||
[[flatten]] if (cond) { } else { }
|
[[flatten]] if (cond) { } else { }
|
||||||
|
14
Test/spv.dead-after-continue.vert
Normal file
14
Test/spv.dead-after-continue.vert
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location =0 ) in int c;
|
||||||
|
layout(location =0 ) out int o;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
int i;
|
||||||
|
for (i=0; i < 5; i++) {
|
||||||
|
o = 1;
|
||||||
|
continue;
|
||||||
|
o = 2;
|
||||||
|
}
|
||||||
|
o = 3;
|
||||||
|
}
|
10
Test/spv.dead-after-discard.frag
Normal file
10
Test/spv.dead-after-discard.frag
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location =0 ) in float c;
|
||||||
|
layout(location =0 ) out int o;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
o = 1;
|
||||||
|
discard;
|
||||||
|
o = 3;
|
||||||
|
}
|
19
Test/spv.dead-after-loop-break.vert
Normal file
19
Test/spv.dead-after-loop-break.vert
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location =0 ) in int c;
|
||||||
|
layout(location =0 ) out int o;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
int i;
|
||||||
|
o = 1;
|
||||||
|
for (i=0; i < 5; i++) {
|
||||||
|
o = 2;
|
||||||
|
if (i==c) {
|
||||||
|
o = 3;
|
||||||
|
break;
|
||||||
|
o = 4;
|
||||||
|
}
|
||||||
|
o = 5;
|
||||||
|
}
|
||||||
|
o = 6;
|
||||||
|
}
|
10
Test/spv.dead-after-return.vert
Normal file
10
Test/spv.dead-after-return.vert
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location =0 ) in int c;
|
||||||
|
layout(location =0 ) out int o;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
o = 1;
|
||||||
|
return;
|
||||||
|
o = 3;
|
||||||
|
}
|
15
Test/spv.dead-after-switch-break.vert
Normal file
15
Test/spv.dead-after-switch-break.vert
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location =0 ) in int c;
|
||||||
|
layout(location =0 ) out int o;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
int i;
|
||||||
|
switch(c) {
|
||||||
|
case 0: o=1;
|
||||||
|
break;
|
||||||
|
o=2;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
o = 3;
|
||||||
|
}
|
19
Test/spv.dead-complex-continue-after-return.vert
Normal file
19
Test/spv.dead-complex-continue-after-return.vert
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location =0 ) in int c;
|
||||||
|
layout(location =0 ) out int o;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
int i = 0;
|
||||||
|
o = 1;
|
||||||
|
// This has non-trivial continue target.
|
||||||
|
for (i=0; i < 5; ++i, o=99) {
|
||||||
|
o = 2;
|
||||||
|
return;
|
||||||
|
o = 3;
|
||||||
|
}
|
||||||
|
// This is considered reachable since Glslang codegen will
|
||||||
|
// create a conditional branch in the header, and one arm
|
||||||
|
// of that branch reaches this merge block.
|
||||||
|
o = 4;
|
||||||
|
}
|
23
Test/spv.dead-complex-merge-after-return.vert
Normal file
23
Test/spv.dead-complex-merge-after-return.vert
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location =0 ) in int c;
|
||||||
|
layout(location =0 ) out int o;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
int i = 0;
|
||||||
|
o = 1;
|
||||||
|
do {
|
||||||
|
o = 2;
|
||||||
|
return;
|
||||||
|
o = 3;
|
||||||
|
} while(i++ < 5);
|
||||||
|
|
||||||
|
// All this is a dead merge block.
|
||||||
|
o = 4;
|
||||||
|
if (c==4) {
|
||||||
|
o = 100;
|
||||||
|
} else {
|
||||||
|
o = 200;
|
||||||
|
}
|
||||||
|
o = 300;
|
||||||
|
}
|
@ -63,6 +63,7 @@ std::string FileNameAsCustomTestSuffixIoMap(
|
|||||||
}
|
}
|
||||||
|
|
||||||
using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||||
|
using CompileVulkanToSpirvDeadCodeElimTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||||
using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||||
using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||||
using CompileToSpirv14Test = GlslangTest<::testing::TestWithParam<std::string>>;
|
using CompileToSpirv14Test = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||||
@ -85,6 +86,13 @@ TEST_P(CompileVulkanToSpirvTest, FromFile)
|
|||||||
Target::Spv);
|
Target::Spv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(CompileVulkanToSpirvDeadCodeElimTest, FromFile)
|
||||||
|
{
|
||||||
|
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
|
||||||
|
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
|
||||||
|
Target::Spv);
|
||||||
|
}
|
||||||
|
|
||||||
// Compiling GLSL to SPIR-V with debug info under Vulkan semantics. Expected
|
// Compiling GLSL to SPIR-V with debug info under Vulkan semantics. Expected
|
||||||
// to successfully generate SPIR-V.
|
// to successfully generate SPIR-V.
|
||||||
TEST_P(CompileVulkanToDebugSpirvTest, FromFile)
|
TEST_P(CompileVulkanToDebugSpirvTest, FromFile)
|
||||||
@ -417,6 +425,23 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
FileNameAsCustomTestSuffix
|
FileNameAsCustomTestSuffix
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Cases with deliberately unreachable code.
|
||||||
|
// By default the compiler will aggressively eliminate
|
||||||
|
// unreachable merges and continues.
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
GlslWithDeadCode, CompileVulkanToSpirvDeadCodeElimTest,
|
||||||
|
::testing::ValuesIn(std::vector<std::string>({
|
||||||
|
"spv.dead-after-continue.vert",
|
||||||
|
"spv.dead-after-discard.frag",
|
||||||
|
"spv.dead-after-return.vert",
|
||||||
|
"spv.dead-after-loop-break.vert",
|
||||||
|
"spv.dead-after-switch-break.vert",
|
||||||
|
"spv.dead-complex-continue-after-return.vert",
|
||||||
|
"spv.dead-complex-merge-after-return.vert",
|
||||||
|
})),
|
||||||
|
FileNameAsCustomTestSuffix
|
||||||
|
);
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
INSTANTIATE_TEST_CASE_P(
|
INSTANTIATE_TEST_CASE_P(
|
||||||
Glsl, CompileVulkanToDebugSpirvTest,
|
Glsl, CompileVulkanToDebugSpirvTest,
|
||||||
|
@ -113,7 +113,7 @@ public:
|
|||||||
forceVersionProfile(false),
|
forceVersionProfile(false),
|
||||||
isForwardCompatible(false) {
|
isForwardCompatible(false) {
|
||||||
// Perform validation by default.
|
// Perform validation by default.
|
||||||
validatorOptions.validate = true;
|
spirvOptions.validate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tries to load the contents from the file at the given |path|. On success,
|
// Tries to load the contents from the file at the given |path|. On success,
|
||||||
@ -693,14 +693,14 @@ public:
|
|||||||
expectedOutputFname, result.spirvWarningsErrors);
|
expectedOutputFname, result.spirvWarningsErrors);
|
||||||
}
|
}
|
||||||
|
|
||||||
glslang::SpvOptions& options() { return validatorOptions; }
|
glslang::SpvOptions& options() { return spirvOptions; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const int defaultVersion;
|
const int defaultVersion;
|
||||||
const EProfile defaultProfile;
|
const EProfile defaultProfile;
|
||||||
const bool forceVersionProfile;
|
const bool forceVersionProfile;
|
||||||
const bool isForwardCompatible;
|
const bool isForwardCompatible;
|
||||||
glslang::SpvOptions validatorOptions;
|
glslang::SpvOptions spirvOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace glslangtest
|
} // namespace glslangtest
|
||||||
|
Loading…
x
Reference in New Issue
Block a user