HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Core10.Fence

  • 4 types
  • 7 values
  • Packagevulkan-3.27
  • Exports12
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceFence.hs
valuecreateFence
  1. :: (Extendss FenceCreateInfo a, PokeChain a, MonadIO io)
  2. => Device

    device is the logical device that creates the fence.

  3. -> FenceCreateInfo a

    pCreateInfo is a pointer to a FenceCreateInfo structure containing information about how the fence is to be created.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io Fence
#

vkCreateFence - Create a new fence object

Valid Usage (Implicit)

  • device must be a valid Device handle

  • pCreateInfo must be a valid pointer to a valid FenceCreateInfo structure

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

  • pFence must be a valid pointer to a Fence handle

  • The device must have been created with at least 1 queue

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, Fence, FenceCreateInfo

valuedestroyFence
  1. :: MonadIO io
  2. => Device

    device is the logical device that destroys the fence.

  3. -> Fence

    fence is the handle of the fence to destroy.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io ()
#

vkDestroyFence - Destroy a fence object

Valid Usage

  • All queue submission commands that refer to fence must have completed execution

  • If AllocationCallbacks were provided when fence was created, a compatible set of callbacks must be provided here

  • If no AllocationCallbacks were provided when fence was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid Device handle

  • If fence is not NULL_HANDLE, fence must be a valid Fence handle

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

  • If fence is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to fence must be externally synchronized

See Also

VK_VERSION_1_0, AllocationCallbacks, Device, Fence

valueresetFences
  1. :: MonadIO io
  2. => Device

    device is the logical device that owns the fences.

  3. -> "fences" ::: Vector Fence

    pFences is a pointer to an array of fence handles to reset.

  4. -> io ()
#

vkResetFences - Resets one or more fence objects

Description

If any member of pFences currently has its payload imported with temporary permanence, that fence’s prior permanent payload is first restored. The remaining operations described therefore operate on the restored payload.

When resetFences is executed on the host, it defines a /fence unsignal operation/ for each fence, which resets the fence to the unsignaled state.

If any member of pFences is already in the unsignaled state when resetFences is executed, then resetFences has no effect on that fence.

Valid Usage

  • Each element of pFences must not be currently associated with any queue command that has not yet completed execution on that queue

Valid Usage (Implicit)

  • device must be a valid Device handle

  • pFences must be a valid pointer to an array of fenceCount valid Fence handles

  • fenceCount must be greater than 0

  • Each element of pFences must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to each member of pFences must be externally synchronized

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, Device, Fence

valuegetFenceStatus
  1. :: MonadIO io
  2. => Device

    device is the logical device that owns the fence.

    device must be a valid Device handle

  3. -> Fence

    fence is the handle of the fence to query.

    fence must be a valid Fence handle

    fence must have been created, allocated, or retrieved from device

  4. -> io Result
#

vkGetFenceStatus - Return the status of a fence

Description

Upon success, getFenceStatus returns the status of the fence object, with the following return codes:

Status

Meaning

SUCCESS

The fence specified by

fence

is signaled.

NOT_READY

The fence specified by

fence

is unsignaled.

ERROR_DEVICE_LOST

The device has been lost. See

Lost Device

.

Fence Object Status Codes

If a queue submission command is pending execution, then the value returned by this command may immediately be out of date.

If the device has been lost (see Lost Device), getFenceStatus may return any of the above status codes. If the device has been lost and getFenceStatus is called repeatedly, it will eventually return either SUCCESS or ERROR_DEVICE_LOST.

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, Device, Fence

