// Copyright (c) 2019-2020 NVIDIA Corporation
//
// SPDX-License-Identifier: CC-BY-4.0

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

=== Other Extension Metadata

*Last Modified Date*::
    2019-05-28
*Interactions and External Dependencies*::
  - This extension provides API support for
    {GLSLregistry}/nv/GLSL_NV_shader_sm_builtins.txt[`GL_NV_shader_sm_builtins`]
*Contributors*::
  - Jeff Bolz, NVIDIA
  - Eric Werness, NVIDIA

=== Description

This extension provides the ability to determine device-specific properties
on NVIDIA GPUs.
It provides the number of streaming multiprocessors (SMs), the maximum
number of warps (subgroups) that can run on an SM, and shader builtins to
enable invocations to identify which SM and warp a shader invocation is
executing on.

This extension enables support for the SPIR-V code:ShaderSMBuiltinsNV
capability.

These properties and built-ins should: typically only be used for debugging
purposes.

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

=== New or Modified Built-In Variables

  * <<interfaces-builtin-variables-warpspersmnv,code:WarpsPerSMNV>>
  * <<interfaces-builtin-variables-smcountnv,code:SMCountNV>>
  * <<interfaces-builtin-variables-warpidnv,code:WarpIDNV>>
  * <<interfaces-builtin-variables-smidnv,code:SMIDNV>>

=== New SPIR-V Capabilities

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

=== Issues
. What should we call this extension?
+
--
*RESOLVED*: `NV_shader_sm_builtins`.
Other options considered included:

  * `NV_shader_smid` - but SMID is really easy to typo/confuse as SIMD.
  * `NV_shader_sm_info` - but *Info* is typically reserved for input
    structures
--


=== Version History

  * Revision 1, 2019-05-28 (Daniel Koch)
  ** Internal revisions


