VPP  0.7
A high-level modern C++ API for Vulkan
Public Member Functions | List of all members
vpp::Event Class Reference

Allows the GPU to wait for certain condition on CPU or GPU side to occur. More...

#include <vppSynchronization.hpp>

Public Member Functions

 Event (const Device &hDevice)
 Constructs null reference.
 
VkEvent handle () const
 Retrieves the Vulkan handle.
 
const Devicedevice () const
 Retrieves the device.
 
void signal (bool bSignal)
 Sets the signaled or unsignaled state of the event.
 
bool isSignaled () const
 Checks whether the event is signaled.
 
void cmdSignal (bool bSignal, VkPipelineStageFlags stageMask, CommandBuffer hCommandBuffer=CommandBuffer())
 Generates a command to set signaled or unsignaled event state. More...
 
void cmdWait (VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, CommandBuffer hCommandBuffer=CommandBuffer())
 Generates a command to wait for signaled event state. More...
 
void cmdWait (VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, const Barriers &barriers, CommandBuffer hCommandBuffer=CommandBuffer())
 Generates a command to wait for signaled event state. More...
 

Detailed Description

Allows the GPU to wait for certain condition on CPU or GPU side to occur.

This object is reference-counted and may be passed by value.

Member Function Documentation

◆ cmdSignal()

void vpp::Event::cmdSignal ( bool  bSignal,
VkPipelineStageFlags  stageMask,
CommandBuffer  hCommandBuffer = CommandBuffer() 
)

Generates a command to set signaled or unsignaled event state.

This command sets the state of the event during GPU execution. The state change is being performed during the pipeline stage specified by the stageMask parameter.

The command will be generated into specified command buffer, or the default command buffer if omitted.

◆ cmdWait() [1/2]

void vpp::Event::cmdWait ( VkPipelineStageFlags  srcStageMask,
VkPipelineStageFlags  dstStageMask,
CommandBuffer  hCommandBuffer = CommandBuffer() 
)

Generates a command to wait for signaled event state.

This command instructs GPU to wait until the state of the event becomes signaled.

The srcStageMask parameter specifies the pipeline stages in which an event state change might occur, to be taken into account. This corresponds to the stageMask parameter in cmdSignal() method. In case of events triggered on CPU side, use VK_PIPELINE_STAGE_HOST_BIT stage flag.

The dstStageMask parameter specifies the pipeline stage in which the wait operation shall occur (the stage will be executed after the event is signaled).

The wait and corresponding signal operations should be issued on the same queue within the device.

The command will be generated into specified command buffer, or the default command buffer if omitted.

◆ cmdWait() [2/2]

void vpp::Event::cmdWait ( VkPipelineStageFlags  srcStageMask,
VkPipelineStageFlags  dstStageMask,
const Barriers &  barriers,
CommandBuffer  hCommandBuffer = CommandBuffer() 
)

Generates a command to wait for signaled event state.

This command instructs GPU to wait until the state of the event becomes signaled and produced resources are ready for further processing.

For the second goal, it defines a pipeline barrier. That means two things:

  • Besides waiting for the event, it synchronizes two pipeline stages. It guarantees that data produced by the source stage are available when executing the destination stage.
  • You can specify one or more resources to wait for, using the Barriers class.

The wait and corresponding signal operations should be issued on the same queue within the device.

The command will be generated into specified command buffer, or the default command buffer if omitted.


The documentation for this class was generated from the following file: