1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use std::fmt;
use super::{feature::Features, queue::QueueFlags, OutOfMemory, SurfaceError};
/// Capabilities of a queue family of specific device.
#[derive(Clone, Debug)]
pub struct FamilyCapabilities {
/// Flags that describe the capabilities of the queue family.
pub queue_flags: QueueFlags,
/// Number of queues that can be created in the queue family.
pub queue_count: usize,
}
/// Capabilities of the specific device.
#[derive(Clone, Debug)]
pub struct DeviceCapabilities {
/// List of features that are supported by the device.
pub features: Features,
/// List of queue families capabilities.
pub families: Vec<FamilyCapabilities>,
}
/// Capabilities of the devices.
#[derive(Clone, Debug)]
pub struct Capabilities {
pub devices: Vec<DeviceCapabilities>,
}
/// Specifies how the device should be created.
pub struct DeviceDesc<'a> {
/// Index of the device.
///
/// Device created will use physical device at that index in [`Capabilities::devices`].
pub idx: usize,
/// Specifies families from which queues should be created.
/// Same family may be specified more than once, up to maximum number of queues in that family. See [`FamilyCapabilities::queue_count`].
pub queues: &'a [u32],
/// List of features that should be enabled.
///
/// It should not include features not supported by the device. See [`DeviceCapabilities::features`].
pub features: Features,
}