Skip to main content

RenderBackend

Struct RenderBackend 

Source
pub struct RenderBackend<'w> { /* private fields */ }
Expand description

Low-level wgpu backend that owns surface, pipeline, and GPU buffers.

Implementations§

Source§

impl<'w> RenderBackend<'w>

Source

pub async fn to_canvas( _canvas: HtmlCanvasElement, _config: RenderConfig, ) -> Result<Self, Error>

Source

pub async fn to_canvas_with_context( _canvas: HtmlCanvasElement, _config: RenderConfig, _shared_context: Option<SharedGpuContext>, ) -> Result<(Self, SharedGpuContext), Error>

Source

pub async fn new( surface: Surface<'w>, instance: Instance, config: RenderConfig, ) -> Result<Self, Error>

Source

pub fn new_with_context( surface: Surface<'w>, context: SharedGpuContext, config: RenderConfig, ) -> Result<Self, Error>

Source

pub fn get_clip_depth(&mut self) -> u32

Current stencil clip depth.

Source

pub fn resize(&mut self, width: u32, height: u32)

Resize both the physical surface and logical viewport.

Source

pub fn resize_surface(&mut self, width: u32, height: u32)

Resize the backing surface, clamping to device limits.

Source

pub fn set_viewport(&mut self, width: f32, height: f32, dpr: [f32; 2])

Update logical viewport uniforms without reallocating the surface.

Source

pub fn max_surface_dimension(&self) -> u32

Maximum texture dimension supported by the active adapter.

Source

pub fn shared_context_id(&self) -> usize

Auto Trait Implementations§

§

impl<'w> !Freeze for RenderBackend<'w>

§

impl<'w> !RefUnwindSafe for RenderBackend<'w>

§

impl<'w> !Send for RenderBackend<'w>

§

impl<'w> !Sync for RenderBackend<'w>

§

impl<'w> !UnwindSafe for RenderBackend<'w>

§

impl<'w> Unpin for RenderBackend<'w>

§

impl<'w> UnsafeUnpin for RenderBackend<'w>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> RoundFrom<T> for T

Source§

fn round_from(x: T) -> T

Performs the conversion.
Source§

impl<T, U> RoundInto<U> for T
where U: RoundFrom<T>,

Source§

fn round_into(self) -> U

Performs the conversion.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more