python3kgae wrote: > > You can use `type <{ float, <2 x float>}>` if you need the tightly-packed > > layout. > > I think we need to figure out how we're going to lower this too. Loading from > this memory space requires loading 128 bytes at a time, and we need to slice > it down to just the parts of the structure we need. > > @bogner is working on the lowering logic, so I'd like to make sure what we > capture at the IR level is appropriate for what he needs in the DirectX > backend.
For the offset calculation in backend, we already added https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/DirectX/CBufferDataLayout.h#L29 Not sure how spirv side works though. It will need something to calculate the offset for legacy cbuffer layout as well. In theory, we could mutate the struct types by add paddings to implement legacy cbuffer layout for data layout. But it is a little hacky since it will need to mutate existing struct types. This PR doesn't mutate any existing type, since the struct is created for cbuffer layout only. https://github.com/llvm/llvm-project/pull/91999 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits