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:
John Kessenich
2015-05-03 22:38:16 +00:00
parent 968c8f8e78
commit 735a2efa70
4 changed files with 58 additions and 42 deletions

View File

@@ -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