Skip to content

perf: ping-pong texture targets in channel composite and effect chain#5

Draft
DanceMore wants to merge 2 commits into
im-knots:mainfrom
DanceMore:perf-ping-pong-compositing
Draft

perf: ping-pong texture targets in channel composite and effect chain#5
DanceMore wants to merge 2 commits into
im-knots:mainfrom
DanceMore:perf-ping-pong-compositing

Conversation

@DanceMore
Copy link
Copy Markdown
Collaborator

this stacks on #4

Channel::render snapshotted composite_texture into effect_ping_texture between every deck blend, costing N-1 intermediate full-resolution copies for an N-deck channel plus their command-buffer recording overhead.

Replaces the snapshot-copy pattern with a ping-pong: composite_view and effect_ping_view alternate as blend target and read-from background per step; std::mem::swap restores composite_texture as the latest if the result landed in ping. Same change applied to the channel effect chain.

Verified against the bench harness from #4. Multi-deck cells are the target and show robust gains across runs; single-deck and 2ch/1-deck-each cells are within noise (no snapshot copy to eliminate when N=1).

DanceMore added 2 commits May 15, 2026 14:18
No benchmarks existed for the compositing pipeline or the per-frame shader
parameter buffer build. Adds two criterion suites — channel_composite_solid
(LoadOp::Clear, isolates copy-on-composite slope), channel_composite_shader
(bars.fs, total per-deck cost), mixer_crossfade, and shader_params_buffer
(no_mod / empty_mod / active_lfo) — plus a 60fps preflight assertion at
8-deck 1080p and a per-deck slope reporter. Smoke-runs via
scripts/bench-smoke.sh; runs headless when no GPU adapter is available.
Channel::render copied composite_texture into effect_ping_texture between
every deck blend, costing N-1 intermediate full-resolution copies for an
N-deck channel plus their command-buffer recording overhead. Replaces the
snapshot-copy pattern with a ping-pong: composite_view and effect_ping_view
alternate as the blend target and the read-from background per step;
std::mem::swap restores composite_texture as the latest if the result
landed in ping. Same change applied to the channel effect chain loop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant