pub struct GpuContext {
pub device: Device,
pub queue: Queue,
pub info: AdapterInfo,
pub max_buffer: u64,
}Expand description
A wgpu device and queue on a chosen adapter.
Fields§
§device: Device§queue: Queue§info: AdapterInfo§max_buffer: u64The largest buffer the device allows (the smaller of the storage binding and buffer limits).
Implementations§
Source§impl GpuContext
impl GpuContext
Sourcepub fn create(
options: &ContextOptions,
on_failure: impl Fn(String) + Send + Sync + 'static,
) -> Result<GpuContext, String>
pub fn create( options: &ContextOptions, on_failure: impl Fn(String) + Send + Sync + 'static, ) -> Result<GpuContext, String>
Creates the device, or says why there is none (software adapter, too few storage buffers, no adapter, device creation failed, the process is ending, or a driver panic).
on_failure is called with a reason, possibly from a driver thread, when wgpu reports an
error outside any error scope or the device is lost; the app should stop using the GPU.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GpuContext
impl !UnwindSafe for GpuContext
impl Forget for GpuContext
impl Freeze for GpuContext
impl Send for GpuContext
impl Sync for GpuContext
impl Unpin for GpuContext
impl UnsafeUnpin for GpuContext
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