[clang] [HLSL] support packoffset in clang codeGen (PR #91999)
Chris B via cfe-commits
cfe-commits at lists.llvm.org
Wed May 15 15:09:13 PDT 2024
================
@@ -5671,6 +5671,54 @@ HLSLBufferDecl *HLSLBufferDecl::CreateDeserialized(ASTContext &C,
SourceLocation(), SourceLocation());
}
+static uint64_t calculateLegacyCbufferAlign(const ASTContext &Context,
+ QualType T) {
+ if (T->isAggregateType())
+ return 128;
+ else if (const VectorType *VT = T->getAs<VectorType>())
+ return Context.getTypeSize(VT->getElementType());
+ else
+ return Context.getTypeSize(T);
+}
+
+unsigned HLSLBufferDecl::calculateLegacyCbufferSize(const ASTContext &Context,
----------------
llvm-beanz wrote:
This function seems like something we should be able to have some unit tests of. Can we write unit tests that exercise this through a bunch of the interesting variations to ensure it does the right thing?
https://github.com/llvm/llvm-project/pull/91999
More information about the cfe-commits
mailing list