pub struct WebGpuDevice {
pub adapter_name: String,
/* private fields */
}Expand description
A fully initialised WebGPU device together with its submit queue.
Created via WebGpuDevice::new which blocks the calling thread using
pollster until the async device request completes.
Fields§
§adapter_name: StringHuman-readable adapter name for diagnostics.
Implementations§
Source§impl WebGpuDevice
impl WebGpuDevice
Sourcepub fn new() -> WebGpuResult<Self>
pub fn new() -> WebGpuResult<Self>
Create a WebGPU device by selecting the highest-performance adapter.
Blocks the calling thread until the device is ready.
Sourcepub fn limits(&self) -> &Limits
pub fn limits(&self) -> &Limits
Effective device limits (max_buffer_size,
max_storage_buffer_binding_size,
max_compute_workgroups_per_dimension, …), resolved from the adapter
at device-creation time rather than the WebGPU conformance baseline.
Sourcepub fn poll_error(&self) -> Option<String>
pub fn poll_error(&self) -> Option<String>
Drain and return the most recent uncaptured wgpu error recorded since the last call, if any.
wgpu delivers validation, out-of-memory, and internal errors that were
not caught by an explicit error scope through the non-fatal handler
installed in WebGpuDevice::new rather than aborting the process.
Call this immediately after an operation that might have triggered one
— on the native wgpu-core backends the handler fires synchronously,
before the triggering call returns — and turn Some(_) into a typed
Err(WebGpuError::UncapturedError(_)).
Sourcepub fn is_device_lost(&self) -> bool
pub fn is_device_lost(&self) -> bool
Returns true once wgpu has reported this device as lost (GPU reset,
driver failure, or an external Device::destroy() call).