fix(ui): don't bump the display-color generation on the first build

The first processor build has no prior state to be stale against; the
spurious bump made the next cpu_frame call drop the freshly cached
image (playback_display_tracks_the_playhead regression).
This commit is contained in:
2026-08-21 02:47:39 +08:00
parent 2d4342ff48
commit 09cfd9f09e
+6 -1
View File
@@ -99,7 +99,12 @@ fn current() -> Option<State> {
}
// The key changed: everything rendered with the old transform is
// stale — bump the generation so frame caches drop their contents.
GENERATION.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
// The FIRST build (no prior state) must not bump: no frame can be
// staler than a transform that did not exist yet, and a spurious
// bump would drop the frames being cached right now.
if guard.is_some() {
GENERATION.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
}
let (mode, icc_path, space) = &key;
if mode != "icc" {
let state = State {