[llvm] [HLSLSemanticSignatures] Implement the optimal packing of elements (PR #218064)

Helena Kotas via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 21:03:00 PDT 2026


================
@@ -105,6 +105,25 @@ LLVM_ABI Expected<unsigned>
 packSignatureIndexed(MutableArrayRef<SemanticSignatureElement> Elements,
                      Triple::EnvironmentType ShaderStage, IOType IOTy);
 
+/// Packs eligible signature elements in an optimized order by reordering
+/// elements into a optimal packind order and allowing clip/cull to share
+/// comapatible rows. Only StartRow and StartCol are modified
+///
+/// See llvm/docs/DirectX/SemanticSignatures.md#optimized-packing for details.
+///
+/// Returns one past the highest allocated row, or zero if no elements were
+/// allocated. For geometry outputs this is the maximum extent of any stream,
+/// not the sum of their extents.
+///
+/// On failure, Elements is left partially packed: the elements preceding the
----------------
hekota wrote:

```suggestion
/// On failure, Elements are left partially packed: the elements preceding the
```

https://github.com/llvm/llvm-project/pull/218064


More information about the llvm-commits mailing list