Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- createQueryPool :: forall a io. (Extendss QueryPoolCreateInfo a, PokeChain a, MonadIO io) => Device -> QueryPoolCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io QueryPool
- withQueryPool :: forall a io r. (Extendss QueryPoolCreateInfo a, PokeChain a, MonadIO io) => Device -> QueryPoolCreateInfo a -> Maybe AllocationCallbacks -> (io QueryPool -> (QueryPool -> io ()) -> r) -> r
- destroyQueryPool :: forall io. MonadIO io => Device -> QueryPool -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- getQueryPoolResults :: forall io. MonadIO io => Device -> QueryPool -> ("firstQuery" ::: Word32) -> ("queryCount" ::: Word32) -> ("dataSize" ::: Word64) -> ("data" ::: Ptr ()) -> ("stride" ::: DeviceSize) -> QueryResultFlags -> io Result
- data QueryPoolCreateInfo (es :: [Type]) = QueryPoolCreateInfo {}
- newtype QueryPool = QueryPool Word64
- newtype QueryPoolCreateFlags = QueryPoolCreateFlags Flags
- newtype QueryType where
- QueryType Int32
- pattern QUERY_TYPE_OCCLUSION :: QueryType
- pattern QUERY_TYPE_PIPELINE_STATISTICS :: QueryType
- pattern QUERY_TYPE_TIMESTAMP :: QueryType
- pattern QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT :: QueryType
- pattern QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT :: QueryType
- pattern QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR :: QueryType
- pattern QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR :: QueryType
- pattern QUERY_TYPE_PRIMITIVES_GENERATED_EXT :: QueryType
- pattern QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT :: QueryType
- pattern QUERY_TYPE_PERFORMANCE_QUERY_INTEL :: QueryType
- pattern QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_NV :: QueryType
- pattern QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR :: QueryType
- pattern QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR :: QueryType
- pattern QUERY_TYPE_PERFORMANCE_QUERY_KHR :: QueryType
- pattern QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT :: QueryType
- newtype QueryResultFlagBits where
- type QueryResultFlags = QueryResultFlagBits
- newtype QueryPipelineStatisticFlagBits where
- QueryPipelineStatisticFlagBits Flags
- pattern QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_CLUSTER_CULLING_SHADER_INVOCATIONS_BIT_HUAWEI :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT :: QueryPipelineStatisticFlagBits
- pattern QUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT :: QueryPipelineStatisticFlagBits
- type QueryPipelineStatisticFlags = QueryPipelineStatisticFlagBits
Documentation
:: forall a io. (Extendss QueryPoolCreateInfo a, PokeChain a, MonadIO io) | |
=> Device |
|
-> QueryPoolCreateInfo a |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> io QueryPool |
vkCreateQueryPool - Create a new query pool object
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
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
VK_VERSION_1_0,
AllocationCallbacks
,
Device
, QueryPool
,
QueryPoolCreateInfo
withQueryPool :: forall a io r. (Extendss QueryPoolCreateInfo a, PokeChain a, MonadIO io) => Device -> QueryPoolCreateInfo a -> Maybe AllocationCallbacks -> (io QueryPool -> (QueryPool -> io ()) -> r) -> r Source #
A convenience wrapper to make a compatible pair of calls to
createQueryPool
and destroyQueryPool
To ensure that destroyQueryPool
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 |
|
-> QueryPool |
|
-> ("allocator" ::: Maybe AllocationCallbacks) |
|
-> io () |
vkDestroyQueryPool - Destroy a query pool object
Valid Usage
- 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
Note
Applications can verify that queryPool
can be destroyed by
checking that getQueryPoolResults
() without the
QUERY_RESULT_PARTIAL_BIT
flag
returns SUCCESS
for all queries that are
used in command buffers submitted for execution.
Valid Usage (Implicit)
-
device
must be a validDevice
handle
- 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
:: forall io. MonadIO io | |
=> Device |
|
-> QueryPool |
|
-> ("firstQuery" ::: Word32) |
|
-> ("queryCount" ::: Word32) |
|
-> ("dataSize" ::: Word64) |
|
-> ("data" ::: Ptr ()) |
|
-> ("stride" ::: DeviceSize) |
|
-> QueryResultFlags |
|
-> io Result |
vkGetQueryPoolResults - Copy results of queries in a query pool to a host memory region
Description
Any results written for a query are written according to a layout dependent on the query type.
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. Behavior when not all queries are available is described
below.
If
QUERY_RESULT_WITH_AVAILABILITY_BIT
is set, results for all queries in queryPool
identified by
firstQuery
and queryCount
are copied to pData
, along with an extra
availability or status value written directly after the results of each
query and interpreted as an unsigned integer. A value of zero indicates
that the results are not yet available, otherwise the query is complete
and results are available. The size of the availability or status values
is 64 bits if
QUERY_RESULT_64_BIT
is set in
flags
. Otherwise, it is 32 bits.
If VK_QUERY_RESULT_WITH_STATUS_BIT_KHR
is set, results for all queries
in queryPool
identified by firstQuery
and queryCount
are copied to
pData
, along with an extra status value written directly after the
results of each query and interpreted as a signed integer. A value of
zero indicates that the results are not yet available. Positive values
indicate that the operations within the query completed successfully,
and the query results are valid. Negative values indicate that the
operations within the query completed unsuccessfully.
VkQueryResultStatusKHR defines specific meaning for values returned here, though implementations are free to return other values.
Note
If
QUERY_RESULT_WITH_AVAILABILITY_BIT
or VK_QUERY_RESULT_WITH_STATUS_BIT_KHR
is set, the layout of data in
the buffer is a (result,availability) or (result,status) pair for
each query returned, and stride
is the stride between each pair.
Results for any available query written by this command are final and
represent the final result of the query. If
QUERY_RESULT_PARTIAL_BIT
is
set, then for any query that is unavailable, an intermediate result
between zero and the final result value is written for that query.
Otherwise, any result written by this command is undefined.
If QUERY_RESULT_64_BIT
is set,
results and, if returned, availability or status values for all queries
are written as an array of 64-bit values. If the queryPool
was created
with QUERY_TYPE_PERFORMANCE_QUERY_KHR
,
results for each query are written as an array of the type indicated by
PerformanceCounterKHR
::storage
for the counter being queried. Otherwise, results and availability or
status values are written as an array of 32-bit values. If an unsigned
integer query’s value overflows the result type, the value may either
wrap or saturate. If a signed integer query’s value overflows the result
type, the value is undefined. If a floating point query’s value is not
representable as the result type, the value is undefined.
If QUERY_RESULT_WAIT_BIT
is
set, this command defines an execution dependency with any earlier
commands that writes one of the identified queries. The first
synchronization scope
includes all instances of
cmdEndQuery
,
cmdEndQueryIndexedEXT
,
cmdWriteTimestamp2
,
and cmdWriteTimestamp
that
reference any query in queryPool
indicated by firstQuery
and
queryCount
. The second
synchronization scope
includes the host operations of this command.
If QUERY_RESULT_WAIT_BIT
is
not set, getQueryPoolResults
may return
NOT_READY
if there are queries in the
unavailable state.
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.
A similar situation can arise with the
VK_QUERY_RESULT_WITH_STATUS_BIT_KHR
flag.
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.
Valid Usage
-
firstQuery
must be less than the number of queries inqueryPool
- 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
QUERY_RESULT_WITH_AVAILABILITY_BIT
is set,stride
must be large enough to contain the unsigned integer representing availability or status in addition to the query result. - If the
queryType
used to createqueryPool
wasQUERY_TYPE_PERFORMANCE_QUERY_KHR
, thenpData
andstride
must be multiples of the size ofPerformanceCounterResultKHR
- If the
queryType
used to createqueryPool
wasQUERY_TYPE_PERFORMANCE_QUERY_KHR
, thenstride
must be large enough to contain theQueryPoolPerformanceCreateInfoKHR
::counterIndexCount
used to createqueryPool
times 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
,VK_QUERY_RESULT_WITH_STATUS_BIT_KHR
,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
- If the
queryType
used to createqueryPool
wasVK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR
, thenflags
must includeVK_QUERY_RESULT_WITH_STATUS_BIT_KHR
- If
flags
includesVK_QUERY_RESULT_WITH_STATUS_BIT_KHR
, then it must not includeQUERY_RESULT_WITH_AVAILABILITY_BIT
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
queryPool
must be a validQueryPool
handle -
pData
must be a valid pointer to an array ofdataSize
bytes -
flags
must be a valid combination ofQueryResultFlagBits
values -
dataSize
must be greater than0
-
queryPool
must have been created, allocated, or retrieved fromdevice
Return Codes
See Also
VK_VERSION_1_0,
Device
,
DeviceSize
,
QueryPool
,
QueryResultFlags
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
pipelineStatisticsQuery
feature is not enabled,
queryType
must not beQUERY_TYPE_PIPELINE_STATISTICS
- If the
meshShaderQueries
feature is not enabled,
queryType
must not beQUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT
- If the
meshShaderQueries
feature is not enabled, and
queryType
isQUERY_TYPE_PIPELINE_STATISTICS
,pipelineStatistics
must not containQUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT
orQUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT
- 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 aQueryPoolPerformanceCreateInfoKHR
structure -
queryCount
must be greater than 0 - If
queryType
isVK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR
, then thepNext
chain must include a VkVideoProfileInfoKHR structure withvideoCodecOperation
specifying an encode operation - If
queryType
isVK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR
, then thepNext
chain must include a VkQueryPoolVideoEncodeFeedbackCreateInfoKHR structure - If
queryType
isVK_QUERY_TYPE_VIDEO_ENCODE_FEEDBACK_KHR
, and thepNext
chain includes a VkVideoProfileInfoKHR structure and a VkQueryPoolVideoEncodeFeedbackCreateInfoKHR structure, then VkQueryPoolVideoEncodeFeedbackCreateInfoKHR::encodeFeedbackFlags
must not contain any bits that are not set in VkVideoEncodeCapabilitiesKHR::supportedEncodeFeedbackFlags
, as returned by vkGetPhysicalDeviceVideoCapabilitiesKHR for the video profile described by VkVideoProfileInfoKHR and itspNext
chain
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 ofQueryPoolPerformanceCreateInfoKHR
,QueryPoolPerformanceQueryCreateInfoINTEL
, VkQueryPoolVideoEncodeFeedbackCreateInfoKHR, VkVideoDecodeH264ProfileInfoKHR, VkVideoDecodeH265ProfileInfoKHR, VkVideoDecodeUsageInfoKHR, VkVideoEncodeH264ProfileInfoEXT, VkVideoEncodeH265ProfileInfoEXT, VkVideoEncodeUsageInfoKHR, or VkVideoProfileInfoKHR - The
sType
value of each struct in thepNext
chain must be unique -
flags
must be0
-
queryType
must be a validQueryType
value
See Also
VK_VERSION_1_0,
QueryPipelineStatisticFlags
,
QueryPoolCreateFlags
,
QueryType
,
StructureType
, createQueryPool
QueryPoolCreateInfo | |
|
Instances
VkQueryPool - Opaque handle to a query pool object
See Also
VK_VERSION_1_0,
cmdBeginQuery
,
cmdBeginQueryIndexedEXT
,
cmdCopyQueryPoolResults
,
cmdEndQuery
,
cmdEndQueryIndexedEXT
,
cmdResetQueryPool
,
cmdWriteAccelerationStructuresPropertiesKHR
,
cmdWriteAccelerationStructuresPropertiesNV
,
cmdWriteMicromapsPropertiesEXT
,
cmdWriteTimestamp
,
cmdWriteTimestamp2
,
cmdWriteTimestamp2KHR
,
createQueryPool
,
destroyQueryPool
,
getQueryPoolResults
,
resetQueryPool
,
resetQueryPoolEXT
Instances
Storable QueryPool Source # | |
Defined in Vulkan.Core10.Handles | |
Show QueryPool Source # | |
Eq QueryPool Source # | |
Ord QueryPool Source # | |
Defined in Vulkan.Core10.Handles | |
HasObjectType QueryPool Source # | |
Defined in Vulkan.Core10.Handles objectTypeAndHandle :: QueryPool -> (ObjectType, Word64) Source # | |
IsHandle QueryPool Source # | |
Defined in Vulkan.Core10.Handles | |
Zero QueryPool Source # | |
Defined in Vulkan.Core10.Handles |
newtype QueryPoolCreateFlags Source #
VkQueryPoolCreateFlags - Reserved for future use
Description
QueryPoolCreateFlags
is a bitmask type for setting a mask, but is
currently reserved for future use.
See Also
Instances
VkQueryType - Specify the type of queries managed by a query pool
See Also
VK_VERSION_1_0,
QueryPoolCreateInfo
,
cmdWriteAccelerationStructuresPropertiesKHR
,
cmdWriteAccelerationStructuresPropertiesNV
,
cmdWriteMicromapsPropertiesEXT
,
writeAccelerationStructuresPropertiesKHR
,
writeMicromapsPropertiesEXT
Instances
Storable QueryType Source # | |
Defined in Vulkan.Core10.Enums.QueryType | |
Read QueryType Source # | |
Show QueryType Source # | |
Eq QueryType Source # | |
Ord QueryType Source # | |
Defined in Vulkan.Core10.Enums.QueryType | |
Zero QueryType Source # | |
Defined in Vulkan.Core10.Enums.QueryType |
newtype QueryResultFlagBits Source #
VkQueryResultFlagBits - Bitmask specifying how and when query results are returned
See Also
pattern QUERY_RESULT_64_BIT :: QueryResultFlagBits |
|
pattern QUERY_RESULT_WAIT_BIT :: QueryResultFlagBits |
|
pattern QUERY_RESULT_WITH_AVAILABILITY_BIT :: QueryResultFlagBits |
|
pattern QUERY_RESULT_PARTIAL_BIT :: QueryResultFlagBits |
|
Instances
newtype QueryPipelineStatisticFlagBits Source #
VkQueryPipelineStatisticFlagBits - Bitmask specifying queried pipeline statistics
Description
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.
This counting difference is especially true if the pipeline contains mesh or task shaders, which may affect several of the counters in unexpected ways.
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
pre-rasterization shader 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 cmdCopyQueryPoolResults
), or
request it be put into host memory (via
getQueryPoolResults
).
See Also
pattern QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_CLUSTER_CULLING_SHADER_INVOCATIONS_BIT_HUAWEI :: QueryPipelineStatisticFlagBits | |
pattern QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT :: QueryPipelineStatisticFlagBits |
|
pattern QUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT :: QueryPipelineStatisticFlagBits |
|