pub struct GpuDevice {
pub is_fallback: bool,
/* private fields */
}Expand description
GPU device wrapper
This structure manages the WGPU device and queue, providing a safe interface for GPU operations.
Fields§
§is_fallback: boolWhen true, this device was created via the fallback (software) adapter.
GPU-dependent operations will return GpuError::NotSupported.
Implementations§
Source§impl GpuDevice
impl GpuDevice
Sourcepub fn new_fallback() -> Result<Self>
pub fn new_fallback() -> Result<Self>
Create a CPU-only fallback device using the wgpu software (Vulkan Portability / force_fallback_adapter) path.
Returns Err(GpuError::NoAdapter) only when there is genuinely no wgpu
adapter available on the system (e.g., a truly headless environment with
no software renderer). In all other cases, the returned device will be
functional, albeit potentially CPU-backed.
§Errors
Returns GpuError::NoAdapter if no adapter can be obtained through any
backend on this system.
Sourcepub fn list_devices() -> Result<Vec<GpuDeviceInfo>>
pub fn list_devices() -> Result<Vec<GpuDeviceInfo>>
List all available GPU devices
Sourcepub fn info(&self) -> &GpuDeviceInfo
pub fn info(&self) -> &GpuDeviceInfo
Get device information
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuDevice
impl !RefUnwindSafe for GpuDevice
impl Send for GpuDevice
impl Sync for GpuDevice
impl Unpin for GpuDevice
impl UnsafeUnpin for GpuDevice
impl !UnwindSafe for GpuDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more