[clang] [HLSL] Constant buffers codegen (PR #124886)
Helena Kotas via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 18 17:03:01 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:
The pattern has been to return `nullptr` for types we don't know how to convert. An assert with message "Generic handling of HLSL types is not supported." will fire in `CGHLSLRuntime::convertHLSLSpecificType` if the converted type is null.
https://github.com/llvm/llvm-project/pull/124886
More information about the cfe-commits
mailing list