HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.Extensions.VK_ARM_shader_instrumentation

Name

VK_ARM_shader_instrumentation - device extension

VK_ARM_shader_instrumentation

Name String

VK_ARM_shader_instrumentation

Extension Type

Device extension

Registered Extension Number

608

Revision

1

Ratification Status

Not ratified

Extension and Version Dependencies

VK_KHR_get_physical_device_properties2

or

Vulkan Version 1.1

API Interactions
  • Interacts with VK_EXT_shader_object

Special Use
Contact
Extension Proposal

VK_ARM_shader_instrumentation

Other Extension Metadata

Last Modified Date

2026-02-26

IP Status

No known IP claims.

Contributors
  • Embla Flatlandsmo, Arm Ltd.

  • Jan-Harald Fredriksen, Arm Ltd.

  • Mikel Garai, Arm Ltd.

  • Peter Harris, Arm Ltd.

  • Ting Wei, Arm Ltd.

  • Torbjörn Nilsson, Arm Ltd.

Description

This extension provides the ability to instrument shaders and capture performance metrics per shader type from commands executed by a queue.

New Object Types

New Commands

New Structures

New Bitmasks

New Enum Constants

If VK_EXT_shader_object is supported:

Version History

  • Revision 1, 2026-02-26 (Embla Flatlandsmo, Jan-Harald Fredriksen)

    • Initial draft.

See Also

No cross-references are available

Document Notes

For more information, see the Vulkan Specification.

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

  • 11 types
  • 8 values
  • Packagevulkan-3.27
  • Exports34
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceVK_ARM_shader_instrumentation.hs

vkEnumeratePhysicalDeviceShaderInstrumentationMetricsARM - Returns properties describing what shader instrumentation metrics are supported

Description

If pDescriptions is NULL, then the number of shader instrumentation metrics available is returned in pDescriptionCount. Otherwise, pDescriptionCount must point to a variable set by the application to the number of elements in the pDescriptions array, and on return the variable is overwritten with the number of structures actually written to pDescriptions. If pDescriptionCount is less than the number shader instrumentation metrics available, at most pDescriptionCount structures will be written, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not all the available shader instrumentation metrics were returned.

Valid Usage (Implicit)

  • pDescriptionCount must be a valid pointer to a uint32_t value

  • If the value referenced by pDescriptionCount is not 0, and pDescriptions is not NULL, pDescriptions must be a valid pointer to an array of pDescriptionCount ShaderInstrumentationMetricDescriptionARM structures

Return Codes

Success
Failure

See Also

VK_ARM_shader_instrumentation, PhysicalDevice, ShaderInstrumentationMetricDescriptionARM

valuecreateShaderInstrumentationARM
  1. :: MonadIO io
  2. => Device

    device is the logical device that creates the shader instrumentation object.

  3. -> ShaderInstrumentationCreateInfoARM

    pCreateInfo is a pointer to a ShaderInstrumentationCreateInfoARM structure containing information about how the shader instrumentation object is to be created.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io ShaderInstrumentationARM
#

vkCreateShaderInstrumentationARM - Create a new shader instrumentation object

Valid Usage (Implicit)

  • device must be a valid Device handle

Return Codes

Success
Failure

See Also

VK_ARM_shader_instrumentation, AllocationCallbacks, Device, ShaderInstrumentationARM, ShaderInstrumentationCreateInfoARM

A convenience wrapper to make a compatible pair of calls to createShaderInstrumentationARM and destroyShaderInstrumentationARM

To ensure that destroyShaderInstrumentationARM 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.

valuedestroyShaderInstrumentationARM
  1. :: MonadIO io
  2. => Device

    device is the logical device that destroys the shader instrumentation.

  3. -> ShaderInstrumentationARM

    instrumentation is the handle of the shader instrumentation to destroy.

  4. -> "allocator" ::: Maybe AllocationCallbacks

    pAllocator controls host memory allocation as described in the Memory Allocation chapter.

  5. -> io ()
#

vkDestroyShaderInstrumentationARM - Destroy a shader instrumentation object

Valid Usage

  • All submitted commands that refer to instrumentation must have completed execution

