Merge pull request #896 from KhronosGroup/fix-895
Move check for structured OpSwitch to CompilerGLSL.
This commit is contained in:
commit
1b00a6e48a
@ -10747,6 +10747,9 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
|
||||
auto &type = expression_type(block.condition);
|
||||
bool unsigned_case = type.basetype == SPIRType::UInt || type.basetype == SPIRType::UShort;
|
||||
|
||||
if (block.merge == SPIRBlock::MergeNone)
|
||||
SPIRV_CROSS_THROW("Switch statement is not structured");
|
||||
|
||||
if (type.basetype == SPIRType::UInt64 || type.basetype == SPIRType::Int64)
|
||||
{
|
||||
// SPIR-V spec suggests this is allowed, but we cannot support it in higher level languages.
|
||||
|
@ -879,9 +879,6 @@ void Parser::parse(const Instruction &instruction)
|
||||
if (!current_block)
|
||||
SPIRV_CROSS_THROW("Trying to end a non-existing block.");
|
||||
|
||||
if (current_block->merge == SPIRBlock::MergeNone)
|
||||
SPIRV_CROSS_THROW("Switch statement is not structured");
|
||||
|
||||
current_block->terminator = SPIRBlock::MultiSelect;
|
||||
|
||||
current_block->condition = ops[0];
|
||||
|
Loading…
Reference in New Issue
Block a user