Class INTELPerformanceQuery
- java.lang.Object
-
- org.lwjgl.vulkan.INTELPerformanceQuery
-
public class INTELPerformanceQuery extends java.lang.Object
This extension allows an application to capture performance data to be interpreted by a external application or library.Such a library is available at : https://github.com/intel/metrics-discovery
Performance analysis tools such as GPA (https://software.intel.com/en-us/gpa) make use of this extension and the metrics-discovery library to present the data in a human readable way.
Example Code
// A previously created device VkDevice device; // A queue from from device VkQueue queue; VkInitializePerformanceApiInfoINTEL performanceApiInfoIntel = { VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL, NULL, NULL }; vkInitializePerformanceApiINTEL( device, &performanceApiInfoIntel); VkQueryPoolCreateInfoINTEL 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.
- Name String
VK_INTEL_performance_query
- Extension Type
- Device extension
- Registered Extension Number
- 211
- Revision
- 1
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Contact
- Lionel Landwerlin llandwerlin
- Last Modified Date
- 2018-05-16
- IP Status
- No known IP claims.
- Contributors
- Lionel Landwerlin, Intel
- Piotr Maciejewski, Intel
-
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
nvkAcquirePerformanceConfigurationINTEL(VkDevice device, long pAcquireInfo, long pConfiguration)
Unsafe version of:AcquirePerformanceConfigurationINTEL
static int
nvkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, long pMarkerInfo)
Unsafe version of:CmdSetPerformanceMarkerINTEL
static int
nvkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, long pOverrideInfo)
Unsafe version of:CmdSetPerformanceOverrideINTEL
static int
nvkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, long pMarkerInfo)
Unsafe version of:CmdSetPerformanceStreamMarkerINTEL
static int
nvkGetPerformanceParameterINTEL(VkDevice device, int parameter, long pValue)
Unsafe version of:GetPerformanceParameterINTEL
static int
nvkInitializePerformanceApiINTEL(VkDevice device, long pInitializeInfo)
Unsafe version of:InitializePerformanceApiINTEL
static int
vkAcquirePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationAcquireInfoINTEL pAcquireInfo, long[] pConfiguration)
Array version of:AcquirePerformanceConfigurationINTEL
static int
vkAcquirePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationAcquireInfoINTEL pAcquireInfo, java.nio.LongBuffer pConfiguration)
Acquire the performance query capability.static int
vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, VkPerformanceMarkerInfoINTEL pMarkerInfo)
Markers.static int
vkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, VkPerformanceOverrideInfoINTEL pOverrideInfo)
Performance override settings.static int
vkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, VkPerformanceStreamMarkerInfoINTEL pMarkerInfo)
Markers.static int
vkGetPerformanceParameterINTEL(VkDevice device, int parameter, VkPerformanceValueINTEL pValue)
Query performance capabilities of the device.static int
vkInitializePerformanceApiINTEL(VkDevice device, VkInitializePerformanceApiInfoINTEL pInitializeInfo)
Initialize a device for performance queries.static int
vkQueueSetPerformanceConfigurationINTEL(VkQueue queue, long configuration)
Set a performance query.static int
vkReleasePerformanceConfigurationINTEL(VkDevice device, long configuration)
Release a configuration to capture performance data.static void
vkUninitializePerformanceApiINTEL(VkDevice device)
Uninitialize a device for performance queries.
-
-
-
Field Detail
-
VK_INTEL_PERFORMANCE_QUERY_SPEC_VERSION
The extension specification version.
-
VK_INTEL_PERFORMANCE_QUERY_EXTENSION_NAME
The extension name.
-
VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL, VK_STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL, VK_STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL, VK_STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL, VK_STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL, VK_STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL
ExtendsVkStructureType
.Enum values:
STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL
STRUCTURE_TYPE_INITIALIZE_PERFORMANCE_API_INFO_INTEL
STRUCTURE_TYPE_PERFORMANCE_MARKER_INFO_INTEL
STRUCTURE_TYPE_PERFORMANCE_STREAM_MARKER_INFO_INTEL
STRUCTURE_TYPE_PERFORMANCE_OVERRIDE_INFO_INTEL
STRUCTURE_TYPE_PERFORMANCE_CONFIGURATION_ACQUIRE_INFO_INTEL
-
VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL
ExtendsVkQueryType
.
-
VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL
ExtendsVkObjectType
.
-
VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL
VkPerformanceConfigurationTypeINTEL - Type of performance configurationSee Also
-
VK_QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL
VkQueryPoolSamplingModeINTEL - Enum specifying how performance queries should be capturedDescription
QUERY_POOL_SAMPLING_MODE_MANUAL_INTEL
is the default mode in which the application callsCmdBeginQuery
andCmdEndQuery
to record performance data.
See Also
-
VK_PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL, VK_PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL
VkPerformanceOverrideTypeINTEL - Performance override typeDescription
PERFORMANCE_OVERRIDE_TYPE_NULL_HARDWARE_INTEL
turns all rendering operations into noop.PERFORMANCE_OVERRIDE_TYPE_FLUSH_GPU_CACHES_INTEL
stalls the stream of commands until all previously emitted commands have completed and all caches been flushed and invalidated.
See Also
-
VK_PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL, VK_PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL
VkPerformanceParameterTypeINTEL - Parameters that can be queriedDescription
PERFORMANCE_PARAMETER_TYPE_HW_COUNTERS_SUPPORTED_INTEL
has a boolean result which tells whether hardware counters can be captured.PERFORMANCE_PARAMETER_TYPE_STREAM_MARKER_VALID_BITS_INTEL
has a 32 bits integer result which tells how many bits can be written into theVkPerformanceValueINTEL
value.
See Also
-
VK_PERFORMANCE_VALUE_TYPE_UINT32_INTEL, VK_PERFORMANCE_VALUE_TYPE_UINT64_INTEL, VK_PERFORMANCE_VALUE_TYPE_FLOAT_INTEL, VK_PERFORMANCE_VALUE_TYPE_BOOL_INTEL, VK_PERFORMANCE_VALUE_TYPE_STRING_INTEL
VkPerformanceValueTypeINTEL - Type of the parameters that can be queriedSee Also
Enum values:
-
-
Method Detail
-
nvkInitializePerformanceApiINTEL
public static int nvkInitializePerformanceApiINTEL(VkDevice device, long pInitializeInfo)
Unsafe version of:InitializePerformanceApiINTEL
-
vkInitializePerformanceApiINTEL
public static int vkInitializePerformanceApiINTEL(VkDevice device, VkInitializePerformanceApiInfoINTEL pInitializeInfo)
Initialize a device for performance queries.C Specification
Prior to creating a performance query pool, initialize the device for performance queries with the call:
VkResult vkInitializePerformanceApiINTEL( VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo);
Valid Usage (Implicit)
device
must be a validVkDevice
handlepInitializeInfo
must be a valid pointer to a validVkInitializePerformanceApiInfoINTEL
structure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device
- the logical device used for the queries.pInitializeInfo
- a pointer to the initialization parameters.
-
vkUninitializePerformanceApiINTEL
public static void vkUninitializePerformanceApiINTEL(VkDevice device)
Uninitialize a device for performance queries.C Specification
Once performance query operations have completed, uninitalize the device for performance queries with the call:
void vkUninitializePerformanceApiINTEL( VkDevice device);
Valid Usage (Implicit)
device
must be a validVkDevice
handle
- Parameters:
device
- the logical device used for the queries.
-
nvkCmdSetPerformanceMarkerINTEL
public static int nvkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, long pMarkerInfo)
Unsafe version of:CmdSetPerformanceMarkerINTEL
-
vkCmdSetPerformanceMarkerINTEL
public static int vkCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, VkPerformanceMarkerInfoINTEL pMarkerInfo)
Markers.C Specification
To 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:
VkResult vkCmdSetPerformanceMarkerINTEL( VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL* pMarkerInfo);
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepMarkerInfo
must be a valid pointer to a validVkPerformanceMarkerInfoINTEL
structurecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, compute, or transfer operations
Host Synchronization
- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary Secondary Both Graphics Compute Transfer Return Codes
- On success, this command returns
- On failure, this command returns
See Also
-
nvkCmdSetPerformanceStreamMarkerINTEL
public static int nvkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, long pMarkerInfo)
Unsafe version of:CmdSetPerformanceStreamMarkerINTEL
-
vkCmdSetPerformanceStreamMarkerINTEL
public static int vkCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, VkPerformanceStreamMarkerInfoINTEL pMarkerInfo)
Markers.C Specification
When monitoring the behavior of an application wihtin 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.
VkResult vkCmdSetPerformanceStreamMarkerINTEL( VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo);
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepMarkerInfo
must be a valid pointer to a validVkPerformanceStreamMarkerInfoINTEL
structurecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, compute, or transfer operations
Host Synchronization
- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary Secondary Both Graphics Compute Transfer Return Codes
- On success, this command returns
- On failure, this command returns
See Also
-
nvkCmdSetPerformanceOverrideINTEL
public static int nvkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, long pOverrideInfo)
Unsafe version of:CmdSetPerformanceOverrideINTEL
-
vkCmdSetPerformanceOverrideINTEL
public static int vkCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, VkPerformanceOverrideInfoINTEL pOverrideInfo)
Performance override settings.C Specification
Some applications might want measure the effect of a set of commands with a different settings. It is possible to override a particular settings using :
VkResult vkCmdSetPerformanceOverrideINTEL( VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo);
Valid Usage
pOverrideInfo
must not be used with aVkPerformanceOverrideTypeINTEL
that is not reported available byvkGetPerformanceParameterINTEL
.
Valid Usage (Implicit)
commandBuffer
must be a validVkCommandBuffer
handlepOverrideInfo
must be a valid pointer to a validVkPerformanceOverrideInfoINTEL
structurecommandBuffer
must be in the recording state- The
VkCommandPool
thatcommandBuffer
was allocated from must support graphics, compute, or transfer operations
Host Synchronization
- Host access to the
VkCommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type Primary Secondary Both Graphics Compute Transfer Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
commandBuffer
- the command buffer where the override takes place.pOverrideInfo
- a pointer to aVkPerformanceOverrideInfoINTEL
selecting the parameter to override.
-
nvkAcquirePerformanceConfigurationINTEL
public static int nvkAcquirePerformanceConfigurationINTEL(VkDevice device, long pAcquireInfo, long pConfiguration)
Unsafe version of:AcquirePerformanceConfigurationINTEL
-
vkAcquirePerformanceConfigurationINTEL
public static int vkAcquirePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationAcquireInfoINTEL pAcquireInfo, java.nio.LongBuffer pConfiguration)
Acquire the performance query capability.C Specification
To acquire a device performance configuration, call:
VkResult vkAcquirePerformanceConfigurationINTEL( VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, VkPerformanceConfigurationINTEL* pConfiguration);
Valid Usage (Implicit)
device
must be a validVkDevice
handlepAcquireInfo
must be a valid pointer to a validVkPerformanceConfigurationAcquireInfoINTEL
structurepConfiguration
must be a valid pointer to aVkPerformanceConfigurationINTEL
handle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device
- the logical device that the performance query commands will be submitted to.pAcquireInfo
- a pointer toVkPerformanceConfigurationAcquireInfoINTEL
.pConfiguration
- a pointer to aVkPerformanceConfigurationINTEL
handle in which the resulting configuration object is returned.
-
vkReleasePerformanceConfigurationINTEL
public static int vkReleasePerformanceConfigurationINTEL(VkDevice device, long configuration)
Release a configuration to capture performance data.C Specification
To release a device performance configuration, call:
VkResult vkReleasePerformanceConfigurationINTEL( VkDevice device, VkPerformanceConfigurationINTEL configuration);
Valid Usage
configuration
must not be released before all command buffers submitted while the configuration was set are in pending state.
Valid Usage (Implicit)
device
must be a validVkDevice
handleconfiguration
must be a validVkPerformanceConfigurationINTEL
handleconfiguration
must have been created, allocated, or retrieved fromdevice
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
device
- the device associated to the configuration object to release.configuration
- the configuration object to release.
-
vkQueueSetPerformanceConfigurationINTEL
public static int vkQueueSetPerformanceConfigurationINTEL(VkQueue queue, long configuration)
Set a performance query.C Specification
To set a performance configuration, call:
VkResult vkQueueSetPerformanceConfigurationINTEL( VkQueue queue, VkPerformanceConfigurationINTEL configuration);
Valid Usage (Implicit)
queue
must be a validVkQueue
handleconfiguration
must be a validVkPerformanceConfigurationINTEL
handle- Both of
configuration
, andqueue
must have been created, allocated, or retrieved from the sameVkDevice
Command Properties
Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type - - Any - Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
queue
- the queue on which the configuration will be used.configuration
- the configuration to use.
-
nvkGetPerformanceParameterINTEL
public static int nvkGetPerformanceParameterINTEL(VkDevice device, int parameter, long pValue)
Unsafe version of:GetPerformanceParameterINTEL
-
vkGetPerformanceParameterINTEL
public static int vkGetPerformanceParameterINTEL(VkDevice device, int parameter, VkPerformanceValueINTEL pValue)
Query performance capabilities of the device.C Specification
Some performance query features of a device can be discovered with the call:
VkResult vkGetPerformanceParameterINTEL( VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue);
Valid Usage (Implicit)
device
must be a validVkDevice
handleparameter
must be a validVkPerformanceParameterTypeINTEL
valuepValue
must be a valid pointer to aVkPerformanceValueINTEL
structure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device
- the logical device to query.parameter
- the parameter to query.pValue
- points to an instance of theVkPerformanceValueINTEL
structure in which the type and value of the parameter are returned.
-
vkAcquirePerformanceConfigurationINTEL
public static int vkAcquirePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationAcquireInfoINTEL pAcquireInfo, long[] pConfiguration)
Array version of:AcquirePerformanceConfigurationINTEL
-
-