pub struct DeviceHandle {
pub adapter: Adapter,
pub device: Device,
pub queue: Queue,
pub caps: TierCaps,
/* private fields */
}Expand description
A logical device, the adapter it was created from, the queue that executes its command buffers, and the capabilities that adapter reported.
Cheap to clone: wgpu’s Adapter/Device/Queue are all Arc-backed
handles to one underlying object, so a clone is another handle to the same
device rather than a second device. Clone it freely to hand a subsystem the
device it needs instead of threading a &RenderContext borrow through it.
Fields§
§adapter: AdapterThe adapter the device was created from.
device: DeviceThe logical device.
queue: QueueThe queue that executes this device’s command buffers.
caps: TierCapsWhat Self::adapter reported at device-creation time. Captured once
so downstream pipeline/atlas decisions read plain data instead of
re-probing the adapter.
Implementations§
Source§impl DeviceHandle
impl DeviceHandle
Sourcepub fn first_uncaptured_error(&self) -> Option<&str>
pub fn first_uncaptured_error(&self) -> Option<&str>
The first uncaptured wgpu error this device ever raised, or None
if it has raised none.
Latched, never overwritten: a frame loop polling this wants the error
that started the trouble, not the last one in a storm the first one
caused. It is also the only programmatic view of an uncaptured error a
caller gets — the handler otherwise only logs (see
decide_log_action) — so a host can degrade or report instead of
silently rendering nothing every frame.
Deliberately not clearable: “this device has seen an uncaptured error” is a property of the device, and a device that has raised one is not reliably recoverable by forgetting about it.
Trait Implementations§
Source§impl BufferUploader for DeviceHandle
impl BufferUploader for DeviceHandle
Source§fn allocate_buffer(
&self,
label: Option<&str>,
size: u64,
usage: BufferUsages,
) -> Buffer
fn allocate_buffer( &self, label: Option<&str>, size: u64, usage: BufferUsages, ) -> Buffer
size bytes with usage.