Files
metal2vulkan/docs
Anees Iqbal e17223aed8 A render execution's range read from a buffer runs on the GPU in the merged form
executeCommandsInBuffer:indirectBuffer:indirectBufferOffset: sent every render execution to the
host step, even when the GPU wrote the commands and they merge into one draw. That costs a
GPU-to-CPU round trip each time.

Now an execution whose commands merge takes the GPU form whatever its range:

- The draw replay gets DrawReplay::range_read. The preprocess runs over every command of the
  buffer. Each invocation reads the range (location, then length) from the parameters
  (DrawReplayLayout::range_offset). A command outside the range draws nothing.
- The range is taken as the host step takes it (ExecutionRange::commands): clamped at the size.
  A location past the size, or an end past 2^32 - 1, draws nothing and reports RANGE once.
- The binder refuses range_read unless the replay is merged and covers the whole buffer
  (ReplayRefusal::RangeRead).
- The runtime copies the range's 8 bytes, where the encoder read them
  (indirect_execute::range_from), into the scratch's parameters between barriers, before the
  preprocess.
- These still take the host step, and the notice names the rule: commands that do not merge (a
  strip type, or a rule of the merged form), and an execution whose records the CPU alone writes.

The degrade notice's text (degradation.rs, docs/API.md), the render executions' docs and the
upload arena's docs now describe this. The API signatures are re-blessed.

Tests:
- bind::replay::draws::tests::a_replay_that_reads_its_range_draws_the_commands_inside_it, on
  the CPU interpreter: seven ranges, including clamped, empty, at the size, past the size and
  past 2^32 - 1. Each command's arguments and the merged corners are checked, plus both refusals.
- runtime_lane::render_merged_executions::a_range_read_from_a_buffer_draws_on_the_gpu_what_the_host_step_draws:
  four ranges, one written by a blit before the pass. The GPU form draws 8 merged commands and
  reads no record. Its pixels and execution report equal the host step's.
2026-11-12 05:08:28 -08:00
..