=== Alternate Methods to Signal Fences

Besides submitting a fence to a queue as part of a
<<devsandqueues-submission, queue submission>> command, a fence may: also be
signaled when a particular event occurs on a device or display.

// refBegin vkRegisterDeviceEventEXT Signal a fence when a device event occurs

To create a fence that will be signaled when an event occurs on a device,
call:

include::../../api/protos/vkRegisterDeviceEventEXT.txt[]

  * pname:device is a logical device on which the event may: occur.
  * pname:pDeviceEventInfo is a pointer to an instance of the
    slink:VkDeviceEventInfoEXT structure describing the event of interest to
    the application.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.
  * pname:pFence points to a handle in which the resulting fence object is
    returned.

include::../../validity/protos/vkRegisterDeviceEventEXT.txt[]

// refBegin VkDeviceEventInfoEXT Describe a device event to create

The sname:VkDeviceEventInfoEXT structure is defined as:

include::../../api/structs/VkDeviceEventInfoEXT.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to an extension-specific structure.
  * pname:device specifies when the fence will be signaled.
    Possible values are:
+
--
// refBegin VkDeviceEventTypeEXT Events that can occur on a device object
include::../../api/enums/VkDeviceEventTypeEXT.txt[]

  ** ename:VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT occurs when a display is
     plugged into or unplugged from the specified device.
     Applications can: use this notification to determine when they need to
     re-enumerate the available displays on a device.
--

include::../../validity/structs/VkDeviceEventInfoEXT.txt[]

// refBegin vkRegisterDisplayEventEXT Signal a fence when a display event occurs

To create a fence that will be signaled when an event occurs on a
VkDisplayKHR object, call:

include::../../api/protos/vkRegisterDisplayEventEXT.txt[]

  * pname:device is a logical device associated with pname:display
  * pname:display is the display on which the event may: occur.
  * pname:pDisplayEventInfo is a pointer to an instance of the
    slink:VkDisplayEventInfoEXT structure describing the event of interest
    to the application.
  * pname:pAllocator controls host memory allocation as described in the
    <<memory-allocation, Memory Allocation>> chapter.
  * pname:pFence points to a handle in which the resulting fence object is
    returned.

include::../../validity/protos/vkRegisterDisplayEventEXT.txt[]

// refBegin VkDisplayEventInfoEXT Describe a display event to create

The sname:VkDisplayEventInfoEXT structure is defined as:

include::../../api/structs/VkDisplayEventInfoEXT.txt[]

  * pname:sType is the type of this structure.
  * pname:pNext is `NULL` or a pointer to an extension-specific structure.
  * pname:displayEvent specifies when the fence will be signaled.
    Possible values are:
+
--
// refBegin VkDisplayEventTypeEXT Events that can occur on a display object
include::../../api/enums/VkDisplayEventTypeEXT.txt[]

  ** ename:VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT occurs when the first
     pixel of the next display refresh cycle leaves the display engine for
     the display.
--

include::../../validity/structs/VkDisplayEventInfoEXT.txt[]
