SPV: Implement specialization constants for ?:.
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp
index bf26cdc..02609d0 100755
--- a/SPIRV/GlslangToSpv.cpp
+++ b/SPIRV/GlslangToSpv.cpp
@@ -1775,7 +1775,7 @@
// return true if a single operand to ? : is okay for OpSelect
const auto operandOkay = [](glslang::TIntermTyped* node) {
- return node->getAsSymbolNode() || node->getAsConstantUnion();
+ return node->getAsSymbolNode() || node->getType().getQualifier().isConstant();
};
return operandOkay(node->getTrueBlock() ->getAsTyped()) &&
@@ -1799,6 +1799,10 @@
// Try for OpSelect
if (selectPolicy()) {
+ SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder);
+ if (node->getType().getQualifier().isSpecConstant())
+ spec_constant_op_mode_setter.turnOnSpecConstantOpMode();
+
handleAsOpSelect();
return false;
}