Struct vulkano::deferred::DeferredOperation
source · pub struct DeferredOperation { /* private fields */ }
Expand description
An operation on the host that has been deferred.
The object cannot be dropped while an operation is pending. If it is dropped prematurely, the current thread will block to wait for the operation to finish.
Implementations§
source§impl DeferredOperation
impl DeferredOperation
sourcepub fn new(device: Arc<Device>) -> Result<Arc<Self>, Validated<VulkanError>>
pub fn new(device: Arc<Device>) -> Result<Arc<Self>, Validated<VulkanError>>
Creates a new DeferredOperation
.
The khr_deferred_host_operations
extension must be enabled on the device.
sourcepub unsafe fn from_handle(
device: Arc<Device>,
handle: DeferredOperationKHR
) -> Arc<Self>
pub unsafe fn from_handle( device: Arc<Device>, handle: DeferredOperationKHR ) -> Arc<Self>
Creates a new DeferredOperation
from a raw object handle.
Safety
handle
must be a valid Vulkan object handle created fromdevice
.
sourcepub fn join(&self) -> Result<DeferredOperationJoinStatus, VulkanError>
pub fn join(&self) -> Result<DeferredOperationJoinStatus, VulkanError>
Executes a portion of the operation on the current thread.
sourcepub fn result(&self) -> Option<Result<(), VulkanError>>
pub fn result(&self) -> Option<Result<(), VulkanError>>
Returns the result of the operation, or None
if the operation is not yet complete.
sourcepub fn wait(&self) -> Result<Result<(), VulkanError>, VulkanError>
pub fn wait(&self) -> Result<Result<(), VulkanError>, VulkanError>
Waits for the operation to complete, then returns its result.
sourcepub fn max_concurrency(&self) -> Option<u32>
pub fn max_concurrency(&self) -> Option<u32>
The maximum number of threads that could usefully execute the operation at this point in its execution, or zero if the operation is complete.
Returns None
if no exact number of threads can be calculated.