Merge pull request #1217 from KhronosGroup/fix-1215

Mark loop headers as complex as early as possible.
This commit is contained in:
Hans-Kristian Arntzen 2019-11-26 12:48:29 +01:00 committed by GitHub
commit 96a276c2ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12119,7 +12119,12 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
SPIRBlock::ContinueBlockType continue_type = SPIRBlock::ContinueNone;
if (block.continue_block)
{
continue_type = continue_block_type(get<SPIRBlock>(block.continue_block));
// If we know we cannot emit a loop, mark the block early as a complex loop so we don't force unnecessary recompiles.
if (continue_type == SPIRBlock::ComplexLoop)
block.complex_continue = true;
}
// If we have loop variables, stop masking out access to the variable now.
for (auto var_id : block.loop_variables)