pub struct GpuBackendFactory;Expand description
Vendor detection and backend creation
Implementations§
Source§impl GpuBackendFactory
impl GpuBackendFactory
Sourcepub fn detect_available_vendors() -> Vec<GpuVendor>
pub fn detect_available_vendors() -> Vec<GpuVendor>
Detect available GPU vendors.
This used to unconditionally claim NVIDIA and AMD and Intel were all present on every Linux/Windows machine (and Intel on every Mac, which is simply false on Apple Silicon). It now either asks something real or reports honestly empty instead of guessing:
- macOS: every system has at least one Metal-capable device, so
this opens a real
scirs2_core::gpu::GpuContexton theMetalbackend and reportsAppleonly if that actually succeeds. It never claimsIntel: most Macs sold since 2020 have none. - Linux: reads real PCI vendor IDs from
/sys/bus/pci/devices(no FFI, no root required) via the privatedetect_pci_display_vendorshelper below. - Everywhere else (including Windows): this crate has no dependency-free way to query real vendor hardware, so it reports an empty list rather than a fabricated one.
Sourcepub fn get_preferred_vendor() -> GpuVendor
pub fn get_preferred_vendor() -> GpuVendor
The first vendor from Self::detect_available_vendors this crate
has a backend for, preferring the one most likely to work on the
current platform. Unknown when detection found nothing — never a
fabricated guess.
Sourcepub fn create_default_config(vendor: GpuVendor) -> VendorConfig
pub fn create_default_config(vendor: GpuVendor) -> VendorConfig
Create backend configuration for vendor
Auto Trait Implementations§
impl Freeze for GpuBackendFactory
impl RefUnwindSafe for GpuBackendFactory
impl Send for GpuBackendFactory
impl Sync for GpuBackendFactory
impl Unpin for GpuBackendFactory
impl UnsafeUnpin for GpuBackendFactory
impl UnwindSafe for GpuBackendFactory
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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