A merged draw replay's functions read their command's slot table where other functions read a
RootTableAddress push field. The vertex function takes the table of the command its corner falls
in; the fragment function takes the table of the command its vertex wrote. That lookup ran in
stage_io::emit_entry, after access::dynamic::emit_entry, which reads each wide buffer parameter's
root entry at entry from that same table. So a merged function that loads a pointer from a buffer
read its table before the lookup had found it. An argument buffer holding a constant pointer is
one such case. The compile failed on the Internal Invariant "a merged draw's fragment slot table
read before its entry" (or the vertex's "slot table read before its entry"), and the execution of
a GPU-encoded indirect command buffer went to the host step. In the consumer's own game-shaped
program that step cost 32-48 ms a frame on the M3 (MoltenVK) and on Iris Xe (ANV), both logging the
invariant.
The lookup is now a hook of its own, stage_io::emit_draw_entry. It runs after the push fields,
specializations and dispatch values and before the access family's hook, and covers the captured
index of the de-indexed and private list forms, a merged vertex's command and a merged fragment's
table. The pulled attribute fetch stays in stage_io::emit_entry, after both.
New owned fixture: engine/icb_merged_arguments (MSL of our own). It has a [[stage_in]] vertex
function over vertex buffers 0..2, and a fragment function whose buffer 0 is an argument buffer of
two textures and a constant pointer. Two kernels encode indexed triangle draws with resets, one
binding the commands' own buffers and one binding none.
Verified (icbinherit, ebbcdad70a on 73caf92102, msi lavapipe):
- pipeline::compile::tests::a_merged_fragment_reads_its_argument_buffer_through_its_command_s_table
compiles the state's merged replay variant on moltenvk-m3, amd-rdna3-radv and lavapipe.
- It fails at the fixture commit with exactly the invariant (27480).
- With the fix, 82/82 merged and replay tests in metal2vulkan --lib pass (27488).
- The fixture's golden_hashes, engine-inventory and air_input rows are re-blessed on development.
SEMANTICS_VERSION 2102 -> 2103.