pub struct RenderTextures {
pub render_texture: ReadbackWgpuTexture,
pub depth_stencil_texture: ReadbackWgpuTexture,
pub render_view: TextureView,
pub linear_render_view: TextureView,
pub depth_texture_view: TextureView,
/* private fields */
}Expand description
Texture resources used for rendering
Fields§
§render_texture: ReadbackWgpuTexture§depth_stencil_texture: ReadbackWgpuTexture§render_view: TextureView§linear_render_view: TextureView§depth_texture_view: TextureViewImplementations§
Source§impl RenderTextures
impl RenderTextures
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn ratio(&self) -> f32
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Mark textures as dirty after rendering.
Sourcepub fn start_readback(&mut self, ctx: &WgpuContext)
pub fn start_readback(&mut self, ctx: &WgpuContext)
Start async readback of the output texture (non-blocking).
Sourcepub fn finish_readback(&mut self, ctx: &WgpuContext)
pub fn finish_readback(&mut self, ctx: &WgpuContext)
Finish a pending async readback, copying data into the CPU-side buffer.
Sourcepub fn try_finish_readback(&mut self, ctx: &WgpuContext) -> bool
pub fn try_finish_readback(&mut self, ctx: &WgpuContext) -> bool
Try to finish a pending readback without blocking.
Returns true if the readback completed (or there was nothing pending),
false if the GPU hasn’t finished yet.
pub fn get_rendered_texture_data(&mut self, ctx: &WgpuContext) -> &[u8] ⓘ
pub fn get_rendered_texture_img_buffer( &mut self, ctx: &WgpuContext, ) -> ImageBuffer<Rgba<u8>, &[u8]>
pub fn get_depth_texture_data(&mut self, ctx: &WgpuContext) -> &[f32]
pub fn get_depth_texture_img_buffer( &mut self, ctx: &WgpuContext, ) -> ImageBuffer<Luma<u8>, Vec<u8>>
Auto Trait Implementations§
impl Freeze for RenderTextures
impl !RefUnwindSafe for RenderTextures
impl Send for RenderTextures
impl Sync for RenderTextures
impl !Unpin for RenderTextures
impl !UnsafeUnpin for RenderTextures
impl !UnwindSafe for RenderTextures
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more