Files
LibretroAdmin a840c07266 audio: the s16 gain and the synth sum carry the audio, not a copy
Three copies on the flush path that the next pass overwrote:

- Integer front pair at unity to an s16 device with a master gain:
  the batch was copied into the output scratch, then the gain ran over
  it in place. The gain now reads the batch and writes the scratch, one
  pass (audio_driver_gain_s16(), the same Q16 multiply).
- In-process MIDI synth on the integer path: the game audio was copied
  into the writable view, then the synth summed into it. The sum is now
  written from the game audio, one pass, and a synth that rendered
  nothing leaves the batch where it is, uncopied.
- In-process MIDI synth for a float core: copied in, then summed. The
  sum is written in the pass that brings the audio in. The synth renders
  before the path is chosen, so one that has nothing this batch no
  longer forces an s16 core off its passthrough through two conversions.

Output is unchanged sample for sample. Measured on 800-frame stereo
batches: the float synth sum 167 -> 132 ns per batch; the s16 gain
saves the 23 ns copy, about 0.5% of that pass; a silent synth saves the
copy and, on the float path, an s16 -> float -> s16 round trip.

unity_identity gains lanes: the integer gain at an attenuation and at a
saturating boost against the Q16 oracle; the synth sum on the integer
pair and for a float core against what the copy and the add gave; and
a silent synth leaving the batch on its passthrough, which on the float
path failed before (one s16 -> float and one float -> s16 conversion).
The shared stubs' synth is replaced there by one the cases control.
2026-11-07 17:52:40 +01:00
..
2026-10-13 11:50:11 +02:00