Skip to content

Commit

Permalink
change max cache size
Browse files Browse the repository at this point in the history
  • Loading branch information
nokonoko1203 committed Aug 19, 2024
1 parent 3fefc06 commit 7bb44ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions atlas-packer/src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl DownsampleFactor {

fn get_cache_size() -> Result<usize, String> {
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) => {
Expand All @@ -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(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion nusamai/src/sink/obj/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7bb44ec

Please sign in to comment.