class ConstantBuffer is added to save information for cbuffer.
Also add CBufferDataLayout to calculate the size for cbuffer.
Now always use legacy cbuffer layout.
https://reviews.llvm.org/D134998 will add control to disable legacy cbuffer layout.
Paths
| Differential D136031
[DirectX backend] support ConstantBuffer to DXILResource.h ClosedPublic Authored by python3kgae on Oct 15 2022, 7:33 PM.
Details Summary class ConstantBuffer is added to save information for cbuffer. Now always use legacy cbuffer layout.
Diff Detail
Event Timelinepython3kgae added a parent revision: D130951: [HLSL] CodeGen hlsl resource binding..Oct 15 2022, 7:34 PM python3kgae removed a parent revision: D130951: [HLSL] CodeGen hlsl resource binding..Dec 13 2022, 12:56 PM Comment Actions It is probably worth adding some unit tests to test the CBufferDataLayout class. I think the meat of this change is fine. This code mixes unsigned and uint32_t interchangeably. They aren't required by the language to be the same. I have a general preference toward uint32_t which is explicitly sized, but we should match existing interfaces where appropriate. For example, we should also probably be using llvm::TypeSize where appropriate to match llvm::DataLayout This revision is now accepted and ready to land.Jan 12 2023, 6:40 AM This revision was landed with ongoing or failed builds.Jan 12 2023, 10:42 AM Closed by commit rG944f4b280585: [DirectX backend] add support ConstantBuffer to DXILResource.h (authored by python3kgae). · Explain Why This revision was automatically updated to reflect the committed changes. Comment Actions @python3kgae, this change introduced a bunch of warning spew because it is using an API that was deprecated shortly before the change merged. Can you please address this? Comment Actions
Sure.
Revision Contents
Diff 482620 llvm/lib/Target/DirectX/CBufferDataLayout.h
llvm/lib/Target/DirectX/CBufferDataLayout.cpp
llvm/lib/Target/DirectX/CMakeLists.txt
llvm/lib/Target/DirectX/DXILResource.h
llvm/lib/Target/DirectX/DXILResource.cpp
llvm/test/CodeGen/DirectX/cbuf.ll
llvm/test/CodeGen/DirectX/legacy_cb_layout_0.ll
llvm/test/CodeGen/DirectX/legacy_cb_layout_1.ll
llvm/test/CodeGen/DirectX/legacy_cb_layout_2.ll
llvm/test/CodeGen/DirectX/legacy_cb_layout_3.ll
|