| 1 |
# gpu-alloc |
| 2 |
|
| 3 |
[](https://crates.io/crates/gpu-alloc) |
| 4 |
[](https://docs.rs/gpu-alloc) |
| 5 |
[](https://github.com/zakarumych/gpu-alloc/actions?query=workflow%3ARust) |
| 6 |
[](COPYING) |
| 7 |
 |
| 8 |
|
| 9 |
|
| 10 |
Implementation agnostic memory allocator for Vulkan like APIs. |
| 11 |
|
| 12 |
This crate is intended to be used as part of safe API implementations.\ |
| 13 |
Use with caution. There are unsafe functions all over the place. |
| 14 |
|
| 15 |
## Usage |
| 16 |
|
| 17 |
Start with fetching `DeviceProperties` from `gpu-alloc-<backend>` crate for the backend of choice.\ |
| 18 |
Then create `GpuAllocator` instance and use it for all device memory allocations.\ |
| 19 |
`GpuAllocator` will take care for all necessary bookkeeping like memory object count limit, |
| 20 |
heap budget and memory mapping. |
| 21 |
|
| 22 |
#### Backends implementations |
| 23 |
|
| 24 |
Backend supporting crates should not depend on this crate.\ |
| 25 |
Instead they should depend on `gpu-alloc-types` which is much more stable, |
| 26 |
allowing to upgrade `gpu-alloc` version without `gpu-alloc-<backend>` upgrade. |
| 27 |
|
| 28 |
|
| 29 |
Supported Rust Versions |
| 30 |
|
| 31 |
The minimum supported version is 1.40. |
| 32 |
The current version is not guaranteed to build on Rust versions earlier than the minimum supported version. |
| 33 |
|
| 34 |
`gpu-alloc-erupt` crate requires version 1.48 or higher due to dependency on `erupt` crate. |
| 35 |
|
| 36 |
## License |
| 37 |
|
| 38 |
Licensed under either of |
| 39 |
|
| 40 |
* Apache License, Version 2.0, ([license/APACHE](license/APACHE) or http://www.apache.org/licenses/LICENSE-2.0) |
| 41 |
* MIT license ([license/MIT](license/MIT) or http://opensource.org/licenses/MIT) |
| 42 |
|
| 43 |
at your option. |
| 44 |
|
| 45 |
## Contributions |
| 46 |
|
| 47 |
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. |
| 48 |
|
| 49 |
## Donate |
| 50 |
|
| 51 |
[](https://www.patreon.com/zakarum) |