SPV: Fix #739: OpSelect can only operate on scalars and vectors.
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp
index 925b859..5385eee 100755
--- a/SPIRV/GlslangToSpv.cpp
+++ b/SPIRV/GlslangToSpv.cpp
@@ -1789,7 +1789,8 @@
// Crucially, side effects must be avoided, and there are performance trade-offs.
// Return true if good idea (and safe) for OpSelect, false otherwise.
const auto selectPolicy = [&]() -> bool {
- if (node->getBasicType() == glslang::EbtVoid)
+ if ((!node->getType().isScalar() && !node->getType().isVector()) ||
+ node->getBasicType() == glslang::EbtVoid)
return false;
if (node->getTrueBlock() == nullptr ||