pub struct AcquiredFrameHandle { /* private fields */ }Expand description
Owns one native handle.
A rendered frame that the caller holds to read or show.
See mln_acquired_frame in the
C API reference.
Implementations§
Source§impl AcquiredFrameHandle
impl AcquiredFrameHandle
Sourcepub fn discard(self) -> Result<(), ReleaseError<Self>>
pub fn discard(self) -> Result<(), ReleaseError<Self>>
Gives up an acquired frame without saying when your GPU stops reading it.
Because your GPU may still read the frame’s texture, the session never renders into that texture again.
See mln_acquired_frame_discard in the
C API reference.
Sourcepub fn get_result(&self) -> Result<RenderFrameResult>
pub fn get_result(&self) -> Result<RenderFrameResult>
Reads the frame result of an acquired frame.
It succeeds until you release or discard the frame, whatever the session’s state.
See mln_acquired_frame_get_result in the
C API reference.
Sourcepub unsafe fn release(
self,
consumer_completion: &GpuSync,
) -> Result<(), ReleaseError<Self>>
pub unsafe fn release( self, consumer_completion: &GpuSync, ) -> Result<(), ReleaseError<Self>>
Gives an acquired frame back to the session once you’re done reading it.
consumer_completion says when your GPU work that reads the texture
finishes. Pass GpuSyncKind::CpuComplete when that work has already
finished. The session waits for that point before it renders into the
texture again. If that wait fails, such as for an OpenGL fence outside
the session’s share group, the session fails.
See mln_acquired_frame_release in the
C API reference.
§Errors
Status::UnsupportedwhenRenderSessionCapabilities::consumer_sync_kindslacks the kind ofconsumer_completion.
§Safety
Native graphics objects must have the types, lifetimes, and synchronization required by the C operation.
Source§impl AcquiredFrameHandle
impl AcquiredFrameHandle
Sourcepub fn view(&self) -> Result<AcquiredFrameView<'_>>
pub fn view(&self) -> Result<AcquiredFrameView<'_>>
Keeps an acquired frame’s texture and sync objects in place while you use them.
See mln_acquired_frame_view_begin in the
C API reference.
§Errors
Status::TargetLostwhen the session failed, or you detached, abandoned, or disposed it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AcquiredFrameHandle
impl RefUnwindSafe for AcquiredFrameHandle
impl Send for AcquiredFrameHandle
impl Sync for AcquiredFrameHandle
impl Unpin for AcquiredFrameHandle
impl UnsafeUnpin for AcquiredFrameHandle
impl UnwindSafe for AcquiredFrameHandle
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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