[spv-out] generate LogicalNot for bools

This commit is contained in:
Dzmitry Malyshau
2021-04-25 12:50:49 -04:00
parent e8c5242cc7
commit f77abdb156

View File

@@ -1575,7 +1575,10 @@ impl Writer {
return Err(Error::FeatureNotImplemented("negation"));
}
},
crate::UnaryOperator::Not => spirv::Op::Not,
crate::UnaryOperator::Not => match expr_ty_inner.scalar_kind() {
Some(crate::ScalarKind::Bool) => spirv::Op::LogicalNot,
_ => spirv::Op::Not,
},
};
block