Do not crash on unknown extensions.
This commit is contained in:
Родитель
ba09b0e1a0
Коммит
299e19fb61
|
@ -292,6 +292,7 @@ struct SPIRExtension : IVariant
|
||||||
|
|
||||||
enum Extension
|
enum Extension
|
||||||
{
|
{
|
||||||
|
Unsupported,
|
||||||
GLSL
|
GLSL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1151,6 +1151,10 @@ void Compiler::parse(const Instruction &instruction)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case OpExtension:
|
||||||
|
// Ignore extensions
|
||||||
|
break;
|
||||||
|
|
||||||
case OpExtInstImport:
|
case OpExtInstImport:
|
||||||
{
|
{
|
||||||
uint32_t id = ops[0];
|
uint32_t id = ops[0];
|
||||||
|
@ -1158,7 +1162,9 @@ void Compiler::parse(const Instruction &instruction)
|
||||||
if (ext == "GLSL.std.450")
|
if (ext == "GLSL.std.450")
|
||||||
set<SPIRExtension>(id, SPIRExtension::GLSL);
|
set<SPIRExtension>(id, SPIRExtension::GLSL);
|
||||||
else
|
else
|
||||||
SPIRV_CROSS_THROW("Only GLSL.std.450 extension interface supported.");
|
set<SPIRExtension>(id, SPIRExtension::Unsupported);
|
||||||
|
|
||||||
|
// Other SPIR-V extensions currently not supported.
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче