Răsfoiți Sursa

[spirv] Use the correct type for bitwidth mask.

Ehsan Nasiri 6 ani în urmă
părinte
comite
701477a2d9
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      tools/clang/lib/SPIRV/SPIRVEmitter.cpp

+ 3 - 0
tools/clang/lib/SPIRV/SPIRVEmitter.cpp

@@ -8812,12 +8812,15 @@ SpirvConstant *SPIRVEmitter::getMaskForBitwidthValue(QualType type) {
     switch (bitwidth) {
     case 16:
       mask = spvBuilder.getConstantUint16(bitwidth - 1);
+      elemType = astContext.UnsignedShortTy;
       break;
     case 32:
       mask = spvBuilder.getConstantUint32(bitwidth - 1);
+      elemType = astContext.UnsignedIntTy;
       break;
     case 64:
       mask = spvBuilder.getConstantUint64(bitwidth - 1);
+      elemType = astContext.UnsignedLongLongTy;
       break;
     default:
       assert(false && "this method only supports 16-, 32-, and 64-bit types");