From 299e19fb6157987ce308e773a3f63b2f14eaff04 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Tue, 21 Mar 2017 16:33:54 +0100 Subject: [PATCH] Do not crash on unknown extensions. --- spirv_common.hpp | 1 + spirv_cross.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spirv_common.hpp b/spirv_common.hpp index 488ae9a2..d7d037fb 100644 --- a/spirv_common.hpp +++ b/spirv_common.hpp @@ -292,6 +292,7 @@ struct SPIRExtension : IVariant enum Extension { + Unsupported, GLSL }; diff --git a/spirv_cross.cpp b/spirv_cross.cpp index 60958a13..4d0b8337 100644 --- a/spirv_cross.cpp +++ b/spirv_cross.cpp @@ -1151,6 +1151,10 @@ void Compiler::parse(const Instruction &instruction) break; } + case OpExtension: + // Ignore extensions + break; + case OpExtInstImport: { uint32_t id = ops[0]; @@ -1158,7 +1162,9 @@ void Compiler::parse(const Instruction &instruction) if (ext == "GLSL.std.450") set(id, SPIRExtension::GLSL); else - SPIRV_CROSS_THROW("Only GLSL.std.450 extension interface supported."); + set(id, SPIRExtension::Unsupported); + + // Other SPIR-V extensions currently not supported. break; }