wgpu

Type Alias DeviceDescriptor

Source
pub type DeviceDescriptor<'a> = DeviceDescriptor<Label<'a>>;
Expand description

Describes a Device.

For use with Adapter::request_device.

Corresponds to WebGPU GPUDeviceDescriptor.

Aliased Type§

struct DeviceDescriptor<'a> {
    pub label: Option<&'a str>,
    pub required_features: Features,
    pub required_limits: Limits,
    pub memory_hints: MemoryHints,
    pub trace: Trace,
}

Fields§

§label: Option<&'a str>

Debug label for the device.

§required_features: Features

Specifies the features that are required by the device request. The request will fail if the adapter cannot provide these features.

Exactly the specified set of features, and no more or less, will be allowed in validation of API calls on the resulting device.

§required_limits: Limits

Specifies the limits that are required by the device request. The request will fail if the adapter cannot provide these limits.

Exactly the specified limits, and no better or worse, will be allowed in validation of API calls on the resulting device.

§memory_hints: MemoryHints

Hints for memory allocation strategies.

§trace: Trace

Whether API tracing for debugging is enabled, and where the trace is written if so.

Implementations

Source§

impl<L> DeviceDescriptor<L>

Source

pub fn map_label<K>(&self, fun: impl FnOnce(&L) -> K) -> DeviceDescriptor<K>

Takes a closure and maps the label of the device descriptor into another.

Trait Implementations

Source§

impl<L> Clone for DeviceDescriptor<L>
where L: Clone,

Source§

fn clone(&self) -> DeviceDescriptor<L>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<L> Debug for DeviceDescriptor<L>
where L: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<L> Default for DeviceDescriptor<L>
where L: Default,

Source§

fn default() -> DeviceDescriptor<L>

Returns the “default value” for a type. Read more
Source§

impl<'de, L> Deserialize<'de> for DeviceDescriptor<L>
where L: Deserialize<'de>,

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<DeviceDescriptor<L>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<L> Serialize for DeviceDescriptor<L>
where L: Serialize,

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more