Vulkan-Docs/appendices/VK_KHR_shader_draw_parameters.txt
Jon Leech 521e98405f Change log for August 17, 2019 Vulkan 1.1.120 spec update:
* Update release number to 120.

Github Issues:

  * Add slink:VkAccelerationStructureTypeNV explicitly to extension XML for
    `<<VK_NV_ray_tracing>>` (public issue 848).
  * Add missing valid usage statements for feature flags in
    slink:VkCommandBufferInheritanceInfo (public pull request 1017).

Internal Issues:

  * Clarify behavior of non-premultiplied destination colors for
    `<<VK_EXT_blend_operation_advanced>>` prior to the definition of
    slink:VkBlendOverlapEXT (internal issue 1766).
  * Fix the confusing phrasing "`no other queue must: be (doing something)`"
    for flink:vkQueuePresentKHR, flink:vkQueueSubmit, and
    flink:vkQueueBindSparse (internal issue 1774).
  * Add `<<VK_EXT_validation_features>>` flag to enable best practices
    checks, which will soon be available in the validation layer (internal
    issue 1779).
  * Specify allowed characters for VUID tag name components in the style
    guide (internal issue 1788).
  * Update links to SPIR-V extension specifications, and parameterize their
    markup in case the URLs change in the future (internal issue 1797).
  * Fix an off-by-one error in the valid usage statement for
    slink:VkPipelineExecutableInfoKHR (internal merge request 3303).
  * Clean up markup indentation not matching the style guide (internal merge
    request 3314).
  * Minor script updates to allow refpage aliases, generate a dynamic TOC
    for refpages, generate Apache rewrite rules for aliases, open external
    links from refpages in a new window, and synchronize with the OpenCL
    scripts. This will shortly enable a paned navigation setup for refpages,
    similar to the OpenCL 2.2 refpages (internal merge request 3322).
  * Script updates to add tests to the checker, refactor and reformat code,
    generate better text for some valid usage statements, use more Pythonic
    idioms, and synchronize with the OpenXR scripts (internal merge request
    3239).
  * Script updates and minor fixes in spec language to not raise checker
    errors for refpage markup of pages not existing in the API, such as
    VKAPI_NO_STDINT_H. Remove corresponding suppression of some
    check_spec_links.py tests from .gitlab-ci.yml and 'allchecks' target
    (internal merge request 3315).
2019-08-17 15:33:21 -07:00

110 lines
3.3 KiB
Plaintext

// Copyright (c) 2016-2019 Khronos Group. This work is licensed under a
// Creative Commons Attribution 4.0 International License; see
// http://creativecommons.org/licenses/by/4.0/
include::meta/VK_KHR_shader_draw_parameters.txt[]
*Last Modified Date*::
2017-09-05
*IP Status*::
No known IP claims.
*Interactions and External Dependencies*::
- Requires the
{spirv}/KHR/SPV_KHR_shader_draw_parameters.html[`SPV_KHR_shader_draw_parameters`]
SPIR-V extension.
- Requires
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_draw_parameters.txt[`GL_ARB_shader_draw_parameters`]
for GLSL source languages.
- Promoted to Vulkan 1.1 Core
*Contributors*::
- Daniel Koch, NVIDIA Corporation
- Jeff Bolz, NVIDIA
- Daniel Rakos, AMD
- Jan-Harald Fredriksen, ARM
- John Kessenich, Google
- Stuart Smith, IMG
This extension adds support for the following SPIR-V extension in Vulkan:
* `SPV_KHR_shader_draw_parameters`
The extension provides access to three additional built-in shader variables
in Vulkan:
* code:BaseInstance, which contains the pname:firstInstance parameter
passed to draw commands,
* code:BaseVertex, which contains the pname:firstVertex/pname:vertexOffset
parameter passed to draw commands, and
* code:DrawIndex, which contains the index of the draw call currently
being processed from an indirect draw call.
When using GLSL source-based shader languages, the following variables from
`GL_ARB_shader_draw_parameters` can map to these SPIR-V built-in
decorations:
* `in int gl_BaseInstanceARB;` -> code:BaseInstance,
* `in int gl_BaseVertexARB;` -> code:BaseVertex, and
* `in int gl_DrawIDARB;` -> code:DrawIndex.
=== New Object Types
None.
=== New Enum Constants
None.
=== New Enums
None.
=== New Structures
None.
=== New Functions
None.
=== New Built-In Variables
* <<interfaces-builtin-variables-baseinstance,code:BaseInstance>>
* <<interfaces-builtin-variables-basevertex,code:BaseVertex>>
* <<interfaces-builtin-variables-drawindex,code:DrawIndex>>
=== New SPIR-V Capabilities
* <<spirvenv-capabilities,DrawParameters>>
=== Promotion to Vulkan 1.1
All functionality in this extension is included in core Vulkan 1.1, however
a <<features-shaderDrawParameters,feature bit was added>> to distinguish
whether it is actually available or not.
=== Issues
1) Is this the same functionality as `GL_ARB_shader_draw_parameters`?
*RESOLVED*: It's actually a superset as it also adds in support for arrayed
drawing commands.
In GL for `GL_ARB_shader_draw_parameters`, code:gl_BaseVertexARB holds the
integer value passed to the parameter to the command that resulted in the
current shader invocation.
In the case where the command has no code:baseVertex parameter, the value of
code:gl_BaseVertexARB is zero.
This means that code:gl_BaseVertexARB = code:baseVertex (for
code:glDrawElements commands with code:baseVertex) or 0.
In particular there are no code:glDrawArrays commands that take a
code:baseVertex parameter.
Now in Vulkan, we have code:BaseVertex = pname:vertexOffset (for indexed
drawing commands) or pname:firstVertex (for arrayed drawing commands), and
so Vulkan's version is really a superset of GL functionality.
=== Version History
* Revision 1, 2016-10-05 (Daniel Koch)
- Internal revisions