| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Core10.Query
- newtype VkQueryType = VkQueryType Int32
- pattern VK_QUERY_TYPE_OCCLUSION :: VkQueryType
- pattern VK_QUERY_TYPE_PIPELINE_STATISTICS :: VkQueryType
- pattern VK_QUERY_TYPE_TIMESTAMP :: VkQueryType
- newtype VkQueryPoolCreateFlags = VkQueryPoolCreateFlags VkFlags
- newtype VkQueryResultFlagBits = VkQueryResultFlagBits VkFlags
- pattern VK_QUERY_RESULT_64_BIT :: VkQueryResultFlagBits
- pattern VK_QUERY_RESULT_WAIT_BIT :: VkQueryResultFlagBits
- pattern VK_QUERY_RESULT_WITH_AVAILABILITY_BIT :: VkQueryResultFlagBits
- pattern VK_QUERY_RESULT_PARTIAL_BIT :: VkQueryResultFlagBits
- newtype VkQueryPipelineStatisticFlagBits = VkQueryPipelineStatisticFlagBits VkFlags
- pattern VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits
- pattern VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits
- type VkQueryPool = Ptr VkQueryPool_T
- vkCreateQueryPool :: ("device" ::: VkDevice) -> ("pCreateInfo" ::: Ptr VkQueryPoolCreateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pQueryPool" ::: Ptr VkQueryPool) -> IO VkResult
- vkDestroyQueryPool :: ("device" ::: VkDevice) -> ("queryPool" ::: VkQueryPool) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO ()
- vkGetQueryPoolResults :: ("device" ::: VkDevice) -> ("queryPool" ::: VkQueryPool) -> ("firstQuery" ::: Word32) -> ("queryCount" ::: Word32) -> ("dataSize" ::: CSize) -> ("pData" ::: Ptr ()) -> ("stride" ::: VkDeviceSize) -> ("flags" ::: VkQueryResultFlags) -> IO VkResult
- data VkQueryPoolCreateInfo = VkQueryPoolCreateInfo {}
- type VkQueryResultFlags = VkQueryResultFlagBits
- type VkQueryPipelineStatisticFlags = VkQueryPipelineStatisticFlagBits
Documentation
pattern VK_QUERY_TYPE_OCCLUSION :: VkQueryType Source #
VK_QUERY_TYPE_OCCLUSION specifies an
occlusion query.
pattern VK_QUERY_TYPE_PIPELINE_STATISTICS :: VkQueryType Source #
VK_QUERY_TYPE_PIPELINE_STATISTICS specifies a
pipeline statistics query.
pattern VK_QUERY_TYPE_TIMESTAMP :: VkQueryType Source #
VK_QUERY_TYPE_TIMESTAMP specifies a
timestamp query.
newtype VkQueryPoolCreateFlags Source #
VkQueryPoolCreateFlags - Reserved for future use
Description
VkQueryPoolCreateFlags is a bitmask type for setting a mask, but is
currently reserved for future use.
See Also
Constructors
| VkQueryPoolCreateFlags VkFlags |
newtype VkQueryResultFlagBits Source #
VkQueryResultFlagBits - Bitmask specifying how and when query results are returned
See Also
Constructors
| VkQueryResultFlagBits VkFlags |
pattern VK_QUERY_RESULT_64_BIT :: VkQueryResultFlagBits Source #
VK_QUERY_RESULT_64_BIT specifies the results will be written as an
array of 64-bit unsigned integer values. If this bit is not set, the
results will be written as an array of 32-bit unsigned integer values.
pattern VK_QUERY_RESULT_WAIT_BIT :: VkQueryResultFlagBits Source #
VK_QUERY_RESULT_WAIT_BIT specifies that Vulkan will wait for each
query’s status to become available before retrieving its results.
pattern VK_QUERY_RESULT_WITH_AVAILABILITY_BIT :: VkQueryResultFlagBits Source #
VK_QUERY_RESULT_WITH_AVAILABILITY_BIT specifies that the availability
status accompanies the results.
pattern VK_QUERY_RESULT_PARTIAL_BIT :: VkQueryResultFlagBits Source #
VK_QUERY_RESULT_PARTIAL_BIT specifies that returning partial results
is acceptable.
newtype VkQueryPipelineStatisticFlagBits Source #
VkQueryPipelineStatisticFlagBits - Bitmask specifying queried pipeline statistics
Description
VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BITspecifies that queries managed by the pool will count the number of vertices processed by the input assembly stage. Vertices corresponding to incomplete primitives may contribute to the count.
VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BITspecifies that queries managed by the pool will count the number of primitives processed by the input assembly stage. If primitive restart is enabled, restarting the primitive topology has no effect on the count. Incomplete primitives may be counted.VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BITspecifies that queries managed by the pool will count the number of vertex shader invocations. This counter’s value is incremented each time a vertex shader is invoked.VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BITspecifies that queries managed by the pool will count the number of geometry shader invocations. This counter’s value is incremented each time a geometry shader is invoked. In the case of instanced geometry shaders, the geometry shader invocations count is incremented for each separate instanced invocation.VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BITspecifies that queries managed by the pool will count the number of primitives generated by geometry shader invocations. The counter’s value is incremented each time the geometry shader emits a primitive. Restarting primitive topology using the SPIR-V instructionsOpEndPrimitiveorOpEndStreamPrimitivehas no effect on the geometry shader output primitives count.VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BITspecifies that queries managed by the pool will count the number of primitives processed by the Primitive Clipping stage of the pipeline. The counter’s value is incremented each time a primitive reaches the primitive clipping stage.VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BITspecifies that queries managed by the pool will count the number of primitives output by the Primitive Clipping stage of the pipeline. The counter’s value is incremented each time a primitive passes the primitive clipping stage. The actual number of primitives output by the primitive clipping stage for a particular input primitive is implementation-dependent but must satisfy the following conditions:- If at least one vertex of the input primitive lies inside the clipping volume, the counter is incremented by one or more.
- Otherwise, the counter is incremented by zero or more.
VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BITspecifies that queries managed by the pool will count the number of fragment shader invocations. The counter’s value is incremented each time the fragment shader is invoked.VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BITspecifies that queries managed by the pool will count the number of patches processed by the tessellation control shader. The counter’s value is incremented once for each patch for which a tessellation control shader is invoked.VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BITspecifies that queries managed by the pool will count the number of invocations of the tessellation evaluation shader. The counter’s value is incremented each time the tessellation evaluation shader is invoked.VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BITspecifies that queries managed by the pool will count the number of compute shader invocations. The counter’s value is incremented every time the compute shader is invoked. Implementations may skip the execution of certain compute shader invocations or execute additional compute shader invocations for implementation-dependent reasons as long as the results of rendering otherwise remain unchanged.
These values are intended to measure relative statistics on one implementation. Various device architectures will count these values differently. Any or all counters may be affected by the issues described in Query Operation.
Note
For example, tile-based rendering devices may need to replay the scene multiple times, affecting some of the counts.
If a pipeline has rasterizerDiscardEnable enabled, implementations
may discard primitives after the final vertex processing stage. As a
result, if rasterizerDiscardEnable is enabled, the clipping input and
output primitives counters may not be incremented.
When a pipeline statistics query finishes, the result for that query is
marked as available. The application can copy the result to a buffer
(via vkCmdCopyQueryPoolResults), or request it be put into host memory
(via vkGetQueryPoolResults).
See Also
Constructors
| VkQueryPipelineStatisticFlagBits VkFlags |
Instances
pattern VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits Source #
pattern VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT :: VkQueryPipelineStatisticFlagBits Source #
type VkQueryPool = Ptr VkQueryPool_T Source #
VkQueryPool - Opaque handle to a query pool object
Description
See Also
vkCmdBeginQuery,
vkCmdCopyQueryPoolResults,
vkCmdEndQuery,
vkCmdResetQueryPool,
vkCmdWriteTimestamp,
vkCreateQueryPool, vkDestroyQueryPool, vkGetQueryPoolResults
vkCreateQueryPool :: ("device" ::: VkDevice) -> ("pCreateInfo" ::: Ptr VkQueryPoolCreateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pQueryPool" ::: Ptr VkQueryPool) -> IO VkResult Source #
vkCreateQueryPool - Create a new query pool object
Parameters
deviceis the logical device that creates the query pool.
pCreateInfois a pointer to an instance of theVkQueryPoolCreateInfostructure containing the number and type of queries to be managed by the pool.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.pQueryPoolis a pointer to aVkQueryPoolhandle in which the resulting query pool object is returned.
Description
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
pCreateInfomust be a valid pointer to a validVkQueryPoolCreateInfostructure- If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure pQueryPoolmust be a valid pointer to aVkQueryPoolhandle
Return Codes
- Success
- -
VK_SUCCESS
- Failure
- -
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY
See Also
VkAllocationCallbacks,
VkDevice, VkQueryPool,
VkQueryPoolCreateInfo
vkDestroyQueryPool :: ("device" ::: VkDevice) -> ("queryPool" ::: VkQueryPool) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO () Source #
vkDestroyQueryPool - Destroy a query pool object
Parameters
deviceis the logical device that destroys the query pool.
queryPoolis the query pool to destroy.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.
Description
Valid Usage
- All submitted commands that refer to
queryPoolmust have completed execution
- If
VkAllocationCallbackswere provided whenqueryPoolwas created, a compatible set of callbacks must be provided here - If no
VkAllocationCallbackswere provided whenqueryPoolwas created,pAllocatormust beNULL
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
- If
queryPoolis notVK_NULL_HANDLE,queryPoolmust be a validVkQueryPoolhandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacksstructure - If
queryPoolis a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
queryPoolmust be externally synchronized
See Also
vkGetQueryPoolResults :: ("device" ::: VkDevice) -> ("queryPool" ::: VkQueryPool) -> ("firstQuery" ::: Word32) -> ("queryCount" ::: Word32) -> ("dataSize" ::: CSize) -> ("pData" ::: Ptr ()) -> ("stride" ::: VkDeviceSize) -> ("flags" ::: VkQueryResultFlags) -> IO VkResult Source #
vkGetQueryPoolResults - Copy results of queries in a query pool to a host memory region
Parameters
deviceis the logical device that owns the query pool.
queryPoolis the query pool managing the queries containing the desired results.firstQueryis the initial query index.queryCountis the number of queries.firstQueryandqueryCounttogether define a range of queries. For pipeline statistics queries, each query index in the pool contains one integer value for each bit that is enabled inVkQueryPoolCreateInfo::pipelineStatisticswhen the pool is created.dataSizeis the size in bytes of the buffer pointed to bypData.pDatais a pointer to a user-allocated buffer where the results will be writtenstrideis the stride in bytes between results for individual queries withinpData.flagsis a bitmask ofVkQueryResultFlagBitsspecifying how and when results are returned.
Description
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 VK_QUERY_RESULT_64_BIT is not set and the result overflows a 32-bit
value, the value may either wrap or saturate. Similarly, if
VK_QUERY_RESULT_64_BIT is set and the result overflows a 64-bit value,
the value may either wrap or saturate.
If VK_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, vkGetQueryPoolResults is guaranteed to
succeed and return VK_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
vkGetQueryPoolResults may not return in finite time.
If VK_QUERY_RESULT_WAIT_BIT and VK_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
vkGetQueryPoolResults returns VK_NOT_READY. However, availability
state is still written to pData for those queries if
VK_QUERY_RESULT_WITH_AVAILABILITY_BIT is set.
Note
Applications must take care to ensure that use of the
VK_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 vkCmdResetQueryPool, vkCmdBeginQuery, and
vkCmdEndQuery for that query, then the query will remain in the
available state until the vkCmdResetQueryPool 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 VK_QUERY_RESULT_WAIT_BIT is used in
combination with VK_QUERY_RESULT_WITH_AVAILABILITY_BIT. In this case,
the returned availability status may reflect the result of a previous
use of the query unless the vkCmdResetQueryPool 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 VK_QUERY_RESULT_PARTIAL_BIT is set, VK_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.
VK_QUERY_RESULT_PARTIAL_BIT must not be used if the pool’s
queryType is VK_QUERY_TYPE_TIMESTAMP.
If VK_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
VK_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
firstQuerymust be less than the number of queries inqueryPool
- If
VK_QUERY_RESULT_64_BITis not set inflagsthenpDataandstridemust be multiples of4 - If
VK_QUERY_RESULT_64_BITis set inflagsthenpDataandstridemust be multiples of8 - The sum of
firstQueryandqueryCountmust be less than or equal to the number of queries inqueryPool dataSizemust be large enough to contain the result of each query, as described here- If the
queryTypeused to createqueryPoolwasVK_QUERY_TYPE_TIMESTAMP,flagsmust not containVK_QUERY_RESULT_PARTIAL_BIT
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
queryPoolmust be a validVkQueryPoolhandlepDatamust be a valid pointer to an array ofdataSizebytesflagsmust be a valid combination ofVkQueryResultFlagBitsvaluesdataSizemust be greater than0queryPoolmust have been created, allocated, or retrieved fromdevice
Return Codes
- Success
- -
VK_SUCCESSVK_NOT_READY
- Failure
- -
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_OUT_OF_DEVICE_MEMORY
VK_ERROR_DEVICE_LOST
See Also
VkDevice, VkDeviceSize,
VkQueryPool, VkQueryResultFlags
data VkQueryPoolCreateInfo Source #
VkQueryPoolCreateInfo - Structure specifying parameters of a newly created query pool
Description
pipelineStatistics is ignored if queryType is not
VK_QUERY_TYPE_PIPELINE_STATISTICS.
Valid Usage
- If the
pipeline statistics queries
feature is not enabled,
queryTypemust not beVK_QUERY_TYPE_PIPELINE_STATISTICS
- If
queryTypeisVK_QUERY_TYPE_PIPELINE_STATISTICS,pipelineStatisticsmust be a valid combination ofVkQueryPipelineStatisticFlagBitsvalues
Valid Usage (Implicit)
sTypemust beVK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
pNextmust beNULLflagsmust be0queryTypemust be a validVkQueryTypevalue
See Also
VkQueryPipelineStatisticFlags, VkQueryPoolCreateFlags,
VkQueryType, VkStructureType,
vkCreateQueryPool
Constructors
| VkQueryPoolCreateInfo | |
Fields
| |
type VkQueryResultFlags = VkQueryResultFlagBits Source #
VkQueryResultFlags - Bitmask of VkQueryResultFlagBits
Description
VkQueryResultFlags is a bitmask type for setting a mask of zero or
more VkQueryResultFlagBits.
See Also
VkQueryResultFlagBits,
vkCmdCopyQueryPoolResults,
vkGetQueryPoolResults
type VkQueryPipelineStatisticFlags = VkQueryPipelineStatisticFlagBits Source #
VkQueryPipelineStatisticFlags - Bitmask of VkQueryPipelineStatisticFlagBits
Description
VkQueryPipelineStatisticFlags is a bitmask type for setting a mask of
zero or more VkQueryPipelineStatisticFlagBits.
See Also
VkCommandBufferInheritanceInfo,
VkQueryPipelineStatisticFlagBits, VkQueryPoolCreateInfo