diff options
Diffstat (limited to 'llvm/lib/Frontend/HLSL/HLSLResource.cpp')
-rw-r--r-- | llvm/lib/Frontend/HLSL/HLSLResource.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/Frontend/HLSL/HLSLResource.cpp b/llvm/lib/Frontend/HLSL/HLSLResource.cpp index a3a7d0b8696c..709fe3212623 100644 --- a/llvm/lib/Frontend/HLSL/HLSLResource.cpp +++ b/llvm/lib/Frontend/HLSL/HLSLResource.cpp @@ -33,25 +33,31 @@ ResourceKind FrontendResource::getResourceKind() { cast<ConstantAsMetadata>(Entry->getOperand(2))->getValue()) ->getLimitedValue()); } -uint32_t FrontendResource::getResourceIndex() { +bool FrontendResource::getIsROV() { return cast<ConstantInt>( cast<ConstantAsMetadata>(Entry->getOperand(3))->getValue()) ->getLimitedValue(); } -uint32_t FrontendResource::getSpace() { +uint32_t FrontendResource::getResourceIndex() { return cast<ConstantInt>( cast<ConstantAsMetadata>(Entry->getOperand(4))->getValue()) ->getLimitedValue(); } +uint32_t FrontendResource::getSpace() { + return cast<ConstantInt>( + cast<ConstantAsMetadata>(Entry->getOperand(5))->getValue()) + ->getLimitedValue(); +} FrontendResource::FrontendResource(GlobalVariable *GV, StringRef TypeStr, - ResourceKind RK, uint32_t ResIndex, - uint32_t Space) { + ResourceKind RK, bool IsROV, + uint32_t ResIndex, uint32_t Space) { auto &Ctx = GV->getContext(); IRBuilder<> B(Ctx); Entry = MDNode::get( Ctx, {ValueAsMetadata::get(GV), MDString::get(Ctx, TypeStr), ConstantAsMetadata::get(B.getInt32(static_cast<int>(RK))), + ConstantAsMetadata::get(B.getInt1(IsROV)), ConstantAsMetadata::get(B.getInt32(ResIndex)), ConstantAsMetadata::get(B.getInt32(Space))}); } |