Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- createFence :: PokeChain a => Device -> FenceCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> IO Fence
- withFence :: PokeChain a => Device -> FenceCreateInfo a -> Maybe AllocationCallbacks -> (Fence -> IO r) -> IO r
- destroyFence :: Device -> Fence -> ("allocator" ::: Maybe AllocationCallbacks) -> IO ()
- resetFences :: Device -> ("fences" ::: Vector Fence) -> IO ()
- getFenceStatus :: Device -> Fence -> IO Result
- waitForFences :: Device -> ("fences" ::: Vector Fence) -> ("waitAll" ::: Bool) -> ("timeout" ::: Word64) -> IO Result
- data FenceCreateInfo (es :: [Type]) = FenceCreateInfo {
- next :: Chain es
- flags :: FenceCreateFlags
Documentation
createFence :: PokeChain a => Device -> FenceCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> IO Fence Source #
vkCreateFence - Create a new fence object
Parameters
Device
is the logical device that creates the fence.
pCreateInfo
is a pointer to aFenceCreateInfo
structure containing information about how the fence is to be created.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.pFence
is a pointer to a handle in which the resulting fence object is returned.
Valid Usage (Implicit)
pCreateInfo
must be a valid pointer to a validFenceCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure pFence
must be a valid pointer to aFence
handle
Return Codes
See Also
withFence :: PokeChain a => Device -> FenceCreateInfo a -> Maybe AllocationCallbacks -> (Fence -> IO r) -> IO r Source #
A safe wrapper for createFence
and destroyFence
using bracket
The allocated value must not be returned from the provided computation
destroyFence :: Device -> Fence -> ("allocator" ::: Maybe AllocationCallbacks) -> IO () Source #
vkDestroyFence - Destroy a fence object
Parameters
Device
is the logical device that destroys the fence.
Fence
is the handle of the fence to destroy.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Valid Usage
- All
queue submission
commands that refer to
Fence
must have completed execution
- If
AllocationCallbacks
were provided whenFence
was created, a compatible set of callbacks must be provided here - If no
AllocationCallbacks
were provided whenFence
was created,pAllocator
must beNULL
Valid Usage (Implicit)
- If
Fence
is notNULL_HANDLE
,Fence
must be a validFence
handle - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure - If
Fence
is a valid handle, it must have been created, allocated, or retrieved fromDevice
Host Synchronization
- Host access to
Fence
must be externally synchronized
See Also
resetFences :: Device -> ("fences" ::: Vector Fence) -> IO () Source #
vkResetFences - Resets one or more fence objects
Parameters
Device
is the logical device that owns the fences.
fenceCount
is the number of fences to reset.pFences
is a pointer to an array of fence handles to reset.
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)
pFences
must be a valid pointer to an array offenceCount
validFence
handlesfenceCount
must be greater than0
- Each element of
pFences
must have been created, allocated, or retrieved fromDevice
Host Synchronization
- Host access to each member of
pFences
must be externally synchronized
Return Codes
See Also
getFenceStatus :: Device -> Fence -> IO Result Source #
vkGetFenceStatus - Return the status of a fence
Parameters
Device
is the logical device that owns the fence.
Fence
is the handle of the fence to query.
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
See Also
waitForFences :: Device -> ("fences" ::: Vector Fence) -> ("waitAll" ::: Bool) -> ("timeout" ::: Word64) -> IO Result Source #
vkWaitForFences - Wait for one or more fences to become signaled
Parameters
Device
is the logical device that owns the fences.
fenceCount
is the number of fences to wait on.pFences
is a pointer to an array offenceCount
fence handles.waitAll
is the condition that must be satisfied to successfully unblock the wait. IfwaitAll
isTRUE
, then the condition is that all fences inpFences
are signaled. Otherwise, the condition is that at least one fence inpFences
is signaled.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.
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 up to timeout
nanoseconds for the condition to become
satisfied.
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 specified timeout period expires before the condition is
satisfied, waitForFences
returns
TIMEOUT
. If the condition is
satisfied before timeout
nanoseconds has expired, waitForFences
returns SUCCESS
.
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
.
Note
While we guarantee that waitForFences
must return in finite time, no
guarantees are made that it returns immediately upon device loss.
However, the client 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)
pFences
must be a valid pointer to an array offenceCount
validFence
handlesfenceCount
must be greater than0
- Each element of
pFences
must have been created, allocated, or retrieved fromDevice
Return Codes
See Also
data FenceCreateInfo (es :: [Type]) Source #
VkFenceCreateInfo - Structure specifying parameters of a newly created fence
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_FENCE_CREATE_INFO
- Each
pNext
member of any structure (including this one) in thepNext
chain must be eitherNULL
or a pointer to a valid instance ofExportFenceCreateInfo
orExportFenceWin32HandleInfoKHR
- The
sType
value of each struct in thepNext
chain must be unique Flags
must be a valid combination ofFenceCreateFlagBits
values
See Also
FenceCreateInfo | |
|