[DirectX backend] add support ConstantBuffer to DXILResource.h
authorXiang Li <python3kgae@outlook.com>
Thu, 12 Jan 2023 16:56:18 +0000 (11:56 -0500)
committerXiang Li <python3kgae@outlook.com>
Thu, 12 Jan 2023 18:42:11 +0000 (13:42 -0500)
commit944f4b2805852072022293678fddd65dc450e0f2
treea7e613a20f58bc173b89f85b321e62cbc048105b
parent7f2f6eec3ead9c5715c86159919d6df182d1cc4d
[DirectX backend] add support ConstantBuffer to DXILResource.h

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.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D136031
13 files changed:
llvm/lib/Target/DirectX/CBufferDataLayout.cpp [new file with mode: 0644]
llvm/lib/Target/DirectX/CBufferDataLayout.h [new file with mode: 0644]
llvm/lib/Target/DirectX/CMakeLists.txt
llvm/lib/Target/DirectX/DXILResource.cpp
llvm/lib/Target/DirectX/DXILResource.h
llvm/test/CodeGen/DirectX/cbuf.ll [new file with mode: 0644]
llvm/test/CodeGen/DirectX/legacy_cb_layout_0.ll [new file with mode: 0644]
llvm/test/CodeGen/DirectX/legacy_cb_layout_1.ll [new file with mode: 0644]
llvm/test/CodeGen/DirectX/legacy_cb_layout_2.ll [new file with mode: 0644]
llvm/test/CodeGen/DirectX/legacy_cb_layout_3.ll [new file with mode: 0644]
llvm/test/tools/dxil-dis/BasicIR.ll
llvm/unittests/Target/DirectX/CBufferDataLayoutTests.cpp [new file with mode: 0644]
llvm/unittests/Target/DirectX/CMakeLists.txt