Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- createQueryPool :: PokeChain a => Device -> QueryPoolCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> IO QueryPool
- withQueryPool :: PokeChain a => Device -> QueryPoolCreateInfo a -> Maybe AllocationCallbacks -> (QueryPool -> IO r) -> IO r
- destroyQueryPool :: Device -> QueryPool -> ("allocator" ::: Maybe AllocationCallbacks) -> IO ()
- getQueryPoolResults :: Device -> QueryPool -> ("firstQuery" ::: Word32) -> ("queryCount" ::: Word32) -> ("dataSize" ::: Word64) -> ("data" ::: Ptr ()) -> ("stride" ::: DeviceSize) -> QueryResultFlags -> IO Result
- data QueryPoolCreateInfo (es :: [Type]) = QueryPoolCreateInfo {}
Documentation
createQueryPool :: PokeChain a => Device -> QueryPoolCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> IO QueryPool Source #
vkCreateQueryPool - Create a new query pool object
Parameters
Device
is the logical device that creates the query pool.
pCreateInfo
is a pointer to aQueryPoolCreateInfo
structure containing the number and type of queries to be managed by the pool.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.pQueryPool
is a pointer to aQueryPool
handle in which the resulting query pool object is returned.
Valid Usage (Implicit)
pCreateInfo
must be a valid pointer to a validQueryPoolCreateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure pQueryPool
must be a valid pointer to aQueryPool
handle
Return Codes
See Also
withQueryPool :: PokeChain a => Device -> QueryPoolCreateInfo a -> Maybe AllocationCallbacks -> (QueryPool -> IO r) -> IO r Source #
A safe wrapper for createQueryPool
and destroyQueryPool
using
bracket
The allocated value must not be returned from the provided computation
destroyQueryPool :: Device -> QueryPool -> ("allocator" ::: Maybe AllocationCallbacks) -> IO () Source #
vkDestroyQueryPool - Destroy a query pool object
Parameters
Device
is the logical device that destroys the query pool.
QueryPool
is the query pool to destroy.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Valid Usage
- All submitted commands that refer to
QueryPool
must have completed execution
- If
AllocationCallbacks
were provided whenQueryPool
was created, a compatible set of callbacks must be provided here - If no
AllocationCallbacks
were provided whenQueryPool
was created,pAllocator
must beNULL
Valid Usage (Implicit)
- If
QueryPool
is notNULL_HANDLE
,QueryPool
must be a validQueryPool
handle - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure - If
QueryPool
is a valid handle, it must have been created, allocated, or retrieved fromDevice
Host Synchronization
- Host access to
QueryPool
must be externally synchronized
See Also
getQueryPoolResults :: Device -> QueryPool -> ("firstQuery" ::: Word32) -> ("queryCount" ::: Word32) -> ("dataSize" ::: Word64) -> ("data" ::: Ptr ()) -> ("stride" ::: DeviceSize) -> QueryResultFlags -> IO Result Source #
vkGetQueryPoolResults - Copy results of queries in a query pool to a host memory region
Parameters
Device
is the logical device that owns the query pool.
QueryPool
is the query pool managing the queries containing the desired results.firstQuery
is the initial query index.queryCount
is the number of queries to read.dataSize
is the size in bytes of the buffer pointed to bypData
.pData
is a pointer to a user-allocated buffer where the results will be writtenstride
is the stride in bytes between results for individual queries withinpData
.Flags
is a bitmask ofQueryResultFlagBits
specifying how and when results are returned.
Description
The range of queries read is defined by [firstQuery
, firstQuery
+
queryCount
- 1]. For pipeline statistics queries, each query index in
the pool contains one integer value for each bit that is enabled in
QueryPoolCreateInfo
::pipelineStatistics
when the pool is created.
If no bits are set in Flags
, and all
requested queries are in the available state, results are written as an
array of 32-bit unsigned integer values. The behavior when not all
queries are available, is described
below.
If
QUERY_RESULT_64_BIT
is not set and the result overflows a 32-bit value, the value may
either wrap or saturate. Similarly, if
QUERY_RESULT_64_BIT
is set and the result overflows a 64-bit value, the value may either
wrap or saturate.
If
QUERY_RESULT_WAIT_BIT
is set, Vulkan will wait for each query to be in the available state
before retrieving the numerical results for that query. In this case,
getQueryPoolResults
is guaranteed to succeed and return
SUCCESS
if the queries become
available in a finite time (i.e. if they have been issued and not
reset). If queries will never finish (e.g. due to being reset but not
issued), then getQueryPoolResults
may not return in finite time.
If
QUERY_RESULT_WAIT_BIT
and
QUERY_RESULT_PARTIAL_BIT
are both not set then no result values are written to pData
for
queries that are in the unavailable state at the time of the call, and
getQueryPoolResults
returns
NOT_READY
. However, availability
state is still written to pData
for those queries if
QUERY_RESULT_WITH_AVAILABILITY_BIT
is set.
Note
Applications must take care to ensure that use of the
QUERY_RESULT_WAIT_BIT
bit has the desired effect.
For example, if a query has been used previously and a command buffer
records the commands
cmdResetQueryPool
,
cmdBeginQuery
, and
cmdEndQuery
for that
query, then the query will remain in the available state until
resetQueryPool
is called or the
cmdResetQueryPool
command
executes on a queue. Applications can use fences or events to ensure
that a query has already been reset before checking for its results or
availability status. Otherwise, a stale value could be returned from a
previous use of the query.
The above also applies when
QUERY_RESULT_WAIT_BIT
is used in combination with
QUERY_RESULT_WITH_AVAILABILITY_BIT
.
In this case, the returned availability status may reflect the result
of a previous use of the query unless
resetQueryPool
is called or the
cmdResetQueryPool
command
has been executed since the last use of the query.
Note
Applications can double-buffer query pool usage, with a pool per frame, and reset queries at the end of the frame in which they are read.
If
QUERY_RESULT_PARTIAL_BIT
is set,
QUERY_RESULT_WAIT_BIT
is not set, and the query’s status is unavailable, an intermediate
result value between zero and the final result value is written to
pData
for that query.
If
QUERY_RESULT_WITH_AVAILABILITY_BIT
is set, the final integer value written for each query is non-zero if
the query’s status was available or zero if the status was unavailable.
When
QUERY_RESULT_WITH_AVAILABILITY_BIT
is used, implementations must guarantee that if they return a non-zero
availability value then the numerical results must be valid, assuming
the results are not reset by a subsequent command.
Note
Satisfying this guarantee may require careful ordering by the application, e.g. to read the availability status before reading the results.
Valid Usage
firstQuery
must be less than the number of queries inQueryPool
- If
QUERY_RESULT_64_BIT
is not set inFlags
, thenpData
andstride
must be multiples of4
- If
QUERY_RESULT_64_BIT
is not set inFlags
and theQueryType
used to createQueryPool
was notQUERY_TYPE_PERFORMANCE_QUERY_KHR
, thenpData
andstride
must be multiples of4
- If
QUERY_RESULT_64_BIT
is set inFlags
thenpData
andstride
must be multiples of8
- If the
QueryType
used to createQueryPool
wasQUERY_TYPE_PERFORMANCE_QUERY_KHR
, thenpData
andstride
must be multiples of the size ofPerformanceCounterResultKHR
- The sum of
firstQuery
andqueryCount
must be less than or equal to the number of queries inQueryPool
dataSize
must be large enough to contain the result of each query, as described here- If the
QueryType
used to createQueryPool
wasQUERY_TYPE_TIMESTAMP
,Flags
must not containQUERY_RESULT_PARTIAL_BIT
- If the
QueryType
used to createQueryPool
wasQUERY_TYPE_PERFORMANCE_QUERY_KHR
,Flags
must not containQUERY_RESULT_WITH_AVAILABILITY_BIT
,QUERY_RESULT_PARTIAL_BIT
orQUERY_RESULT_64_BIT
- If the
QueryType
used to createQueryPool
wasQUERY_TYPE_PERFORMANCE_QUERY_KHR
, theQueryPool
must have been recorded once for each pass as retrieved via a call togetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR
Valid Usage (Implicit)
QueryPool
must be a validQueryPool
handlepData
must be a valid pointer to an array ofdataSize
bytesFlags
must be a valid combination ofQueryResultFlagBits
valuesdataSize
must be greater than0
QueryPool
must have been created, allocated, or retrieved fromDevice
Return Codes
See Also
data QueryPoolCreateInfo (es :: [Type]) Source #
VkQueryPoolCreateInfo - Structure specifying parameters of a newly created query pool
Description
pipelineStatistics
is ignored if
QueryType
is not
QUERY_TYPE_PIPELINE_STATISTICS
.
Valid Usage
- If the
pipeline statistics queries
feature is not enabled,
QueryType
must not beQUERY_TYPE_PIPELINE_STATISTICS
- If
QueryType
isQUERY_TYPE_PIPELINE_STATISTICS
,pipelineStatistics
must be a valid combination ofQueryPipelineStatisticFlagBits
values - If
QueryType
isQUERY_TYPE_PERFORMANCE_QUERY_KHR
, thepNext
chain must include a structure of typeQueryPoolPerformanceCreateInfoKHR
queryCount
must be greater than 0
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
- Each
pNext
member of any structure (including this one) in thepNext
chain must be eitherNULL
or a pointer to a valid instance ofQueryPoolCreateInfoINTEL
orQueryPoolPerformanceCreateInfoKHR
- The
sType
value of each struct in thepNext
chain must be unique Flags
must be0
QueryType
must be a validQueryType
value
See Also
QueryPipelineStatisticFlags
,
QueryPoolCreateFlags
,
QueryType
,
StructureType
,
createQueryPool
QueryPoolCreateInfo | |
|