Vulkan-Docs/doc/specs/vulkan/appendices/VK_KHR_shader_draw_paramete...

118 lines
3.2 KiB
Plaintext
Raw Normal View History

Change log for June 24, 2017 Vulkan 1.0.53 spec update: * Bump API patch number and header version number to 53 for this update. Github Issues: Internal Issues: * Clarify mappings of coordinates for mutable, compatible image views in slink:VkImageViewCreateInfo (internal issue 815). * Make ename:VK_BIND_SFR_BIT require a logical device with multiple physical devices, so that standard sparse image block dimensions are only required on systems that support multi-GPU (internal issue 835). * Convert all files from use of // refBegin .. // refEnd comments to delimit ref pages, to use of open blocks, and update style guide accordingly (internal issue 839). * Add valid usage for slink:VkWriteDescriptorSet when performing updates to a ename:VK_STORAGE_IMAGE descriptor with layout ename:VK_IMAGE_LAYOUT_GENERAL. * Add a hack to the validity generator script to support an odd interaction between flink:vkCmdFillBuffer and an extension (internal issue 853). * Remove redundant text describing slink:VkBufferCreateInfo::pname:usage, which was already covered by implicit valid usage (internal issue 854). * Update implicit validity generator script to properly handle the pname:sType and pname:pNext members of "returnedonly" structures (internal issue 874). * Note that slink:VkApplicationInfo::pname:pApplicationName & slink:VkApplicationInfo::pname:pEngineName are optional, and add missing implicit valid usage statements for flink:vkDestroyInstance. * Added missing valid usage for flink:vkCmdWriteTimestamp to require a timestamp query pool. * Simplify and/or split "`non-atomic`" valid usage statements. New Extensions: * `VK_AMD_gpu_shader_int16` * `VK_EXT_blend_operation_advanced` * `VK_EXT_sampler_filter_minmax` * `VK_NV_framebuffer_mixed_samples` ----------------------------------------------------- Note: the 1.0.52 spec wasn't published on github, so the 1.0.53 release combines both change sets. ----------------------------------------------------- Change log for June 13, 2017 Vulkan 1.0.52 spec update: * Bump API patch number and header version number to 52 for this update. Github Issues: Internal Issues: * Clarify behavior when non-coherent memory has <<memory-device-unmap-does-not-flush, not been flushed before being unmapped>> (internal issue 819). * Fix description of code:WorkgroupSize builtin to note it decorates an object, not a variable (internal issue 836). * Fix asciidoc attributes so that trailing '{plus}' symbols in [eq] style equations are rendered properly (internal issue 845). * Add language to the "`Extension Handles, Objects, Enums, and Typedefs`" section of the Procedures and Conventions document stating that any new handle type requires a corresponding entry in the elink:VkObjectType enumerated type (internal issue 856). * Update style guide to use slink macro for Vulkan handle type names, and define narrow conditions under which to use the *name and *text macros instead of *link (internal issue 886). * Add a dependency of the <<VK_KHX_device_group,VK_KHX_device_group>> extension on VK_KHX_device_group_creation to +vk.xml+ and the extension appendix. * Change the copyright on Vulkan specification asciidoc *source* files to CC-BY 4.0, and update the proprietary Khronos copyright applied to the generated *output* formats (internal issue 327). This enables broader re-use and modification of the Vulkan specification sources, while not affecting the Reciprocal IP License between Vulkan Adopters and Working Group Members. New Extensions: * `VK_NV_fill_rectangle` * `VK_NV_fragment_coverage_to_color`
2017-06-27 02:32:10 +00:00
// Copyright (c) 2016-2017 Khronos Group. This work is licensed under a
// Creative Commons Attribution 4.0 International License; see
// http://creativecommons.org/licenses/by/4.0/
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-18 04:11:25 +00:00
[[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