pub struct WgpuContext { /* private fields */ }
Expand description
A wrapper around internal cached state.
Implementations§
Source§impl WgpuContext
impl WgpuContext
Sourcepub fn new(
device: &Device,
queue: &Queue,
format: TextureFormat,
depth_format: Option<TextureFormat>,
samples: u32,
) -> Self
pub fn new( device: &Device, queue: &Queue, format: TextureFormat, depth_format: Option<TextureFormat>, samples: u32, ) -> Self
Create a new wgpu
-based drawing context.
Sourcepub fn prepare<'this, 'dev, 'que>(
&'this mut self,
device: &'dev Device,
queue: &'que Queue,
width: u32,
height: u32,
) -> RenderContext<'this, 'dev, 'que>
pub fn prepare<'this, 'dev, 'que>( &'this mut self, device: &'dev Device, queue: &'que Queue, width: u32, height: u32, ) -> RenderContext<'this, 'dev, 'que>
Prepare rendering by drawing to a RenderContext
.
After this method is called, drawing is expected to be done to the returned context.
Sourcepub fn render<'this>(&'this self, pass: &mut RenderPass<'this>)
pub fn render<'this>(&'this self, pass: &mut RenderPass<'this>)
Render the contents of the RenderContext
to the provided render pass.
Sourcepub fn after_submit(&mut self, device: &Device)
pub fn after_submit(&mut self, device: &Device)
Call this function after you call wgpu::Queue::submit
to free up resources.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WgpuContext
impl !RefUnwindSafe for WgpuContext
impl !Send for WgpuContext
impl !Sync for WgpuContext
impl Unpin for WgpuContext
impl !UnwindSafe for WgpuContext
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.