Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- createFence :: forall a io. (Extendss FenceCreateInfo a, PokeChain a, MonadIO io) => Device -> FenceCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io Fence
- withFence :: forall a io r. (Extendss FenceCreateInfo a, PokeChain a, MonadIO io) => Device -> FenceCreateInfo a -> Maybe AllocationCallbacks -> (io Fence -> (Fence -> io ()) -> r) -> r
- destroyFence :: forall io. MonadIO io => Device -> Fence -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- resetFences :: forall io. MonadIO io => Device -> ("fences" ::: Vector Fence) -> io ()
- getFenceStatus :: forall io. MonadIO io => Device -> Fence -> io Result
- waitForFences :: forall io. MonadIO io => Device -> ("fences" ::: Vector Fence) -> ("waitAll" ::: Bool) -> ("timeout" ::: Word64) -> io Result
- waitForFencesSafe :: forall io. MonadIO io => Device -> ("fences" ::: Vector Fence) -> ("waitAll" ::: Bool) -> ("timeout" ::: Word64) -> io Result
- data FenceCreateInfo (es :: [Type]) = FenceCreateInfo {
- next :: Chain es
- flags :: FenceCreateFlags
- newtype Fence = Fence Word64
- newtype FenceCreateFlagBits where
- type FenceCreateFlags = FenceCreateFlagBits
Documentation
:: forall a io. (Extendss FenceCreateInfo a, PokeChain a, MonadIO io) | |
=> Device |
|
-> FenceCreateInfo a |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> io Fence |
vkCreateFence - Create a new fence object
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
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
VK_VERSION_1_0,
AllocationCallbacks
,
Device
, Fence
,
FenceCreateInfo
withFence :: forall a io r. (Extendss FenceCreateInfo a, PokeChain a, MonadIO io) => Device -> FenceCreateInfo a -> Maybe AllocationCallbacks -> (io Fence -> (Fence -> io ()) -> r) -> r Source #
A convenience wrapper to make a compatible pair of calls to
createFence
and destroyFence
To ensure that destroyFence
is always called: pass
bracket
(or the allocate function from your
favourite resource management library) as the last argument.
To just extract the pair pass (,)
as the last argument.
:: forall io. MonadIO io | |
=> Device |
|
-> Fence |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> io () |
vkDestroyFence - Destroy a fence object
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)
-
device
must be a validDevice
handle
- 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
:: forall io. MonadIO io | |
=> Device |
|
-> ("fences" ::: Vector Fence) |
|
-> 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 validDevice
handle
-
pFences
must be a valid pointer to an array offenceCount
validFence
handles -
fenceCount
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
:: forall io. MonadIO io | |
=> Device |
|
-> Fence |
|
-> 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
See Also
:: forall io. MonadIO io | |
=> Device |
|
-> ("fences" ::: Vector Fence) |
|
-> ("waitAll" ::: Bool) |
|
-> ("timeout" ::: Word64) |
|
-> 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
.
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)
-
device
must be a validDevice
handle
-
pFences
must be a valid pointer to an array offenceCount
validFence
handles -
fenceCount
must be greater than0
- Each element of
pFences
must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
:: forall io. MonadIO io | |
=> Device |
|
-> ("fences" ::: Vector Fence) |
|
-> ("waitAll" ::: Bool) |
|
-> ("timeout" ::: Word64) |
|
-> io Result |
A variant of waitForFences
which makes a *safe* FFI call
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
VK_VERSION_1_0,
FenceCreateFlags
,
StructureType
, createFence
FenceCreateInfo | |
|
Instances
VkFence - Opaque handle to a fence object
See Also
VK_VERSION_1_0,
AcquireNextImageInfoKHR
,
FenceGetFdInfoKHR
,
FenceGetWin32HandleInfoKHR
,
ImportFenceFdInfoKHR
,
ImportFenceWin32HandleInfoKHR
,
SwapchainPresentFenceInfoEXT
,
acquireNextImageKHR
,
createFence
, destroyFence
,
getFenceStatus
,
queueBindSparse
,
queueSubmit
,
queueSubmit2
,
queueSubmit2KHR
,
registerDeviceEventEXT
,
registerDisplayEventEXT
,
resetFences
, waitForFences
Instances
Storable Fence Source # | |
Show Fence Source # | |
Eq Fence Source # | |
Ord Fence Source # | |
HasObjectType Fence Source # | |
Defined in Vulkan.Core10.Handles objectTypeAndHandle :: Fence -> (ObjectType, Word64) Source # | |
IsHandle Fence Source # | |
Defined in Vulkan.Core10.Handles | |
Zero Fence Source # | |
Defined in Vulkan.Core10.Handles |
newtype FenceCreateFlagBits Source #
VkFenceCreateFlagBits - Bitmask specifying initial state and behavior of a fence
See Also
pattern FENCE_CREATE_SIGNALED_BIT :: FenceCreateFlagBits |
|