This is an archive of the discontinued LLVM Phabricator instance.

[DirectX backend] support legacy cbuffer load.
Needs ReviewPublic

Authored by python3kgae on Aug 30 2022, 6:10 PM.

Details

Summary

New dxil op CBufferLoadLegacy is added.
Add LegacyCBufferLayout class to calulate address for legacy cbuffer load.

Legacy cbuffer layout is 4 dwords align.
Array/Struct must start from a new 4 dwords.
Vector is align to the element size.
If vector/scalar cannot fit to current 4dwords, start a new 4 dwords.
It is OK to pack vector/scalar after last element of array or end of struct.

Not support dynamic indexing on vector now.

Diff Detail

Event Timeline

python3kgae created this revision.Aug 30 2022, 6:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2022, 6:10 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
python3kgae requested review of this revision.Aug 30 2022, 6:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2022, 6:10 PM
llvm/lib/Target/DirectX/DXILOpBuilder.cpp