diff --git a/src/reader/spirv/parser_impl.cc b/src/reader/spirv/parser_impl.cc index 7cc274d485..7068857ffb 100644 --- a/src/reader/spirv/parser_impl.cc +++ b/src/reader/spirv/parser_impl.cc @@ -309,7 +309,8 @@ ast::type::Type* ParserImpl::ConvertType(uint32_t type_id) { break; } - Fail() << "unknown SPIR-V type: " << type_id; + Fail() << "unknown SPIR-V type with ID " << type_id << ": " + << def_use_mgr_->GetDef(type_id)->PrettyPrint(); return nullptr; } diff --git a/src/reader/spirv/parser_impl_convert_type_test.cc b/src/reader/spirv/parser_impl_convert_type_test.cc index 3f18da7060..567446575d 100644 --- a/src/reader/spirv/parser_impl_convert_type_test.cc +++ b/src/reader/spirv/parser_impl_convert_type_test.cc @@ -79,7 +79,8 @@ TEST_F(SpvParserTest, ConvertType_UnhandledType) { auto* type = p->ConvertType(70); EXPECT_EQ(nullptr, type); - EXPECT_THAT(p->error(), Eq("unknown SPIR-V type: 70")); + EXPECT_THAT(p->error(), + Eq("unknown SPIR-V type with ID 70: %70 = OpTypePipe WriteOnly")); } TEST_F(SpvParserTest, ConvertType_Void) {