mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-09 22:00:05 +00:00
Fix regression from adding 64-bit switch support.
Missed some cases where we did not handle the loaded type width properly.
This commit is contained in:
parent
339e61a0e0
commit
29cc18988c
@ -1677,6 +1677,11 @@ const SmallVector<SPIRBlock::Case> &Compiler::get_case_list(const SPIRBlock &blo
|
||||
const auto &type = get<SPIRType>(var->basetype);
|
||||
width = type.width;
|
||||
}
|
||||
else if (const auto *undef = maybe_get<SPIRUndef>(block.condition))
|
||||
{
|
||||
const auto &type = get<SPIRType>(undef->basetype);
|
||||
width = type.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto search = ir.load_type_width.find(block.condition);
|
||||
|
@ -291,7 +291,15 @@ void Parser::parse(const Instruction &instruction)
|
||||
{
|
||||
// The SPIR-V debug information extended instructions might come at global scope.
|
||||
if (current_block)
|
||||
{
|
||||
current_block->ops.push_back(instruction);
|
||||
if (length >= 2)
|
||||
{
|
||||
const auto *type = maybe_get<SPIRType>(ops[0]);
|
||||
if (type)
|
||||
ir.load_type_width.insert({ ops[1], type->width });
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1211,10 +1219,9 @@ void Parser::parse(const Instruction &instruction)
|
||||
{
|
||||
const auto *type = maybe_get<SPIRType>(ops[0]);
|
||||
if (type)
|
||||
{
|
||||
ir.load_type_width.insert({ ops[1], type->width });
|
||||
}
|
||||
}
|
||||
|
||||
if (!current_block)
|
||||
SPIRV_CROSS_THROW("Currently no block to insert opcode.");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user