Valid Usage (Implicit)

  • device must be a valid Device handle

  • If instrumentation is not NULL_HANDLE, instrumentation must be a valid ShaderInstrumentationARM handle

  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure

  • If instrumentation is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to instrumentation must be externally synchronized

See Also

VK_ARM_shader_instrumentation, AllocationCallbacks, Device, ShaderInstrumentationARM

valuecmdBeginShaderInstrumentationARM
  1. :: MonadIO io
  2. => CommandBuffer

    commandBuffer is the command buffer into which this command will be recorded.

  3. -> ShaderInstrumentationARM

    instrumentation is the handle of the shader instrumentation object that will capture the metrics.

  4. -> io ()
#

vkCmdBeginShaderInstrumentationARM - Begin shader instrumentation

Description

After beginning shader instrumentation, shader instrumentation is considered active within the command buffer it was called in until shader instrumentation is ended.

The shader instrumentation object has an implicit result index where the per-shader metrics will be written. The result index is set to 0 when the object is created by calling createShaderInstrumentationARM, and incremented by 1 for each draw, dispatch, and ray tracing command recorded while the shader instrumentation object is active.

The result index is also incremented by 1 when cmdExecuteGeneratedCommandsEXT is recorded.

While shader instrumentation is active, instrumented shaders write to the instrumentation object. These writes must be synchronized using the instrumented shader’s stage with access mask ACCESS_2_SHADER_WRITE_BIT. If no instrumentation object is bound, writes are discarded.

If a command buffer is submitted multiple times, the shader instrumented metrics for all submissions will be aggregated in the instrumentation object, unless the metrics are cleared between submissions.

Valid Usage

  • This command must not be recorded while shader instrumentation is active within commandBuffer

  • commandBuffer must not be a protected command buffer

Valid Usage (Implicit)

Host Synchronization

  • Host access to commandBuffer must be externally synchronized

  • Host access to instrumentation must be externally synchronized

  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Command Buffer Levels

Render Pass Scope

Video Coding Scope

Supported Queue Types

Command Type

Primary Secondary

Both

Outside

VK_QUEUE_COMPUTE_BIT VK_QUEUE_DATA_GRAPH_BIT_ARM VK_QUEUE_GRAPHICS_BIT

Action State

Conditional Rendering

vkCmdBeginShaderInstrumentationARM is not affected by conditional rendering

See Also

VK_ARM_shader_instrumentation, CommandBuffer, ShaderInstrumentationARM

valuecmdEndShaderInstrumentationARM
  1. :: MonadIO io
  2. => CommandBuffer

    commandBuffer is the command buffer into which this command will be recorded.

  3. -> io ()
#

vkCmdEndShaderInstrumentationARM - End shader instrumentation

Description

Once recorded, shader instrumentation is no longer considered active within the command buffer.

Valid Usage

  • Shader instrumentation must be active within commandBuffer

  • commandBuffer must not be a protected command buffer

Valid Usage (Implicit)

Host Synchronization

  • Host access to commandBuffer must be externally synchronized

  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Command Buffer Levels

Render Pass Scope

Video Coding Scope

Supported Queue Types

Command Type

Primary Secondary

Both

Outside

VK_QUEUE_COMPUTE_BIT VK_QUEUE_DATA_GRAPH_BIT_ARM VK_QUEUE_GRAPHICS_BIT

Action State

Conditional Rendering

vkCmdEndShaderInstrumentationARM is not affected by conditional rendering

See Also

VK_ARM_shader_instrumentation, CommandBuffer

valuegetShaderInstrumentationValuesARM
  1. :: MonadIO io
  2. => Device

    device is the logical device that was used to capture shader instrumentation data.

    device must be a valid Device handle

  3. -> ShaderInstrumentationARM

    instrumentation is the shader instrumentation object to retrieve values from

    instrumentation must be a valid ShaderInstrumentationARM handle

    instrumentation must have been created, allocated, or retrieved from device

  4. -> "metricValues" ::: Ptr ()

    pMetricValues is either NULL or a pointer to an application-allocated buffer where the results will be written.

    pMetricValues must be a pointer value

  5. -> ShaderInstrumentationValuesFlagsARM

    flags is reserved for future use.

    flags must be 0

  6. -> io (Result, "metricBlockCount" ::: Word32)
#

vkGetShaderInstrumentationValuesARM - Retrieve shader instrumentation data

