Vulkan-Docs/doc/specs/vulkan/chapters/extensions.txt

189 lines
8.9 KiB
Plaintext
Raw Normal View History

2016-02-16 09:53:44 +00:00
// Copyright (c) 2015-2016 The Khronos Group Inc.
// Copyright notice at https://www.khronos.org/registry/speccopyright.html
[[extended-functionality]]
= Extended Functionality
Additional functionality may: be provided by layers or extensions. A layer
cannot: add or modify {apiname} commands, while an extension may: do so.
There are two kinds of layers and extensions, instance and device. Instance
layers and extensions are general purpose and do not depend on a specific
device. Device layers and extensions operate on specific devices, and
require a valid sname:VkDevice to be used. Instance extensions usually
affect the operation of the API as a whole, whereas device layers and
extensions tend to be hardware-specific. Examples of these might be:
* Whole API validation is an example of a good instance layer.
* Debug capabilities might make a good instance extension.
* A layer that provides hardware-specific performance telemetry and
analysis could be a device layer.
* Functions to allow an application to use additional hardware features
beyond the core would be a good candidate for a device extension.
[[extended-functionality-layers]]
== Layers
When a layer is enabled, it inserts itself into the call chain for {apiname}
commands the layer is interested in. A common use of layers is to validate
application behavior during development. For example, the implementation
will not check that {apiname} enums used by the application fall within
allowed ranges. Instead, a validation layer would do those checks and flag
issues. This avoids a performance penalty during production use of the
application because those layers would not be enabled in production.
To query the available instance layers, call:
include::../protos/vkEnumerateInstanceLayerProperties.txt[]
Change log for February 25, 2015 Vulkan 1.0.4 spec update: * Bump API patch number from 3 to 4 for the first public update to the spec. Add patch number to the spec title (this will be done automatically from XML, later). * Fixes for numerous editorial issues. Regularize descriptions of variable-length array queries. Properly tag enumerants so they come out in the right font (many were mislabeled in usage tags in vk.xml, or not tagged). Spelling and markup corrections (public issue 4). * Fix typos and clearly separate description of different types of memory areas (public issue 5). * Use standards-compliant preprocessor guard symbols on headers (public issue 7). * Note that Github users can't currently set labels on issues, and recommend a fallback approach (public issue 15). * Use latexmath prefix on len= attributes (public issue 29). * Make flink:vkCmdUpdateBuffer pname:dataSize limit consistent (public issue 65). * Add VK_KHR_mirror_clamp_to_edge extension to core API branch, as an optional feature not introducing new commands or enums (internal issue 104). * Cleanup invariance language inherited from the GL specification to not refer to nonexistent (GL-specific) state (internal issue 111). * Modify the flink:vkCmdDrawIndexed pname:vertexOffset definition to not be the "base offset within the index buffer" but rather the "value added to the vertex index before indexing into the vertex buffer" (internal issue 118). * Fix drawing chapter in the "Programmable Primitive Shading" section where it described categories of drawing commands. It referenced flink:vkCmdDrawIndexed twice. Replace the second reference with flink:vkCmdDrawIndexedIndirect (internal issue 119). * Typo fixed in <<sparsememory-examples-advanced,Advanced Sparse Resources>> sparse memory example (internal issue 122). * Add flink:VkDisplayPlaneAlphaFlagsKHR to <require> section of VK_KHR_display extension (internal issue 125) * Add missing optional="false,true" to flink:vkGetImageSparseMemoryRequirements pname:pSparseMemoryRequirementCount parameter (internal issue 132) * Rename ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT to ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT (internal issue 133) * Fix a handful of broken cross-references in the <<samplers,Samplers>> chapter (internal issue 134). * Fix "Input Attachement" GLSL example to use correct syntax (internal issue 135). * Update XML schema and documentation to accomodate recently added attributes for validity. Add some introductory material describing design choices and pointing to the public repository to file issues. * Put include of validity in the core spec extensions chapter on its own line, so that asciidoc is happy. * Fix vertexOffset language to specify that it's the value added to the vertex index before indexing into the vertex buffer, not the base offset within the index buffer. * Fix error in the description of flink:vkCmdNextSubpass.
2016-02-25 06:02:34 +00:00
* pname:pPropertyCount is a pointer to an integer related to the number of
layer properties available or queried, as described below.
* pname:pProperties is either `NULL` or a pointer to an array of
slink:VkLayerProperties structures.
2016-02-16 09:53:44 +00:00
include::../validity/protos/vkEnumerateInstanceLayerProperties.txt[]
To enable a instance layer, the name of the layer should be added to the
pname:ppEnabledLayerNames member of slink:VkInstanceCreateInfo when creating
a slink:VkInstance.
To query the layers available to a given physical device, call:
include::../protos/vkEnumerateDeviceLayerProperties.txt[]
* pname:physicalDevice is the physical device that will be queried.
Change log for February 25, 2015 Vulkan 1.0.4 spec update: * Bump API patch number from 3 to 4 for the first public update to the spec. Add patch number to the spec title (this will be done automatically from XML, later). * Fixes for numerous editorial issues. Regularize descriptions of variable-length array queries. Properly tag enumerants so they come out in the right font (many were mislabeled in usage tags in vk.xml, or not tagged). Spelling and markup corrections (public issue 4). * Fix typos and clearly separate description of different types of memory areas (public issue 5). * Use standards-compliant preprocessor guard symbols on headers (public issue 7). * Note that Github users can't currently set labels on issues, and recommend a fallback approach (public issue 15). * Use latexmath prefix on len= attributes (public issue 29). * Make flink:vkCmdUpdateBuffer pname:dataSize limit consistent (public issue 65). * Add VK_KHR_mirror_clamp_to_edge extension to core API branch, as an optional feature not introducing new commands or enums (internal issue 104). * Cleanup invariance language inherited from the GL specification to not refer to nonexistent (GL-specific) state (internal issue 111). * Modify the flink:vkCmdDrawIndexed pname:vertexOffset definition to not be the "base offset within the index buffer" but rather the "value added to the vertex index before indexing into the vertex buffer" (internal issue 118). * Fix drawing chapter in the "Programmable Primitive Shading" section where it described categories of drawing commands. It referenced flink:vkCmdDrawIndexed twice. Replace the second reference with flink:vkCmdDrawIndexedIndirect (internal issue 119). * Typo fixed in <<sparsememory-examples-advanced,Advanced Sparse Resources>> sparse memory example (internal issue 122). * Add flink:VkDisplayPlaneAlphaFlagsKHR to <require> section of VK_KHR_display extension (internal issue 125) * Add missing optional="false,true" to flink:vkGetImageSparseMemoryRequirements pname:pSparseMemoryRequirementCount parameter (internal issue 132) * Rename ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT to ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT (internal issue 133) * Fix a handful of broken cross-references in the <<samplers,Samplers>> chapter (internal issue 134). * Fix "Input Attachement" GLSL example to use correct syntax (internal issue 135). * Update XML schema and documentation to accomodate recently added attributes for validity. Add some introductory material describing design choices and pointing to the public repository to file issues. * Put include of validity in the core spec extensions chapter on its own line, so that asciidoc is happy. * Fix vertexOffset language to specify that it's the value added to the vertex index before indexing into the vertex buffer, not the base offset within the index buffer. * Fix error in the description of flink:vkCmdNextSubpass.
2016-02-25 06:02:34 +00:00
* pname:pPropertyCount is a pointer to an integer related to the number of
layer properties available or queried, as described below.
* pname:pProperties is either `NULL` or a pointer to an array of
slink:VkLayerProperties structures.
2016-02-16 09:53:44 +00:00
include::../validity/protos/vkEnumerateDeviceLayerProperties.txt[]
To enable a device layer, the name of the layer should be added to the
pname:ppEnabledLayerNames member of slink:VkDeviceCreateInfo when creating
a slink:VkDevice.
Change log for February 25, 2015 Vulkan 1.0.4 spec update: * Bump API patch number from 3 to 4 for the first public update to the spec. Add patch number to the spec title (this will be done automatically from XML, later). * Fixes for numerous editorial issues. Regularize descriptions of variable-length array queries. Properly tag enumerants so they come out in the right font (many were mislabeled in usage tags in vk.xml, or not tagged). Spelling and markup corrections (public issue 4). * Fix typos and clearly separate description of different types of memory areas (public issue 5). * Use standards-compliant preprocessor guard symbols on headers (public issue 7). * Note that Github users can't currently set labels on issues, and recommend a fallback approach (public issue 15). * Use latexmath prefix on len= attributes (public issue 29). * Make flink:vkCmdUpdateBuffer pname:dataSize limit consistent (public issue 65). * Add VK_KHR_mirror_clamp_to_edge extension to core API branch, as an optional feature not introducing new commands or enums (internal issue 104). * Cleanup invariance language inherited from the GL specification to not refer to nonexistent (GL-specific) state (internal issue 111). * Modify the flink:vkCmdDrawIndexed pname:vertexOffset definition to not be the "base offset within the index buffer" but rather the "value added to the vertex index before indexing into the vertex buffer" (internal issue 118). * Fix drawing chapter in the "Programmable Primitive Shading" section where it described categories of drawing commands. It referenced flink:vkCmdDrawIndexed twice. Replace the second reference with flink:vkCmdDrawIndexedIndirect (internal issue 119). * Typo fixed in <<sparsememory-examples-advanced,Advanced Sparse Resources>> sparse memory example (internal issue 122). * Add flink:VkDisplayPlaneAlphaFlagsKHR to <require> section of VK_KHR_display extension (internal issue 125) * Add missing optional="false,true" to flink:vkGetImageSparseMemoryRequirements pname:pSparseMemoryRequirementCount parameter (internal issue 132) * Rename ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT to ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT (internal issue 133) * Fix a handful of broken cross-references in the <<samplers,Samplers>> chapter (internal issue 134). * Fix "Input Attachement" GLSL example to use correct syntax (internal issue 135). * Update XML schema and documentation to accomodate recently added attributes for validity. Add some introductory material describing design choices and pointing to the public repository to file issues. * Put include of validity in the core spec extensions chapter on its own line, so that asciidoc is happy. * Fix vertexOffset language to specify that it's the value added to the vertex index before indexing into the vertex buffer, not the base offset within the index buffer. * Fix error in the description of flink:vkCmdNextSubpass.
2016-02-25 06:02:34 +00:00
For both flink:vkEnumerateInstanceLayerProperties and
flink:vkEnumerateDeviceLayerProperties, if pname:pProperties is `NULL`, then
the number of layer properties available is returned in pname:pPropertyCount.
Otherwise, pname:pPropertyCount must: point to a variable set by the user to
the number of elements in the pname:pProperties array, and on return the
variable is overwritten with the number of structures actually written to
pname:pProperties. If the value of pname:pPropertyCount is less than the
number of layer properties available, at most pname:pPropertyCount
structures will be written. If pname:pPropertyCount is smaller than the
number of layers available, ename:VK_INCOMPLETE will be returned instead of
ename:VK_SUCCESS, to indicate that not all the available properties were
returned.
2016-02-16 09:53:44 +00:00
The definition of sname:VkLayerProperties is:
include::../structs/VkLayerProperties.txt[]
* pname:layerName is a null-terminated string specifying the name of the
layer. Use this name in the pname:ppEnabledLayerNames array in the
sname:VkInstanceCreateInfo given to fname:vkCreateInstance to enable
this layer in the instance.
* pname:apiVersion is the {apiname} version the layer was written to,
encoded as described in the <<fundamentals-versionnum,API Version
Numbers and Semantics>> section.
* pname:implementationVersion is the version of this layer. It is an
integer, increasing with backward compatible changes.
* pname:description is a null-terminated string providing additional
details that can: be used by the application to identify the layer.
include::../validity/structs/VkLayerProperties.txt[]
Loader implementations may: provide mechanisms outside the {apiname} API for
enabling specific layers. Layers enabled through such a mechanism are
_implicitly enabled_, while layers enabled by including the layer name in
the pname:ppEnabledLayerNames member of slink:VkDeviceCreateInfo are
_explicitly enabled_. Except where otherwise specified, implicitly enabled
and explicitly enabled layers differ only in the way they are enabled.
Explicitly enabling a layer that is implicitly enabled has no additional
effect.
[[extended-functionality-extensions]]
== Extensions
Extensions may: define new {apiname} commands, structures, and enumerants.
For compilation purposes, the interfaces defined by registered extensions,
including new structures and enumerants as well as function pointer types
for new commands, are defined in the Khronos-supplied +vulkan.h+ together
with the core API. However, commands defined by extensions maynot: be
available for static linking - in which case function pointers to these
commands should: be queried at runtime as described in
<<initialization-functionpointers>>. Extensions may: be provided by layers
as well as by a {apiname} implementation.
To query the available instance extensions, call:
include::../protos/vkEnumerateInstanceExtensionProperties.txt[]
* pname:pLayerName is either `NULL` or the name of a instance layer to
retrieve extensions from.
Change log for February 25, 2015 Vulkan 1.0.4 spec update: * Bump API patch number from 3 to 4 for the first public update to the spec. Add patch number to the spec title (this will be done automatically from XML, later). * Fixes for numerous editorial issues. Regularize descriptions of variable-length array queries. Properly tag enumerants so they come out in the right font (many were mislabeled in usage tags in vk.xml, or not tagged). Spelling and markup corrections (public issue 4). * Fix typos and clearly separate description of different types of memory areas (public issue 5). * Use standards-compliant preprocessor guard symbols on headers (public issue 7). * Note that Github users can't currently set labels on issues, and recommend a fallback approach (public issue 15). * Use latexmath prefix on len= attributes (public issue 29). * Make flink:vkCmdUpdateBuffer pname:dataSize limit consistent (public issue 65). * Add VK_KHR_mirror_clamp_to_edge extension to core API branch, as an optional feature not introducing new commands or enums (internal issue 104). * Cleanup invariance language inherited from the GL specification to not refer to nonexistent (GL-specific) state (internal issue 111). * Modify the flink:vkCmdDrawIndexed pname:vertexOffset definition to not be the "base offset within the index buffer" but rather the "value added to the vertex index before indexing into the vertex buffer" (internal issue 118). * Fix drawing chapter in the "Programmable Primitive Shading" section where it described categories of drawing commands. It referenced flink:vkCmdDrawIndexed twice. Replace the second reference with flink:vkCmdDrawIndexedIndirect (internal issue 119). * Typo fixed in <<sparsememory-examples-advanced,Advanced Sparse Resources>> sparse memory example (internal issue 122). * Add flink:VkDisplayPlaneAlphaFlagsKHR to <require> section of VK_KHR_display extension (internal issue 125) * Add missing optional="false,true" to flink:vkGetImageSparseMemoryRequirements pname:pSparseMemoryRequirementCount parameter (internal issue 132) * Rename ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT to ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT (internal issue 133) * Fix a handful of broken cross-references in the <<samplers,Samplers>> chapter (internal issue 134). * Fix "Input Attachement" GLSL example to use correct syntax (internal issue 135). * Update XML schema and documentation to accomodate recently added attributes for validity. Add some introductory material describing design choices and pointing to the public repository to file issues. * Put include of validity in the core spec extensions chapter on its own line, so that asciidoc is happy. * Fix vertexOffset language to specify that it's the value added to the vertex index before indexing into the vertex buffer, not the base offset within the index buffer. * Fix error in the description of flink:vkCmdNextSubpass.
2016-02-25 06:02:34 +00:00
* pname:pPropertyCount is a pointer to an integer related to the number of
extension properties available or queried, as described below.
* pname:pProperties is either `NULL` or a pointer to an array of
slink:VkExtensionProperties structures.
include::../validity/protos/vkEnumerateInstanceExtensionProperties.txt[]
Any instance extensions provided by the {apiname} implementation or by
2016-02-16 09:53:44 +00:00
implicitly enabled layers, but not by explicitly enabled layers, are
returned when pname:pLayerName parameter is `NULL`. When pname:pLayerName is
the name of a layer, the instance extensions provided by that layer are
returned.
To enable a instance extension, the name of the extension should be added to
the pname:ppEnabledExtensionNames member of slink:VkInstanceCreateInfo when
creating a slink:VkInstance.
To query the extensions available to a given physical device, call:
include::../protos/vkEnumerateDeviceExtensionProperties.txt[]
* pname:physicalDevice is the physical device that will be queried.
* pname:pLayerName is either `NULL` or the name of a device layer to
retrieve extensions from.
Change log for February 25, 2015 Vulkan 1.0.4 spec update: * Bump API patch number from 3 to 4 for the first public update to the spec. Add patch number to the spec title (this will be done automatically from XML, later). * Fixes for numerous editorial issues. Regularize descriptions of variable-length array queries. Properly tag enumerants so they come out in the right font (many were mislabeled in usage tags in vk.xml, or not tagged). Spelling and markup corrections (public issue 4). * Fix typos and clearly separate description of different types of memory areas (public issue 5). * Use standards-compliant preprocessor guard symbols on headers (public issue 7). * Note that Github users can't currently set labels on issues, and recommend a fallback approach (public issue 15). * Use latexmath prefix on len= attributes (public issue 29). * Make flink:vkCmdUpdateBuffer pname:dataSize limit consistent (public issue 65). * Add VK_KHR_mirror_clamp_to_edge extension to core API branch, as an optional feature not introducing new commands or enums (internal issue 104). * Cleanup invariance language inherited from the GL specification to not refer to nonexistent (GL-specific) state (internal issue 111). * Modify the flink:vkCmdDrawIndexed pname:vertexOffset definition to not be the "base offset within the index buffer" but rather the "value added to the vertex index before indexing into the vertex buffer" (internal issue 118). * Fix drawing chapter in the "Programmable Primitive Shading" section where it described categories of drawing commands. It referenced flink:vkCmdDrawIndexed twice. Replace the second reference with flink:vkCmdDrawIndexedIndirect (internal issue 119). * Typo fixed in <<sparsememory-examples-advanced,Advanced Sparse Resources>> sparse memory example (internal issue 122). * Add flink:VkDisplayPlaneAlphaFlagsKHR to <require> section of VK_KHR_display extension (internal issue 125) * Add missing optional="false,true" to flink:vkGetImageSparseMemoryRequirements pname:pSparseMemoryRequirementCount parameter (internal issue 132) * Rename ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT to ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT (internal issue 133) * Fix a handful of broken cross-references in the <<samplers,Samplers>> chapter (internal issue 134). * Fix "Input Attachement" GLSL example to use correct syntax (internal issue 135). * Update XML schema and documentation to accomodate recently added attributes for validity. Add some introductory material describing design choices and pointing to the public repository to file issues. * Put include of validity in the core spec extensions chapter on its own line, so that asciidoc is happy. * Fix vertexOffset language to specify that it's the value added to the vertex index before indexing into the vertex buffer, not the base offset within the index buffer. * Fix error in the description of flink:vkCmdNextSubpass.
2016-02-25 06:02:34 +00:00
* pname:pPropertyCount is a pointer to an integer related to the number of
extension properties available or queried, as described below.
* pname:pProperties is either `NULL` or a pointer to an array of
slink:VkExtensionProperties structures.
2016-02-16 09:53:44 +00:00
include::../validity/protos/vkEnumerateDeviceExtensionProperties.txt[]
Any device extensions provided by the {apiname} implementation or by
implicitly enabled layers, but not by explicitly enabled layers, are
returned when pname:pLayerName parameter is `NULL`. When pname:pLayerName is
the name of a layer, the device extensions provided by that layer are
returned.
To enable a device layer, the name of the layer should be added to the
pname:ppEnabledExtensionNames member of slink:VkDeviceCreateInfo when
creating a slink:VkDevice.
Change log for February 25, 2015 Vulkan 1.0.4 spec update: * Bump API patch number from 3 to 4 for the first public update to the spec. Add patch number to the spec title (this will be done automatically from XML, later). * Fixes for numerous editorial issues. Regularize descriptions of variable-length array queries. Properly tag enumerants so they come out in the right font (many were mislabeled in usage tags in vk.xml, or not tagged). Spelling and markup corrections (public issue 4). * Fix typos and clearly separate description of different types of memory areas (public issue 5). * Use standards-compliant preprocessor guard symbols on headers (public issue 7). * Note that Github users can't currently set labels on issues, and recommend a fallback approach (public issue 15). * Use latexmath prefix on len= attributes (public issue 29). * Make flink:vkCmdUpdateBuffer pname:dataSize limit consistent (public issue 65). * Add VK_KHR_mirror_clamp_to_edge extension to core API branch, as an optional feature not introducing new commands or enums (internal issue 104). * Cleanup invariance language inherited from the GL specification to not refer to nonexistent (GL-specific) state (internal issue 111). * Modify the flink:vkCmdDrawIndexed pname:vertexOffset definition to not be the "base offset within the index buffer" but rather the "value added to the vertex index before indexing into the vertex buffer" (internal issue 118). * Fix drawing chapter in the "Programmable Primitive Shading" section where it described categories of drawing commands. It referenced flink:vkCmdDrawIndexed twice. Replace the second reference with flink:vkCmdDrawIndexedIndirect (internal issue 119). * Typo fixed in <<sparsememory-examples-advanced,Advanced Sparse Resources>> sparse memory example (internal issue 122). * Add flink:VkDisplayPlaneAlphaFlagsKHR to <require> section of VK_KHR_display extension (internal issue 125) * Add missing optional="false,true" to flink:vkGetImageSparseMemoryRequirements pname:pSparseMemoryRequirementCount parameter (internal issue 132) * Rename ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT to ename:VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT (internal issue 133) * Fix a handful of broken cross-references in the <<samplers,Samplers>> chapter (internal issue 134). * Fix "Input Attachement" GLSL example to use correct syntax (internal issue 135). * Update XML schema and documentation to accomodate recently added attributes for validity. Add some introductory material describing design choices and pointing to the public repository to file issues. * Put include of validity in the core spec extensions chapter on its own line, so that asciidoc is happy. * Fix vertexOffset language to specify that it's the value added to the vertex index before indexing into the vertex buffer, not the base offset within the index buffer. * Fix error in the description of flink:vkCmdNextSubpass.
2016-02-25 06:02:34 +00:00
For both flink:vkEnumerateInstanceExtensionProperties and
flink:vkEnumerateDeviceExtensionProperties, if pname:pProperties is `NULL`,
then the number of extensions properties available is returned in
pname:pPropertyCount. Otherwise, pname:pPropertyCount must: point to a
variable set by the user to the number of elements in the pname:pProperties
array, and on return the variable is overwritten with the number of
structures actually written to pname:pProperties. If the value of
pname:pPropertyCount is less than the number of extension properties
available, at most pname:pPropertyCount structures will be written. If
pname:pPropertyCount is smaller than the number of extensions available,
ename:VK_INCOMPLETE will be returned instead of ename:VK_SUCCESS, to
indicate that not all the available properties were returned.
2016-02-16 09:53:44 +00:00
The definition of sname:VkExtensionProperties is:
include::../structs/VkExtensionProperties.txt[]
* pname:extensionName is a null-terminated string specifying the name of
the extension.
* pname:specVersion is the version of this extension. It is an integer,
incremented with backward compatible changes.
include::../validity/structs/VkExtensionProperties.txt[]