================ @@ -172,6 +172,23 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool CBuffer, return Result; } +static unsigned calculateLegacyCbufferFieldAlign(const ASTContext &Context, + QualType T) { + // Arrays and Structs are always aligned to new buffer rows + if (T->isArrayType() || T->isStructureType()) + return 16; + + // Vectors are aligned to the type they contain + if (const VectorType *VT = T->getAs<VectorType>()) + return calculateLegacyCbufferFieldAlign(Context, VT->getElementType()); ---------------- tex3d wrote:
Oh wait, I just realized that the test wasn't augmented with any vector cases to verify this. https://github.com/llvm/llvm-project/pull/128086 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits