From 7bb44ecea3894acf25cd692640acf03d27cf3cbd Mon Sep 17 00:00:00 2001 From: nokonoko1203 Date: Mon, 19 Aug 2024 22:59:45 +0900 Subject: [PATCH] change max cache size --- atlas-packer/src/texture.rs | 6 +++--- nusamai/src/sink/obj/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/atlas-packer/src/texture.rs b/atlas-packer/src/texture.rs index 4a0cbb07..8eea3743 100644 --- a/atlas-packer/src/texture.rs +++ b/atlas-packer/src/texture.rs @@ -28,7 +28,7 @@ impl DownsampleFactor { fn get_cache_size() -> Result { const MIN_CACHE_SIZE: usize = 100 * 1024 * 1024; // 100MB - const MAX_CACHE_SIZE: usize = 10 * 1024 * 1024 * 1024; // 10GB + const MAX_CACHE_SIZE: usize = 2 * 1024 * 1024 * 1024; // 2GB match mem_info() { Ok(mem) => { @@ -51,11 +51,11 @@ impl TextureCache { let default_capacity = get_cache_size().unwrap(); if capacity == 0 { TextureCache { - cache: Cache::new(default_capacity, 10_000_000_000).unwrap(), + cache: Cache::new(default_capacity, 2_000_000_000).unwrap(), } } else { TextureCache { - cache: Cache::new(capacity, 10_000_000_000).unwrap(), + cache: Cache::new(capacity, 2_000_000_000).unwrap(), } } } diff --git a/nusamai/src/sink/obj/mod.rs b/nusamai/src/sink/obj/mod.rs index e98d6527..e0e3c5a6 100644 --- a/nusamai/src/sink/obj/mod.rs +++ b/nusamai/src/sink/obj/mod.rs @@ -387,7 +387,7 @@ impl DataSink for ObjSink { // Texture cache // use default cache size - let texture_cache = TextureCache::new(0); + let texture_cache = TextureCache::new(1_000_000_000); // file output destination let mut folder_path = self.output_path.clone();