Debian Codegraph @

third_party/rust/gpu-descriptor/src/lib.rs

raw
1 //!
2 //! Library for Vulkan-like APIs to allocated descriptor sets
3 //! from descriptor pools fast, with least overhead and zero fragmentation.
4 //!
5 //! Straightforward usage:
6 //! ```ignore
7 //! use gpu_descriptor::DescriptorAllocator;
8 //!
9 //! let mut allocator = DescriptorAllocator::new(max_update_after_bind_descriptors_in_all_pools); // Limit as dictated by API for selected hardware
10 //!
11 //! let result = allocator.allocate(
12 //! device, // Implementation of `gpu_descriptor::DescriptorDevice`. Comes from plugins.
13 //! layout, // Descriptor set layout recognized by device's type.
14 //! flags, // Flags specified when layout was created.
15 //! layout_descriptor_count, // Descriptors count in the layout.
16 //! count, // count of sets to allocated.
17 //! );
18 //! ```
19 //!
20
21 #![cfg_attr(not(feature = "std"), no_std)]
22 #![warn(
23 missing_docs,
24 trivial_casts,
25 trivial_numeric_casts,
26 unused_extern_crates,
27 unused_import_braces,
28 unused_qualifications
29 )]
30
31 extern crate alloc;
32
33 mod allocator;
34
35 pub use {crate::allocator::*, gpu_descriptor_types::*};