vulkan-2.0.0.1: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Core10.Query

Synopsis

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

VkQueryPoolCreateInfo

Instances
Eq VkQueryPoolCreateFlags Source # 
Instance details
Ord VkQueryPoolCreateFlags Source # 
Instance details
Read VkQueryPoolCreateFlags Source # 
Instance details
Show VkQueryPoolCreateFlags Source # 
Instance details
Storable VkQueryPoolCreateFlags Source # 
Instance details
Bits VkQueryPoolCreateFlags Source # 
Instance details
FiniteBits VkQueryPoolCreateFlags Source # 
Instance details

newtype VkQueryResultFlagBits Source #

VkQueryResultFlagBits - Bitmask specifying how and when query results are returned

See Also

VkQueryResultFlags

Instances
Eq VkQueryResultFlagBits Source # 
Instance details
Ord VkQueryResultFlagBits Source # 
Instance details
Read VkQueryResultFlagBits Source # 
Instance details
Show VkQueryResultFlagBits Source # 
Instance details
Storable VkQueryResultFlagBits Source # 
Instance details
Bits VkQueryResultFlagBits Source # 
Instance details
FiniteBits VkQueryResultFlagBits Source # 
Instance details

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_BIT specifies 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_BIT specifies 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_BIT specifies 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_BIT specifies 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_BIT specifies 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 instructions OpEndPrimitive or OpEndStreamPrimitive has no effect on the geometry shader output primitives count.
  • VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT specifies 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_BIT specifies 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_BIT specifies 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_BIT specifies 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_BIT specifies 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_BIT specifies 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

VkQueryPipelineStatisticFlags

Instances
Eq VkQueryPipelineStatisticFlagBits Source # 
Instance details
Ord VkQueryPipelineStatisticFlagBits Source # 
Instance details
Read VkQueryPipelineStatisticFlagBits Source # 
Instance details
Show VkQueryPipelineStatisticFlagBits Source # 
Instance details
Storable VkQueryPipelineStatisticFlagBits Source # 
Instance details
Bits VkQueryPipelineStatisticFlagBits Source # 
Instance details

Methods

(.&.) :: VkQueryPipelineStatisticFlagBits -> VkQueryPipelineStatisticFlagBits -> VkQueryPipelineStatisticFlagBits #

(.|.) :: VkQueryPipelineStatisticFlagBits -> VkQueryPipelineStatisticFlagBits -> VkQueryPipelineStatisticFlagBits #

xor :: VkQueryPipelineStatisticFlagBits -> VkQueryPipelineStatisticFlagBits -> VkQueryPipelineStatisticFlagBits #

complement :: VkQueryPipelineStatisticFlagBits -> VkQueryPipelineStatisticFlagBits #

shift :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

rotate :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

zeroBits :: VkQueryPipelineStatisticFlagBits #

bit :: Int -> VkQueryPipelineStatisticFlagBits #

setBit :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

clearBit :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

complementBit :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

testBit :: VkQueryPipelineStatisticFlagBits -> Int -> Bool #

bitSizeMaybe :: VkQueryPipelineStatisticFlagBits -> Maybe Int #

bitSize :: VkQueryPipelineStatisticFlagBits -> Int #

isSigned :: VkQueryPipelineStatisticFlagBits -> Bool #

shiftL :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

unsafeShiftL :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

shiftR :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

unsafeShiftR :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

rotateL :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

rotateR :: VkQueryPipelineStatisticFlagBits -> Int -> VkQueryPipelineStatisticFlagBits #

popCount :: VkQueryPipelineStatisticFlagBits -> Int #

FiniteBits VkQueryPipelineStatisticFlagBits Source # 
Instance details

vkCreateQueryPool :: ("device" ::: VkDevice) -> ("pCreateInfo" ::: Ptr VkQueryPoolCreateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pQueryPool" ::: Ptr VkQueryPool) -> IO VkResult Source #

vkCreateQueryPool - Create a new query pool object

Parameters

  • device is the logical device that creates the query pool.
  • pCreateInfo is a pointer to an instance of the VkQueryPoolCreateInfo 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 a VkQueryPool handle in which the resulting query pool object is returned.

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • pCreateInfo must be a valid pointer to a valid VkQueryPoolCreateInfo structure
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
  • pQueryPool must be a valid pointer to a VkQueryPool handle

Return Codes

[Success] - VK_SUCCESS

[Failure] - VK_ERROR_OUT_OF_HOST_MEMORY

  • VK_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

  • 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 VkAllocationCallbacks were provided when queryPool was created, a compatible set of callbacks must be provided here
  • If no VkAllocationCallbacks were provided when queryPool was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • If queryPool is not VK_NULL_HANDLE, queryPool must be a valid VkQueryPool handle
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
  • If queryPool is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to queryPool must be externally synchronized

See Also

VkAllocationCallbacks, VkDevice, VkQueryPool

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

  • 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. firstQuery and queryCount together 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 in VkQueryPoolCreateInfo::pipelineStatistics when the pool is created.
  • dataSize is the size in bytes of the buffer pointed to by pData.
  • pData is a pointer to a user-allocated buffer where the results will be written
  • stride is the stride in bytes between results for individual queries within pData.
  • flags is a bitmask of VkQueryResultFlagBits specifying 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

  • firstQuery must be less than the number of queries in queryPool
  • If VK_QUERY_RESULT_64_BIT is not set in flags then pData and stride must be multiples of 4
  • If VK_QUERY_RESULT_64_BIT is set in flags then pData and stride must be multiples of 8
  • The sum of firstQuery and queryCount must be less than or equal to the number of queries in queryPool
  • dataSize must be large enough to contain the result of each query, as described here
  • If the queryType used to create queryPool was VK_QUERY_TYPE_TIMESTAMP, flags must not contain VK_QUERY_RESULT_PARTIAL_BIT

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • queryPool must be a valid VkQueryPool handle
  • pData must be a valid pointer to an array of dataSize bytes
  • flags must be a valid combination of VkQueryResultFlagBits values
  • dataSize must be greater than 0
  • queryPool must have been created, allocated, or retrieved from device

Return Codes

[Success] - VK_SUCCESS

  • VK_NOT_READY

[Failure] - VK_ERROR_OUT_OF_HOST_MEMORY

  • VK_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

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
  • pNext must be NULL
  • flags must be 0
  • queryType must be a valid VkQueryType value

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