[llvm-branch-commits] [llvm] [HLSLSemanticSignatures] Implement the prefix packing of elements (PR #218062)
Helena Kotas via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Aug 28 17:49:56 PDT 2026
================
@@ -200,3 +200,54 @@ reg1: unused.xyzw
reg2: Color2.xy | unused.zw
reg3: Color3.xyzw
```
+
+### Prefix-Stable Packing
+
+Prefix-stable packing is used for signatures that connect programmable shader
+stages or carry patch constant data. Elements are visited in declaration order
+and placed at the first compatible location in the 32-row by 4-column register
+space. Once an element is placed it is never moved, so appending elements to a
+signature does not change the locations assigned to its existing prefix.
+
+Elements can share unused components in a row when all applicable packing
+constraints are satisfied:
+
+- Every element in a row must have a compatible interpolation mode.
+- When native 16-bit types are enabled, every element in a row must have the
+ same component width. Without native 16-bit types, min-precision values
+ occupy 32-bit components.
+- Components are ordered from arbitrary values, to system values, to system
+ generated values.
+- A system value or system generated value cannot be placed in a dynamically
+ indexed row. Multi-row elements define the dynamically indexed range that
+ they cover.
----------------
hekota wrote:
```suggestion
- A system value or system generated value cannot be placed in a dynamically
indexed row. A dynamically indexed row is a row within the range covered by
a multi-row element, where the row is selected using a dynamic index.
```
https://github.com/llvm/llvm-project/pull/218062
More information about the llvm-branch-commits
mailing list