2
0
Эх сурвалжийг харах

[spirv] Fix Linux/macOS build. (#1735)

Fixed ternary op ambiguity.
Ehsan 6 жил өмнө
parent
commit
c12f1ae8f2

+ 1 - 1
tools/clang/lib/SPIRV/SPIRVEmitter.cpp

@@ -4712,7 +4712,7 @@ SpirvEvalInfo SPIRVEmitter::doUnaryOperator(const UnaryOperator *expr) {
 
 
     const spv::Op spvOp = translateOp(isInc ? BO_Add : BO_Sub, subType);
     const spv::Op spvOp = translateOp(isInc ? BO_Add : BO_Sub, subType);
     const uint32_t originValue =
     const uint32_t originValue =
-        subValue.isRValue() ? subValue
+        subValue.isRValue() ? uint32_t(subValue)
                             : theBuilder.createLoad(subTypeId, subValue);
                             : theBuilder.createLoad(subTypeId, subValue);
     const uint32_t one = hlsl::IsHLSLMatType(subType)
     const uint32_t one = hlsl::IsHLSLMatType(subType)
                              ? getMatElemValueOne(subType)
                              ? getMatElemValueOne(subType)