| 1 |
# gpu-descriptor |
| 2 |
|
| 3 |
[](https://crates.io/crates/gpu-descriptor) |
| 4 |
[](https://docs.rs/gpu-descriptor) |
| 5 |
[](https://github.com/zakarumych/gpu-descriptor/actions?query=workflow%3ARust) |
| 6 |
[](COPYING) |
| 7 |
 |
| 8 |
|
| 9 |
|
| 10 |
Library for Vulkan-like APIs to allocated descriptor sets |
| 11 |
from descriptor pools fast, with least overhead and zero fragmentation. |
| 12 |
|
| 13 |
Straightforward usage: |
| 14 |
```rust |
| 15 |
use gpu_descriptor::DescriptorAllocator; |
| 16 |
|
| 17 |
let mut allocator = DescriptorAllocator::new(max_update_after_bind_descriptors_in_all_pools); // Limit as dictated by API for selected hardware |
| 18 |
|
| 19 |
let result = allocator.allocate( |
| 20 |
device, // Implementation of `gpu_descriptor::DescriptorDevice`. Comes from plugins. |
| 21 |
layout, // Descriptor set layout recognized by device's type. |
| 22 |
flags, // Flags specified when layout was created. |
| 23 |
layout_descriptor_count, // Descriptors count in the layout. |
| 24 |
count, // count of sets to allocated. |
| 25 |
); |
| 26 |
``` |
| 27 |
|
| 28 |
|
| 29 |
## License |
| 30 |
|
| 31 |
Licensed under either of |
| 32 |
|
| 33 |
* Apache License, Version 2.0, ([license/APACHE](license/APACHE) or http://www.apache.org/licenses/LICENSE-2.0) |
| 34 |
* MIT license ([license/MIT](license/MIT) or http://opensource.org/licenses/MIT) |
| 35 |
|
| 36 |
at your option. |
| 37 |
|
| 38 |
## Contributions |
| 39 |
|
| 40 |
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. |
| 41 |
|
| 42 |
## Support me on Patreon |
| 43 |
|
| 44 |
[](https://patreon.com/zakarum) |