[HLSL] Implement optimal packing of semantic signatures
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
This issue tracks the implementation of the optimal signature packing algorithm. This should be made available by a function that will take a mutable arrayref of signature elements and update the start row and start col so the elements to be packed into a grid.
It should be defined to re-use the co-packing behaviour in https://github.com/llvm/llvm-project/issues/204889 and just provide the elements in an optimal order.
The optimal algorithm iterates the elements in an *optimal* (defined in links) manner and co-pack elements in registers.
While the code change is small there is still substantial test cases that need to be created.
For more comprehensive references:
- [Semantics Overview](https://github.com/llvm/wg-hlsl/blob/main/proposals/0040-semantics-overview.md#signature-packing-constraints)
- [DXIL Spec](https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst#signature-packing)
AC:
- [ ] A function for the packing algorithm is defined in `llvm/Frontend/HLSL/SemanticSignatures.h`
- [ ] Unit testing of the packing is defined in `llvm/unittests/Frontend/HLSLSemanticSignaturePackingTest.cpp`
Contributor guide
Assessment
This issue has not been assessed yet.