Update to latest gpu-alloc

This commit is contained in:
Igor Shaposhnik
2021-03-29 09:33:40 +00:00
committed by GitHub
parent b7ba481a91
commit 6097421647
3 changed files with 9 additions and 10 deletions

10
Cargo.lock generated
View File

@@ -617,9 +617,8 @@ dependencies = [
[[package]]
name = "gpu-alloc"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e7724b9aef57ea36d70faf54e0ee6265f86e41de16bed8333efdeab5b00e16b"
version = "0.4.0"
source = "git+https://github.com/zakarumych/gpu-alloc.git?rev=560ad651aa8f7aefcee8f5bcf41e67a84561bcda#560ad651aa8f7aefcee8f5bcf41e67a84561bcda"
dependencies = [
"bitflags",
"gpu-alloc-types",
@@ -627,9 +626,8 @@ dependencies = [
[[package]]
name = "gpu-alloc-types"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5"
version = "0.2.1"
source = "git+https://github.com/zakarumych/gpu-alloc.git?rev=560ad651aa8f7aefcee8f5bcf41e67a84561bcda#560ad651aa8f7aefcee8f5bcf41e67a84561bcda"
dependencies = [
"bitflags",
]

View File

@@ -36,7 +36,8 @@ serde = { version = "1.0", features = ["serde_derive"], optional = true }
smallvec = "1"
thiserror = "1"
gpu-alloc = { version = "0.3" }
# Update to 0.4 when it will be available
gpu-alloc = { git = "https://github.com/zakarumych/gpu-alloc.git", rev = "560ad651aa8f7aefcee8f5bcf41e67a84561bcda" }
gpu-descriptor = { version = "0.1" }
hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "2ac006f7fe86f32dd5b5e07f9daf44cd876a66f0" }

View File

@@ -15,9 +15,9 @@ struct MemoryDevice<'a, B: hal::Backend>(&'a B::Device);
impl<B: hal::Backend> MemoryAllocator<B> {
pub fn new(mem_props: hal::adapter::MemoryProperties, limits: hal::Limits) -> Self {
let mem_config = gpu_alloc::Config {
dedicated_treshold: 32 << 20,
preferred_dedicated_treshold: 8 << 20,
transient_dedicated_treshold: 128 << 20,
dedicated_threshold: 32 << 20,
preferred_dedicated_threshold: 8 << 20,
transient_dedicated_threshold: 128 << 20,
linear_chunk: 128 << 20,
minimal_buddy_size: 1 << 10,
initial_buddy_dedicated_size: 8 << 20,