Such a library is available at : https://github.com/intel/metrics-discovery
Performance analysis tools such as Graphics Performance Analyzers make use of this extension and the metrics-discovery library to present the data in a human readable way.
// A previously created device
VkDevice device;
// A queue derived from the device
VkQueue queue;
VkInitializePerformanceApiInfoINTEL performanceApiInfoIntel = {
VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL,
NULL,
NULL
};
vkInitializePerformanceApiINTEL(
device,
&performanceApiInfoIntel);
VkQueryPoolPerformanceQueryCreateInfoINTEL queryPoolIntel = {
VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL,
NULL,
VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL,
};
VkQueryPoolCreateInfo queryPoolCreateInfo = {
VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,
&queryPoolIntel,
0,
VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL,
1,
0
};
VkQueryPool queryPool;
VkResult result = vkCreateQueryPool(
device,
&queryPoolCreateInfo,
NULL,
&queryPool);
assert(VK_SUCCESS == result);
// A command buffer we want to record counters on
VkCommandBuffer commandBuffer;
VkCommandBufferBeginInfo commandBufferBeginInfo = {
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
NULL,
VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
NULL
};
result = vkBeginCommandBuffer(commandBuffer, &commandBufferBeginInfo);
assert(VK_SUCCESS == result);
vkCmdResetQueryPool(
commandBuffer,
queryPool,
0,
1);
vkCmdBeginQuery(
commandBuffer,
queryPool,
0,
0);
// Perform the commands you want to get performance information on
// ...
// Perform a barrier to ensure all previous commands were complete before
// ending the query
vkCmdPipelineBarrier(commandBuffer,
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
0,
0,
NULL,
0,
NULL,
0,
NULL);
vkCmdEndQuery(
commandBuffer,
queryPool,
0);
result = vkEndCommandBuffer(commandBuffer);
assert(VK_SUCCESS == result);
VkPerformanceConfigurationAcquireInfoINTEL performanceConfigurationAcquireInfo = {
VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL,
NULL,
VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL
};
VkPerformanceConfigurationINTEL performanceConfigurationIntel;
result = vkAcquirePerformanceConfigurationINTEL(
device,
&performanceConfigurationAcquireInfo,
&performanceConfigurationIntel);
vkQueueSetPerformanceConfigurationINTEL(queue, performanceConfigurationIntel);
assert(VK_SUCCESS == result);
// Submit the command buffer and wait for its completion
// ...
result = vkReleasePerformanceConfigurationINTEL(
device,
performanceConfigurationIntel);
assert(VK_SUCCESS == result);
// Get the report size from metrics-discovery's QueryReportSize
result = vkGetQueryPoolResults(
device,
queryPool,
0, 1, QueryReportSize,
data, QueryReportSize, 0);
assert(VK_SUCCESS == result);
// The data can then be passed back to metrics-discovery from which
// human readable values can be queried.
VK_INTEL_performance_query| Modifier and Type | Field and Description |
|---|---|
| public static final String | VK_INTEL_PERFORMANCE_QUERY_EXTENSION_NAME
The extension name. |
| public static final int | VK_INTEL_PERFORMANCE_QUERY_SPEC_VERSION
The extension specification version. |
| public static final int | VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL
Extends |
| public static final int | VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL
VkPerformanceConfigurationTypeINTEL - Type of performance configuration See Also |
| public static final int | VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL
VkPerformanceOverrideTypeINTEL - Performance override type Description
|
| public static final int | VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL
VkPerformanceOverrideTypeINTEL - Performance override type Description
|
| public static final int | VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL
VkPerformanceParameterTypeINTEL - Parameters that can be queried Description
|
| public static final int | VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL
VkPerformanceParameterTypeINTEL - Parameters that can be queried Description
|
| public static final int | VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL
VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See Also
|
| public static final int | VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL
VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See Also
|
| public static final int | VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL
VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See Also
|
| public static final int | VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL
VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See Also
|
| public static final int | VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL
VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See Also
|
| public static final int | VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL
VkQueryPoolSamplingModeINTEL - Enum specifying how performance queries should be captured Description
|
| public static final int | VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL
Extends |
| public static final int | VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL
Extends |
| public static final int | VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL
Extends |
| public static final int | VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL
Extends |
| public static final int | VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL
Extends |
| public static final int | VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL
Extends |
| public static final int | VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL
Extends |
| public static final int | VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL
Extends |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static int | nvkAcquirePerformanceConfigurationINTEL(VkDevice device, long pAcquireInfo, long pConfiguration)
Unsafe version of: |
| public static int | nvkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, long pMarkerInfo)
Unsafe version of: |
| public static int | nvkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, long pOverrideInfo)
Unsafe version of: |
| public static int | nvkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, long pMarkerInfo)
Unsafe version of: |
| public static int | nvkGetPerformanceParameterINTEL(VkDevice device, int parameter, long pValue)
Unsafe version of: |
| public static int | nvkInitializePerformanceApiINTEL(VkDevice device, long pInitializeInfo)
Unsafe version of: |
| public static int | vkAcquirePerformanceConfigurationINTEL(VkDevice
the logical device that the performance query commands will be submitted to. device, VkPerformanceConfigurationAcquireInfoINTEL a pointer to a pAcquireInfo, LongBuffer VkPerformanceConfigurationAcquireInfoINTEL structure, specifying the performance configuration to acquire.a pointer to a pConfiguration)VkPerformanceConfigurationINTEL handle in which the resulting configuration object is returned.Acquire the performance query capability. |
| public static int | vkAcquirePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationAcquireInfoINTEL pAcquireInfo, long[] pConfiguration)
Array version of: |
| public static int | vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, VkPerformanceMarkerInfoINTEL pMarkerInfo)
Markers. |
| public static int | vkCmdSetPerformanceOverrideINTEL(VkCommandBuffer
the command buffer where the override takes place. commandBuffer, VkPerformanceOverrideInfoINTEL a pointer to a pOverrideInfo)VkPerformanceOverrideInfoINTEL structure selecting the parameter to override.Performance override settings. |
| public static int | vkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, VkPerformanceStreamMarkerInfoINTEL pMarkerInfo)
Markers. |
| public static int | vkGetPerformanceParameterINTEL(VkDevice
the logical device to query. device, int the parameter to query. parameter, VkPerformanceValueINTEL a pointer to a pValue)VkPerformanceValueINTEL structure in which the type and value of the parameter are returned.Query performance capabilities of the device. |
| public static int | vkInitializePerformanceApiINTEL(VkDevice
the logical device used for the queries. device, VkInitializePerformanceApiInfoINTEL a pointer to a pInitializeInfo)VkInitializePerformanceApiInfoINTEL structure specifying initialization parameters.Initialize a device for performance queries. |
| public static int | vkQueueSetPerformanceConfigurationINTEL(VkQueue
the queue on which the configuration will be used. queue, long the configuration to use. configuration)Set a performance query. |
| public static int | vkReleasePerformanceConfigurationINTEL(VkDevice
the device associated to the configuration object to release. device, long the configuration object to release. configuration)Release a configuration to capture performance data. |
| public static void | vkUninitializePerformanceApiINTEL(VkDevice
the logical device used for the queries. device)Uninitialize a device for performance queries. |
| VK_INTEL_PERFORMANCE_QUERY_EXTENSION_NAME | back to summary |
|---|---|
| public static final String VK_INTEL_PERFORMANCE_QUERY_EXTENSION_NAME The extension name. | |
| VK_INTEL_PERFORMANCE_QUERY_SPEC_VERSION | back to summary |
|---|---|
| public static final int VK_INTEL_PERFORMANCE_QUERY_SPEC_VERSION The extension specification version. | |
| VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL | back to summary |
|---|---|
| public static final int VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL Extends | |
| VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL VkPerformanceConfigurationTypeINTEL - Type of performance configuration See Also | |
| VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL VkPerformanceOverrideTypeINTEL - Performance override type Description
See Also | |
| VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL VkPerformanceOverrideTypeINTEL - Performance override type Description
See Also | |
| VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL VkPerformanceParameterTypeINTEL - Parameters that can be queried Description
See Also | |
| VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL VkPerformanceParameterTypeINTEL - Parameters that can be queried Description
See Also | |
| VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See AlsoEnum values: | |
| VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See AlsoEnum values: | |
| VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See AlsoEnum values: | |
| VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See AlsoEnum values: | |
| VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL | back to summary |
|---|---|
| public static final int VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL VkPerformanceValueTypeINTEL - Type of the parameters that can be queried See AlsoEnum values: | |
| VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL | back to summary |
|---|---|
| public static final int VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL VkQueryPoolSamplingModeINTEL - Enum specifying how performance queries should be captured Description
See Also | |
| VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL | back to summary |
|---|---|
| public static final int VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL Extends | |
| VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL Extends Enum values:
| |
| VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL Extends Enum values:
| |
| VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL Extends Enum values:
| |
| VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL Extends Enum values:
| |
| VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL Extends Enum values:
| |
| VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL Extends Enum values:
| |
| VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL | back to summary |
|---|---|
| public static final int VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL Extends Enum values:
| |
| INTELPerformanceQuery | back to summary |
|---|---|
| protected INTELPerformanceQuery() | |
| nvkAcquirePerformanceConfigurationINTEL | back to summary |
|---|---|
| public static int nvkAcquirePerformanceConfigurationINTEL(VkDevice device, long pAcquireInfo, long pConfiguration) Unsafe version of: | |
| nvkCmdSetPerformanceMarkerINTEL | back to summary |
|---|---|
| public static int nvkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, long pMarkerInfo) Unsafe version of: | |
| nvkCmdSetPerformanceOverrideINTEL | back to summary |
|---|---|
| public static int nvkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, long pOverrideInfo) Unsafe version of: | |
| nvkCmdSetPerformanceStreamMarkerINTEL | back to summary |
|---|---|
| public static int nvkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, long pMarkerInfo) Unsafe version of: | |
| nvkGetPerformanceParameterINTEL | back to summary |
|---|---|
| public static int nvkGetPerformanceParameterINTEL(VkDevice device, int parameter, long pValue) Unsafe version of: | |
| nvkInitializePerformanceApiINTEL | back to summary |
|---|---|
| public static int nvkInitializePerformanceApiINTEL(VkDevice device, long pInitializeInfo) Unsafe version of: | |
| vkAcquirePerformanceConfigurationINTEL | back to summary |
|---|---|
| public static int vkAcquirePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationAcquireInfoINTEL pAcquireInfo, LongBuffer pConfiguration) Acquire the performance query capability. C SpecificationTo acquire a device performance configuration, call:
Valid Usage (Implicit)
Return Codes
See Also
| |
| vkAcquirePerformanceConfigurationINTEL | back to summary |
|---|---|
| public static int vkAcquirePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationAcquireInfoINTEL pAcquireInfo, long[] pConfiguration) Array version of:
| |
| vkCmdSetPerformanceMarkerINTEL | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static int vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, VkPerformanceMarkerInfoINTEL pMarkerInfo) Markers. C SpecificationTo help associate query results with a particular point at which an application emitted commands, markers can be set into the command buffers with the call:
Valid Usage (Implicit)
Host Synchronization
Command Properties
Return Codes
See Also
| |||||||||||
| vkCmdSetPerformanceOverrideINTEL | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static int vkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, VkPerformanceOverrideInfoINTEL pOverrideInfo) Performance override settings. C SpecificationSome applications might want measure the effect of a set of commands with a different settings. It is possible to override a particular settings using :
Valid Usage
Valid Usage (Implicit)
Host Synchronization
Command Properties
Return Codes
See Also
| |||||||||||
| vkCmdSetPerformanceStreamMarkerINTEL | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static int vkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, VkPerformanceStreamMarkerInfoINTEL pMarkerInfo) Markers. C SpecificationWhen monitoring the behavior of an application within the dataset generated by the entire set of applications running on the system, it is useful to identify draw calls within a potentially huge amount of performance data. To do so, application can generate stream markers that will be used to trace back a particular draw call with a particular performance data item.
Valid Usage (Implicit)
Host Synchronization
Command Properties
Return Codes
See Also
| |||||||||||
| vkGetPerformanceParameterINTEL | back to summary |
|---|---|
| public static int vkGetPerformanceParameterINTEL(VkDevice device, int parameter, VkPerformanceValueINTEL pValue) Query performance capabilities of the device. C SpecificationSome performance query features of a device can be discovered with the call:
Valid Usage (Implicit)
Return Codes
See Also
| |
| vkInitializePerformanceApiINTEL | back to summary |
|---|---|
| public static int vkInitializePerformanceApiINTEL(VkDevice device, VkInitializePerformanceApiInfoINTEL pInitializeInfo) Initialize a device for performance queries. C SpecificationPrior to creating a performance query pool, initialize the device for performance queries with the call:
Valid Usage (Implicit)
Return Codes
See Also
| |
| vkQueueSetPerformanceConfigurationINTEL | back to summary | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static int vkQueueSetPerformanceConfigurationINTEL(VkQueue queue, long configuration) Set a performance query. C SpecificationTo set a performance configuration, call:
Valid Usage (Implicit)
Command Properties
Return Codes
| |||||||||||
| vkReleasePerformanceConfigurationINTEL | back to summary |
|---|---|
| public static int vkReleasePerformanceConfigurationINTEL(VkDevice device, long configuration) Release a configuration to capture performance data. C SpecificationTo release a device performance configuration, call:
Valid Usage
Valid Usage (Implicit)
Host Synchronization
Return Codes
| |
| vkUninitializePerformanceApiINTEL | back to summary |
|---|---|
| public static void vkUninitializePerformanceApiINTEL(VkDevice device) Uninitialize a device for performance queries. C SpecificationOnce performance query operations have completed, uninitialize the device for performance queries with the call:
Valid Usage (Implicit)
| |