glslang -> SPV: 1) Include post switch-break unreachable blocks and 2) Generally, don't emit degenerate (basically empty) unreachable blocks.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31023 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -1683,6 +1683,7 @@ void Builder::addSwitchBreak()
|
||||
{
|
||||
// branch to the top of the merge block stack
|
||||
createBranch(switchMerges.top());
|
||||
createAndSetNoPredecessorBlock("post-switch-break");
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
@@ -1993,11 +1994,12 @@ void Builder::simplifyAccessChainSwizzle()
|
||||
void Builder::createAndSetNoPredecessorBlock(const char* name)
|
||||
{
|
||||
Block* block = new Block(getUniqueId(), buildPoint->getParent());
|
||||
block->setUnreachable();
|
||||
buildPoint->getParent().addBlock(block);
|
||||
setBuildPoint(block);
|
||||
|
||||
if (name)
|
||||
addName(block->getId(), name);
|
||||
//if (name)
|
||||
// addName(block->getId(), name);
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
|
||||
Reference in New Issue
Block a user