|
@@ -9096,11 +9096,12 @@ SpirvConstant *SpirvEmitter::getValueZero(QualType type) {
|
|
|
{
|
|
|
QualType scalarType = {};
|
|
|
if (isScalarType(type, &scalarType)) {
|
|
|
- if (scalarType->isSignedIntegerType() ||
|
|
|
- scalarType->isUnsignedIntegerType()) {
|
|
|
+ if (scalarType->isBooleanType()) {
|
|
|
+ return spvBuilder.getConstantBool(false);
|
|
|
+ }
|
|
|
+ if (scalarType->isIntegerType()) {
|
|
|
return spvBuilder.getConstantInt(scalarType, llvm::APInt(32, 0));
|
|
|
}
|
|
|
-
|
|
|
if (scalarType->isFloatingType()) {
|
|
|
return spvBuilder.getConstantFloat(scalarType, llvm::APFloat(0.0f));
|
|
|
}
|