[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)
Helena Kotas via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Feb 14 17:50:25 PST 2025
================
@@ -56,9 +75,18 @@ llvm::Type *DirectXTargetCodeGenInfo::getHLSLType(CodeGenModule &CGM,
return llvm::TargetExtType::get(Ctx, TypeName, {ElemType}, Ints);
}
- case llvm::dxil::ResourceClass::CBuffer:
- llvm_unreachable("dx.CBuffer handles are not implemented yet");
- break;
+ case llvm::dxil::ResourceClass::CBuffer: {
+ QualType ContainedTy = ResType->getContainedType();
+ if (ContainedTy.isNull() || !ContainedTy->isStructureType())
----------------
hekota wrote:
Contained type of the CBuffer resource handle is always a layout struct of the constant buffer (implicitly created by Sema [here](https://github.com/llvm/llvm-project/blob/e9fb2391210e20d1d4dcf8bbe37085df902ed028/clang/lib/Sema/SemaHLSL.cpp#L475)).
https://github.com/llvm/llvm-project/pull/124886
More information about the llvm-branch-commits
mailing list