From c643addacdfb2ca4956e1ca4dea7fc010a544e0b Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Tue, 15 May 2018 14:24:44 +0200 Subject: [PATCH] Only reflect spec constant if it actually has a constant ID. --- spirv_cross.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spirv_cross.cpp b/spirv_cross.cpp index 633778a4..855fea14 100644 --- a/spirv_cross.cpp +++ b/spirv_cross.cpp @@ -3471,10 +3471,8 @@ vector Compiler::get_specialization_constants() const if (id.get_type() == TypeConstant) { auto &c = id.get(); - 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;