diff --git a/tools/clang/lib/SPIRV/SpirvEmitter.cpp b/tools/clang/lib/SPIRV/SpirvEmitter.cpp index 6d0670cc3..575cf4d18 100644 --- a/tools/clang/lib/SPIRV/SpirvEmitter.cpp +++ b/tools/clang/lib/SPIRV/SpirvEmitter.cpp @@ -11983,7 +11983,7 @@ SpirvEmitter::processGetAttributeAtVertex(const CallExpr *expr) { // arg1 : vertexId const auto *arg1BaseExpr = doExpr(expr->getArg(1)->IgnoreParenLValueCasts()); const auto *arg1ConstExpr = dyn_cast(arg1BaseExpr); - const auto *vertexId = arg1ConstExpr->getValue().getRawData(); + const auto vertexId = arg1ConstExpr->getValue(); // arg0 : decorated input // Tip : for input with boolean type, we need to ignore implicit cast first, @@ -12000,8 +12000,8 @@ SpirvEmitter::processGetAttributeAtVertex(const CallExpr *expr) { } // Change to access chain instr SpirvInstruction *accessChainPtr = paramDeclInstr; - SpirvConstant *vtxId = spvBuilder.getConstantInt(astContext.UnsignedIntTy, - llvm::APInt(32, *vertexId)); + SpirvConstant *vtxId = spvBuilder.getConstantInt( + astContext.UnsignedIntTy, llvm::APInt(32, *(vertexId.getRawData()))); if (isa(accessChainPtr)) { auto *accessInstr = dyn_cast(accessChainPtr); accessInstr->insertIndex(vtxId, accessInstr->getIndexes().size());