Struct re_renderer::ScreenshotProcessor
source · pub struct ScreenshotProcessor { /* private fields */ }Implementations§
source§impl ScreenshotProcessor
impl ScreenshotProcessor
sourcepub const SCREENSHOT_COLOR_FORMAT: TextureFormat = wgpu::TextureFormat::Rgba8Unorm
pub const SCREENSHOT_COLOR_FORMAT: TextureFormat = wgpu::TextureFormat::Rgba8Unorm
The texture format used for screenshots.
pub fn new<T: 'static + Send + Sync>( ctx: &RenderContext, view_name: &DebugLabel, resolution: UVec2, readback_identifier: GpuReadbackIdentifier, readback_user_data: T ) -> Self
pub fn begin_render_pass<'a>( &'a self, view_name: &DebugLabel, encoder: &'a mut CommandEncoder ) -> RenderPass<'a>
pub fn end_render_pass( self, encoder: &mut CommandEncoder ) -> Result<(), GpuReadbackError>
sourcepub fn next_readback_result<T: 'static + Send + Sync>(
ctx: &RenderContext,
identifier: GpuReadbackIdentifier,
on_screenshot: impl FnOnce(&[u8], UVec2, T)
) -> Option<()>
pub fn next_readback_result<T: 'static + Send + Sync>( ctx: &RenderContext, identifier: GpuReadbackIdentifier, on_screenshot: impl FnOnce(&[u8], UVec2, T) ) -> Option<()>
Returns the oldest received screenshot results for a given identifier and user data type.
It is recommended to call this method repeatedly until it returns None to ensure that all
pending data is flushed.
Ready data that hasn’t been retrieved for more than a frame will be discarded.
See also crate::view_builder::ViewBuilder::schedule_screenshot
Auto Trait Implementations§
impl !RefUnwindSafe for ScreenshotProcessor
impl Send for ScreenshotProcessor
impl Sync for ScreenshotProcessor
impl Unpin for ScreenshotProcessor
impl !UnwindSafe for ScreenshotProcessor
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