Vulkan-Docs/doc/specs/vulkan/appendices/VK_KHR_shader_draw_parameters.txt
Jon Leech ca4abe0d34 Change log for January 23, 2017 Vulkan 1.0.39 spec update:
* Bump API patch number and header version number to 39 for this update.

Github Issues:

  * Clarified that only accesses via the specified buffer/image subresource
    ranges are included in the access scopes (public issue 306).
  * Add missing valid usage statements for flink:vkCreateComputePipelines
    and flink:vkCreateGraphicsPipelines (public issue 427).

Internal Issues:

  * Add a Note to the <<invariance,Invariance>> appendix about a difference
    between OpenGL and Vulkan with regards to how primitives derived from
    offsets are handled (internal issue 355).
  * Add the +<<VK_KHR_get_physical_device_properties2>>+,
    +<<VK_KHR_maintenance1>>+, and +<<VK_KHR_shader_draw_parameters>>+
    extensions (internal issue 448).
  * Add the +<<VK_EXT_shader_subgroup_vote>>+ and
    +<<VK_EXT_shader_subgroup_ballot>>+ extensions (internal issue 449).
  * Update the texture level-of-detail equation in the
    <<textures-scale-factor,Scale Factor Operation>> section to better
    approximate the ellipse major and minor axes (internal issue 547).
  * Forbid non-explicitly allowed uses of interface decorations in the
    introduction to the <<interfaces,Shader Interfaces>> chapter (internal
    issue 607).
  * Replace use of MathJax with KaTeX, for improved load-time performance as
    well as avoiding the scrolling-and-scrolling behavior due to MathJax
    asynchronous rendering when loading at an anchor inside the spec. This
    change also requires moving to HTML5 output for the spec instead of
    XHTML, and there is a visible difference in that the chapter navigation
    index is now in a scrollable sidebar instead of at the top of the
    document. We may or may not retain the nav sidebar based on feedback
    (internal issue 613).
  * Improve consistency of markup and formatting in extension appendices
    (internal issue 631).

Other Issues:

  * Add explicit valid usage statements to slink:VkImageCopy requiring that
    the source and destination layer ranges be contained in their respective
    source and destination images.
  * Add valid usage language for swapchain of flink:vkAcquireNextImage. If
    the swapchain has been replaced, then it should not be passed to
    flink:vkAcquireNextImage.
  * Add a valid usage statement to flink:vkCreateImageView, that the image
    must have been created with an appropriate usage bit set.
  * Noted that slink:VkDisplayPresentInfoKHR is a valid extension of
    slink:VkPresentInfoKHR in the <<wsi_swapchain,WSI Swapchain>> section.
  * Update valid usage for flink:vkCmdSetViewport and flink:vkCmdSetScissor
    to account for the multiple viewport feature. If the feature is not
    enabled, the parameters for these functions have required values that
    are defined in the <<features-features-multiViewport,multiple
    viewports>> section of the spec but were not reflected in the valid
    usage text for these functions.
  * Add the +<<VK_EXT_swapchain_colorspace>>+ extension defining common
    color spaces.
2017-01-17 20:11:25 -08:00

117 lines
3.1 KiB
Plaintext

// Copyright (c) 2016-2017 The Khronos Group Inc.
// Copyright notice at https://www.khronos.org/registry/speccopyright.html
[[VK_KHR_shader_draw_parameters]]
== VK_KHR_shader_draw_parameters
*Name String*::
+VK_KHR_shader_draw_parameters+
*Extension Type*::
Device extension
*Registered Extension Number*::
64
*Status*::
Complete
*Last Modified Data*::
2016-10-05
*Revision*::
1
*IP Status*::
No known IP claims.
*Dependencies*::
- This extension is written against version 1.0 of the Vulkan API.
- Requires Vulkan 1.0.
- Requires the +SPV_KHR_shader_draw_parameters+ SPIR-V extension.
- Requires +GL_ARB_shader_draw_parameters+ for GLSL source languages.
*Contributors*::
- Daniel Koch, NVIDIA Corporation
- Jeff Bolz, NVIDIA
- Daniel Rakos, AMD
- Jan-Harald Fredriksen, ARM
- John Kessenich, Google
- Stuart Smith, IMG
*Contact*::
- Daniel Koch (dkoch 'at' nvidia.com)
*Overview*::
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 firstInstance parameter passed to
draw commands,
* code:BaseVertex, which contains the firstVertex/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-table-drawparameters,DrawParameters>>
=== 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 baseVertex parameter, the value of
code:gl_BaseVertexARB is zero.
This means that code:gl_BaseVertexARB = baseVertex (for code:glDrawElements
commands with baseVertex) or 0.
In particular there are no code:glDrawArrays commands that take a baseVertex
parameter.
Now in Vulkan, we have *BaseVertex* = _vertexOffset_ (for indexed drawing
commands) or _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