pub struct RenderTextures {
width: u32,
height: u32,
pub render_texture: ReadbackWgpuTexture,
pub depth_stencil_texture: ReadbackWgpuTexture,
pub render_view: TextureView,
pub linear_render_view: TextureView,
pub depth_texture_view: TextureView,
pub(crate) depth_bind_group: BindGroup,
pub(crate) depth_stencil_view: TextureView,
output_dirty: bool,
depth_dirty: bool,
}Expand description
Texture resources used for rendering
Fields§
§width: u32§height: u32§render_texture: ReadbackWgpuTexture§depth_stencil_texture: ReadbackWgpuTexture§render_view: TextureView§linear_render_view: TextureView§depth_texture_view: TextureView§depth_bind_group: BindGroupBind group for depth texture (used in OIT resolve)
depth_stencil_view: TextureView§output_dirty: bool§depth_dirty: boolImplementations§
Source§impl RenderTextures
impl RenderTextures
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn ratio(&self) -> f32
pub(crate) fn new(ctx: &WgpuContext, width: u32, height: u32) -> Self
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 !UnwindSafe for RenderTextures
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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