Description

If pMetricValues is NULL, then the number of metric blocks available is returned in pMetricBlockCount. Otherwise, pMetricBlockCount must point to a variable set by the application to the number of elements in the pMetricValues array, and on return the variable is overwritten with the number of metric blocks actually written to pMetricValues. If pMetricBlockCount is less than the number of metric blocks available, at most pMetricBlockCount elements will be written, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not all the available metric blocks were returned.

Metrics are written to pMetricValues as a tightly packed array of metric blocks, where each block consists of a ShaderInstrumentationMetricDataHeaderARM header followed by PhysicalDeviceShaderInstrumentationPropertiesARM::numMetrics unsigned 64-bit values. The order of the metrics matches the order in which they are enumerated by enumeratePhysicalDeviceShaderInstrumentationMetricsARM.

Return Codes

Success
Failure

See Also

VK_ARM_shader_instrumentation, Device, ShaderInstrumentationARM, ShaderInstrumentationValuesFlagsARM

valueclearShaderInstrumentationMetricsARM
  1. :: MonadIO io
  2. => Device

    device is the logical device that owns the shader instrumentation object.

    device must be a valid Device handle

  3. -> ShaderInstrumentationARM

    instrumentation is the shader instrumentation object to clear.

    instrumentation must be a valid ShaderInstrumentationARM handle

    instrumentation must have been created, allocated, or retrieved from device

  4. -> io ()
#

vkClearShaderInstrumentationMetricsARM - Clear shader instrumentation metrics to zero

Valid Usage (Implicit)

See Also

VK_ARM_shader_instrumentation, Device, ShaderInstrumentationARM

VkPhysicalDeviceShaderInstrumentationFeaturesARM - Structure describing support for shader instrumentation

Description

If the PhysicalDeviceShaderInstrumentationFeaturesARM structure is included in the pNext chain of the PhysicalDeviceFeatures2 structure passed to getPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. If the application wishes to use a Device with any features described by PhysicalDeviceShaderInstrumentationFeaturesARM, it must add an instance of the structure, with the desired feature members set to TRUE, to the pNext chain of DeviceCreateInfo when creating the Device.

Structure Chaining

Extends the structures

See Also

VK_ARM_shader_instrumentation, Bool32, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkPhysicalDeviceShaderInstrumentationPropertiesARM - Structure describing shader instrumentation properties for a physical device

Members

The members of the PhysicalDeviceShaderInstrumentationPropertiesARM structure describe the following:

Description

If the PhysicalDeviceShaderInstrumentationPropertiesARM structure is included in the pNext chain of the PhysicalDeviceProperties2 structure passed to getPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property.

Structure Chaining

Extends the structure

See Also

VK_ARM_shader_instrumentation, Bool32, StructureType

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkShaderInstrumentationCreateInfoARM - Structure specifying parameters of a newly created shader instrumentation

Valid Usage (Implicit)

See Also

VK_ARM_shader_instrumentation, StructureType, createShaderInstrumentationARM

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkShaderInstrumentationMetricDescriptionARM - Structure specifying shader instrumentation metric properties

Valid Usage (Implicit)

See Also

VK_ARM_shader_instrumentation, StructureType, enumeratePhysicalDeviceShaderInstrumentationMetricsARM

Constructors

Instances5Show, Storable, FromCStruct, ToCStruct, Zero

VkShaderInstrumentationMetricDataHeaderARM - Structure describing the header of a metric block

Valid Usage (Implicit)

See Also

VK_ARM_shader_instrumentation, ShaderStageFlags

Constructors

Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero

VkShaderInstrumentationValuesFlagsARM - Reserved for future use

Description

ShaderInstrumentationValuesFlagsARM is a bitmask type for parameters to the retrieval, but is currently reserved for future use.

See Also

VK_ARM_shader_instrumentation, Flags, getShaderInstrumentationValuesARM

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …
newtypenewtype ShaderInstrumentationARM
#
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …
newtypenewtype ShaderCreateFlagBitsEXT
#

VkShaderCreateFlagBitsEXT - Bitmask controlling how a shader object is created

Description

See Also

VK_EXT_shader_object, ShaderCreateFlagsEXT

Instances8Eq, Ord, Read, Show, Bits, FiniteBits, …