mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 23:05:43 +00:00
Add boxed_send(), boxed_sync(), boxed_send_sync() for GpuFuture (#1802)
This commit is contained in:
parent
d36bba1a2c
commit
be4e5dc678
@ -291,6 +291,36 @@ pub unsafe trait GpuFuture: DeviceOwned {
|
||||
{
|
||||
Box::new(self) as _
|
||||
}
|
||||
|
||||
/// Turn the current future into a `Box<dyn GpuFuture + Send>`.
|
||||
///
|
||||
/// This is a helper function that calls `Box::new(yourFuture) as Box<dyn GpuFuture + Send>`.
|
||||
fn boxed_send(self) -> Box<dyn GpuFuture + Send>
|
||||
where
|
||||
Self: Sized + Send + 'static,
|
||||
{
|
||||
Box::new(self) as _
|
||||
}
|
||||
|
||||
/// Turn the current future into a `Box<dyn GpuFuture + Sync>`.
|
||||
///
|
||||
/// This is a helper function that calls `Box::new(yourFuture) as Box<dyn GpuFuture + Sync>`.
|
||||
fn boxed_sync(self) -> Box<dyn GpuFuture + Sync>
|
||||
where
|
||||
Self: Sized + Sync + 'static,
|
||||
{
|
||||
Box::new(self) as _
|
||||
}
|
||||
|
||||
/// Turn the current future into a `Box<dyn GpuFuture + Send + Sync>`.
|
||||
///
|
||||
/// This is a helper function that calls `Box::new(yourFuture) as Box<dyn GpuFuture + Send + Sync>`.
|
||||
fn boxed_send_sync(self) -> Box<dyn GpuFuture + Send + Sync>
|
||||
where
|
||||
Self: Sized + Send + Sync + 'static,
|
||||
{
|
||||
Box::new(self) as _
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<F: ?Sized> GpuFuture for Box<F>
|
||||
|
Loading…
Reference in New Issue
Block a user