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>
impl<'w> RenderBackend<'w>
pub async fn to_canvas( _canvas: HtmlCanvasElement, _config: RenderConfig, ) -> Result<Self, Error>
pub async fn to_canvas_with_context( _canvas: HtmlCanvasElement, _config: RenderConfig, _shared_context: Option<SharedGpuContext>, ) -> Result<(Self, SharedGpuContext), Error>
pub async fn new( surface: Surface<'w>, instance: Instance, config: RenderConfig, ) -> Result<Self, Error>
pub fn new_with_context( surface: Surface<'w>, context: SharedGpuContext, config: RenderConfig, ) -> Result<Self, Error>
Sourcepub fn get_clip_depth(&mut self) -> u32
pub fn get_clip_depth(&mut self) -> u32
Current stencil clip depth.
Sourcepub fn resize(&mut self, width: u32, height: u32)
pub fn resize(&mut self, width: u32, height: u32)
Resize both the physical surface and logical viewport.
Sourcepub fn resize_surface(&mut self, width: u32, height: u32)
pub fn resize_surface(&mut self, width: u32, height: u32)
Resize the backing surface, clamping to device limits.
Sourcepub fn set_viewport(&mut self, width: f32, height: f32, dpr: [f32; 2])
pub fn set_viewport(&mut self, width: f32, height: f32, dpr: [f32; 2])
Update logical viewport uniforms without reallocating the surface.
Sourcepub fn max_surface_dimension(&self) -> u32
pub fn max_surface_dimension(&self) -> u32
Maximum texture dimension supported by the active adapter.
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> 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
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.