// Copyright 2017-2024 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

include::{generated}/meta/{refprefix}VK_KHR_shader_clock.adoc[]

=== Other Extension Metadata

*Last Modified Date*::
    2019-4-25
*IP Status*::
    No known IP claims.
*Interactions and External Dependencies*::
  - This extension provides API support for
    {GLregistry}/ARB/ARB_shader_clock.txt[`GL_ARB_shader_clock`] and
    {GLSLregistry}/ext/GL_EXT_shader_realtime_clock.txt[`GL_EXT_shader_realtime_clock`]
*Contributors*::
  - Aaron Hagan, AMD
  - Daniel Koch, NVIDIA

=== Description

This extension advertises the SPIR-V code:ShaderClockKHR capability for
Vulkan, which allows a shader to query a real-time or monotonically
incrementing counter at the subgroup level or across the device level.
The two valid SPIR-V scopes for code:OpReadClockKHR are code:Subgroup and
code:Device.

When using GLSL source-based shading languages, the code:clockRealtime*EXT()
timing functions map to the code:OpReadClockKHR instruction with a scope of
code:Device, and the code:clock*ARB() timing functions map to the
code:OpReadClockKHR instruction with a scope of code:Subgroup.

include::{generated}/interfaces/VK_KHR_shader_clock.adoc[]

=== New SPIR-V Capabilities

  * <<spirvenv-capabilities-table-ShaderClockKHR, code:ShaderClockKHR>>

=== Version History

  * Revision 1, 2019-4-25 (Aaron Hagan)
  ** Initial revision
