pub struct Flight { /* private fields */ }
Implementations§
Source§impl Flight
impl Flight
Sourcepub fn frame_count(&self) -> u32
pub fn frame_count(&self) -> u32
Returns the number of [frames] in this [flight].
Sourcepub fn current_frame(&self) -> u64
pub fn current_frame(&self) -> u64
Returns the current frame counter value. This always starts out at 0 and is monotonically increasing with each passing [frame].
Sourcepub fn current_frame_index(&self) -> u32
pub fn current_frame_index(&self) -> u32
Returns the index of the current [frame] in [flight].
Sourcepub fn wait(&self, timeout: Option<Duration>) -> Result<(), VulkanError>
pub fn wait(&self, timeout: Option<Duration>) -> Result<(), VulkanError>
Waits for the oldest [frame] in [flight] to finish.
Sourcepub fn wait_for_frame(
&self,
frame: u64,
timeout: Option<Duration>,
) -> Result<(), VulkanError>
pub fn wait_for_frame( &self, frame: u64, timeout: Option<Duration>, ) -> Result<(), VulkanError>
Waits for the given [frame] to finish. frame
must have been previously obtained using
current_frame
on self
.
§Panics
- Panics if
frame
is greater than the current frame.
Sourcepub fn destroy_object(&self, object: Arc<impl Any + Send + Sync>)
pub fn destroy_object(&self, object: Arc<impl Any + Send + Sync>)
Queues the destruction of the given object
after the destruction of the command buffer(s)
for the previous [frame] in [flight].
§Panics
- Panics if called from multiple threads at the same time.
- Panics if the flight is currently being executed.
Sourcepub fn destroy_objects(
&self,
objects: impl IntoIterator<Item = Arc<impl Any + Send + Sync>>,
)
pub fn destroy_objects( &self, objects: impl IntoIterator<Item = Arc<impl Any + Send + Sync>>, )
Queues the destruction of the given objects
after the destruction of the command
buffer(s) for the previous [frame] in [flight].
§Panics
- Panics if called from multiple threads at the same time.
- Panics if the flight is currently being executed.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Flight
impl !RefUnwindSafe for Flight
impl Send for Flight
impl Sync for Flight
impl Unpin for Flight
impl !UnwindSafe for Flight
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