gpu: share video_memory query in heap_textures and lower 16 GB cutoff to 12 GiB

This commit is contained in:
fever308 committed 2026-11-24 15:08:01 -06:00
1 parent 79bf8e78db
commit dfe94c875e
2 files changed
+7 -10

No files matched your search

+1 -2
View File
@@ -1374,7 +1374,7 @@ fn texture_floor_bytes(vram_budget: Option<u64>) -> u64 {
/// instead). Past the budget the system moves the card's memory into the PC's,
/// which ended runs 20 and 24.
#[cfg(windows)]
pub(crate) fn room() -> bool {
pub(crate) fn room(memory: Option<[u64; 4]>) -> bool {
use std::sync::atomic::Ordering::Relaxed;
const WITHOUT_BUDGET: u64 = 4 << 30;
static LIMIT: std::sync::OnceLock<Option<u64>> = std::sync::OnceLock::new();
@@ -1386,7 +1386,6 @@ pub(crate) fn room() -> bool {
if let Some(limit) = limit {
return filled < limit;
}
let memory = crate::host::host().and_then(|h| h.video_memory());
let floor = texture_floor_bytes(memory.map(|[budget, ..]| budget));
if filled < floor {
return true;