Files
metal2vulkan/docs
Jacob McSwain 8f117956ef Translator: split whole-struct stack loads and stores into members
Vertex functions that build their return value on the stack couldn't be translated. A whole struct
stored to or loaded from an alloca reached lowering, which handles only scalars and vectors there,
and was refused as Lowering(Access) AccessType.

The shape involved, seen in modules Apple's Metal shader converter wrote:
- a store of zeroinitializer to an alloca of the return struct;
- stores to its members;
- one load of the whole struct.

What changes: the split that already turns a whole-aggregate access of device, constant and
threadgroup memory into its members' accesses now covers stack memory too. Still kept whole, and
refused by lowering as before:
- a volatile access;
- an aggregate that holds a pointer;
- an aggregate with more members than the split takes.

No public API changes.

Evidence:
- a_stack_aggregate_is_split checks the member stores and loads, their alignments and byte offsets,
  the two insertvalues, and that no whole-struct access is left.
- what_is_not_split_stays_whole gains the three stack cases above.
- The new fixture compiles, links and validates.
- a_stack_aggregate_is_split and a_return_value_built_in_a_stack_slot_compiles fail without this
  change.
- No release-mode timing was taken; the split adds a bounded walk per whole stack access.

Version: SEMANTICS_VERSION 2389 -> 2390, because inputs refused before can now compile.

Golden table: left for the bless on development; golden_hashes_match_the_table lists the new
fixture's cells. The fixture's expectations row is included.

Not run: the GPU device tests, the Windows clippy legs and the CI matrix.
2026-12-04 21:22:16 -06:00
..