pub struct Event { /* private fields */ }
Expand description
Used to block the GPU execution until an event on the CPU occurs.
Note that Vulkan implementations may have limits on how long a command buffer will wait for an event to be signaled, in order to avoid interfering with progress of other clients of the GPU. If the event isn’t signaled within these limits, results are undefined and may include device loss.
Implementations
sourceimpl Event
impl Event
sourcepub fn new(
device: Arc<Device>,
_create_info: EventCreateInfo
) -> Result<Event, EventError>
pub fn new(
device: Arc<Device>,
_create_info: EventCreateInfo
) -> Result<Event, EventError>
Creates a new Event
.
On portability subset
devices, the
events
feature must be enabled on the device.
sourcepub fn from_pool(device: Arc<Device>) -> Result<Event, EventError>
pub fn from_pool(device: Arc<Device>) -> Result<Event, EventError>
Takes an event from the vulkano-provided event pool.
If the pool is empty, a new event will be allocated.
Upon drop
, the event is put back into the pool.
For most applications, using the event pool should be preferred, in order to avoid creating new events every frame.
sourcepub unsafe fn from_handle(
device: Arc<Device>,
handle: Event,
_create_info: EventCreateInfo
) -> Event
pub unsafe fn from_handle(
device: Arc<Device>,
handle: Event,
_create_info: EventCreateInfo
) -> Event
Creates a new Event
from a raw object handle.
Safety
handle
must be a valid Vulkan object handle created fromdevice
.create_info
must match the info used to create the object.