From 48b51f0a3e873bb730858584ebf2b0c48c0af98a Mon Sep 17 00:00:00 2001 From: Pragyaan Gaur Date: Sat, 28 Nov 2026 06:16:40 +0530 Subject: [PATCH] fix(gpu): put the Windows-only cfg on each eviction item so the native tests build again --- crates/victory-gpu/src/resource.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs index 30a739ae2..51d7f0a7f 100644 --- a/crates/victory-gpu/src/resource.rs +++ b/crates/victory-gpu/src/resource.rs @@ -1906,21 +1906,23 @@ pub(crate) fn evict_heap_uav() -> bool { *ON.get_or_init(|| std::env::var_os("VICTORY_EVICT_HEAP_UAV").is_some_and(|v| v != "0")) } -/// Once per presented frame, before a submission (`Host::execute`, one at a -/// time, the last one has run): gives up host textures fed from title memory -/// that the title has not used for [`IDLE_MS`], and past [`BUDGET_HIGH`] of -/// the card's budget the least recently used ones until [`BUDGET_LOW`]. -/// Host copies of title memory nothing asked for in as long go too -/// ([`crate::shadow::release_stale`]). -#[cfg(windows)] /// The frame [`evict_unused`] last ran in. +#[cfg(windows)] static EVICTED_IN: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(u64::MAX); /// Whether [`evict_unused`] would run now (once per presented frame). +#[cfg(windows)] pub(crate) fn evict_due() -> bool { EVICTED_IN.load(std::sync::atomic::Ordering::Relaxed) != crate::queue::presented() } +/// Once per presented frame, before a submission (`Host::execute`, one at a +/// time, the last one has run): gives up host textures fed from title memory +/// that the title has not used for [`IDLE_MS`], and past [`BUDGET_HIGH`] of +/// the card's budget the least recently used ones until [`BUDGET_LOW`]. +/// Host copies of title memory nothing asked for in as long go too +/// ([`crate::shadow::release_stale`]). +#[cfg(windows)] pub(crate) fn evict_unused() { use std::sync::atomic::Ordering::Relaxed; let frame = crate::queue::presented();