valuewaitForFences
  1. :: MonadIO io
  2. => Device

    device is the logical device that owns the fences.

  3. -> "fences" ::: Vector Fence

    pFences is a pointer to an array of fenceCount fence handles.

  4. -> "waitAll" ::: Bool

    waitAll is the condition that must be satisfied to successfully unblock the wait. If waitAll is TRUE, then the condition is that all fences in pFences are signaled. Otherwise, the condition is that at least one fence in pFences is signaled.

  5. -> "timeout" ::: Word64

    timeout is the timeout period in units of nanoseconds. timeout is adjusted to the closest value allowed by the implementation-dependent timeout accuracy, which may be substantially longer than one nanosecond, and may be longer than the requested period.

  6. -> io Result
#

vkWaitForFences - Wait for one or more fences to become signaled

Description

If the condition is satisfied when waitForFences is called, then waitForFences returns immediately. If the condition is not satisfied at the time waitForFences is called, then waitForFences will block and wait until the condition is satisfied or the timeout has expired, whichever is sooner.

If timeout is zero, then waitForFences does not wait, but simply returns the current state of the fences. TIMEOUT will be returned in this case if the condition is not satisfied, even though no actual wait was performed.

If the condition is satisfied before the timeout has expired, waitForFences returns SUCCESS. Otherwise, waitForFences returns TIMEOUT after the timeout has expired.

If device loss occurs (see Lost Device) before the timeout has expired, waitForFences must return in finite time with either SUCCESS or ERROR_DEVICE_LOST.

While we guarantee that waitForFences must return in finite time, no guarantees are made that it returns immediately upon device loss. However, the application can reasonably expect that the delay will be on the order of seconds and that calling waitForFences will not result in a permanently (or seemingly permanently) dead process.

Valid Usage (Implicit)

  • device must be a valid Device handle

  • pFences must be a valid pointer to an array of fenceCount valid Fence handles

  • fenceCount must be greater than 0

  • Each element of pFences must have been created, allocated, or retrieved from device

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, Bool32, Device, Fence

valuewaitForFencesSafe
  1. :: MonadIO io
  2. => Device

    device is the logical device that owns the fences.

  3. -> "fences" ::: Vector Fence

    pFences is a pointer to an array of fenceCount fence handles.

  4. -> "waitAll" ::: Bool

    waitAll is the condition that must be satisfied to successfully unblock the wait. If waitAll is TRUE, then the condition is that all fences in pFences are signaled. Otherwise, the condition is that at least one fence in pFences is signaled.

  5. -> "timeout" ::: Word64

    timeout is the timeout period in units of nanoseconds. timeout is adjusted to the closest value allowed by the implementation-dependent timeout accuracy, which may be substantially longer than one nanosecond, and may be longer than the requested period.

  6. -> io Result
#

A variant of waitForFences which makes a *safe* FFI call

datadata FenceCreateInfo (es :: [Type])
#

VkFenceCreateInfo - Structure specifying parameters of a newly created fence

Valid Usage (Implicit)

See Also

VK_VERSION_1_0, FenceCreateFlags, StructureType, createFence

Constructors

Instances5Extensible, Show, FromCStruct, ToCStruct, Zero
newtypenewtype Fence
#
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …
  • Eq FenceDefined in vulkan-3.27 · Vulkan.Core10.Handles
  • Ord FenceDefined in vulkan-3.27 · Vulkan.Core10.Handles
  • Show FenceDefined in vulkan-3.27 · Vulkan.Core10.Handles
  • Storable FenceDefined in vulkan-3.27 · Vulkan.Core10.Handles
  • HasObjectType FenceDefined in vulkan-3.27 · Vulkan.Core10.Handles
  • IsHandle FenceDefined in vulkan-3.27 · Vulkan.Core10.Handles
  • Zero FenceDefined in vulkan-3.27 · Vulkan.Core10.Handles
newtypenewtype FenceCreateFlagBits
#

VkFenceCreateFlagBits - Bitmask specifying initial state and behavior of a fence

Description

  • FENCE_CREATE_SIGNALED_BIT specifies that the fence object is created in the signaled state. Otherwise, it is created in the unsignaled state.

See Also

VK_VERSION_1_0, FenceCreateFlags

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …