wgpu_hal::gles

Struct AdapterContext

Source
pub struct AdapterContext { /* private fields */ }
Available on neither Windows nor webgl and gles only.
Expand description

A wrapper around a glow::Context and the required EGL context that uses locking to guarantee exclusive access when shared with multiple threads.

Implementations§

Source§

impl AdapterContext

Source

pub fn is_owned(&self) -> bool

Source

pub fn egl_instance(&self) -> Option<&DynamicInstance<EGL1_4>>

Returns the EGL instance.

This provides access to EGL functions and the ability to load GL and EGL extension functions.

Source

pub fn raw_display(&self) -> Option<&Display>

Returns the EGLDisplay corresponding to the adapter context.

Returns None if the adapter was externally created.

Source

pub fn egl_version(&self) -> Option<(i32, i32)>

Returns the EGL version the adapter context was created with.

Returns None if the adapter was externally created.

Source

pub fn raw_context(&self) -> *mut c_void

Source§

impl AdapterContext

Source

pub unsafe fn get_without_egl_lock(&self) -> MappedMutexGuard<'_, Context>

Get’s the glow::Context without waiting for a lock

§Safety

This should only be called when you have manually made sure that the current thread has made the EGL context current and that no other thread also has the EGL context current. Additionally, you must manually make the EGL context not current after you are done with it, so that future calls to lock() will not fail.

Note: Calling this function will still lock the glow::Context which adds an extra safe-guard against accidental concurrent access to the context.

Source

pub fn lock<'a>(&'a self) -> AdapterContextLock<'a>

Obtain a lock to the EGL context and get handle to the glow::Context that can be used to do rendering.

Trait Implementations§

Source§

impl Drop for AdapterContext

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for AdapterContext

Source§

impl Sync for AdapterContext

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,