perf: ping-pong texture targets in channel composite and effect chain#5
Draft
DanceMore wants to merge 2 commits into
Draft
perf: ping-pong texture targets in channel composite and effect chain#5DanceMore wants to merge 2 commits into
DanceMore wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).