diff options
Diffstat (limited to 'clang/lib/CodeGen/Targets/SPIR.cpp')
-rw-r--r-- | clang/lib/CodeGen/Targets/SPIR.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/Targets/SPIR.cpp b/clang/lib/CodeGen/Targets/SPIR.cpp index 2e3fc53..4aa6314 100644 --- a/clang/lib/CodeGen/Targets/SPIR.cpp +++ b/clang/lib/CodeGen/Targets/SPIR.cpp @@ -486,6 +486,12 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType( return getSPIRVImageTypeFromHLSLResource(ResAttrs, ContainedTy, CGM); } + if (ResAttrs.IsCounter) { + llvm::Type *ElemType = llvm::Type::getInt32Ty(Ctx); + uint32_t StorageClass = /* StorageBuffer storage class */ 12; + return llvm::TargetExtType::get(Ctx, "spirv.VulkanBuffer", {ElemType}, + {StorageClass, true}); + } llvm::Type *ElemType = CGM.getTypes().ConvertTypeForMem(ContainedTy); llvm::ArrayType *RuntimeArrayType = llvm::ArrayType::get(ElemType, 0); uint32_t StorageClass = /* StorageBuffer storage class */ 12; |