Only reflect spec constant if it actually has a constant ID.

This commit is contained in:
Hans-Kristian Arntzen 2018-05-15 14:24:44 +02:00
parent 991b655c72
commit c643addacd

View File

@ -3471,12 +3471,10 @@ vector<SpecializationConstant> Compiler::get_specialization_constants() const
if (id.get_type() == TypeConstant)
{
auto &c = id.get<SPIRConstant>();
if (c.specialization)
{
if (c.specialization && has_decoration(c.self, DecorationSpecId))
spec_consts.push_back({ c.self, get_decoration(c.self, DecorationSpecId) });
}
}
}
return spec_consts;
}