2016-08-28 10:47:19 +00:00
|
|
|
== VK_NV_dedicated_allocation
|
|
|
|
|
|
|
|
*Name String*:: VK_NV_dedicated_allocation
|
|
|
|
*Extension Type*:: Device extension
|
|
|
|
*Registered Extension Number*:: 27
|
|
|
|
*Status*:: Draft.
|
|
|
|
*Last Modified Date*:: 31/05/2016
|
|
|
|
*Revision*:: 1
|
|
|
|
*IP Status*:: No known IP claims.
|
|
|
|
*Dependencies*::
|
|
|
|
- This extension is written against version 1.0. of the Vulkan API.
|
|
|
|
*Contributors*::
|
|
|
|
- Jeff Bolz, NVIDIA
|
|
|
|
*Contacts*::
|
|
|
|
- Jeff Bolz (jbolz 'at' nvidia.com)
|
|
|
|
|
|
|
|
This extension allows device memory to be allocated for a particular buffer or
|
|
|
|
image resource, which on some devices can significantly improve the
|
|
|
|
performance of that resource. Normal device memory allocations must support
|
|
|
|
memory aliasing and sparse binding, which could interfere with optimizations
|
|
|
|
like framebuffer compression or efficient page table usage. This is important
|
|
|
|
for render targets and very large resources, but need not (and probably should
|
|
|
|
not) be used for smaller resources that can benefit from suballocation.
|
|
|
|
|
|
|
|
This extension adds a few small structures to resource creation and memory
|
|
|
|
allocation: a new structure that flags whether am image/buffer will have a
|
|
|
|
dedicated allocation, and a structure indicating the image or buffer that an
|
|
|
|
allocation will be bound to.
|
|
|
|
|
|
|
|
=== New Object Types
|
|
|
|
|
|
|
|
None.
|
|
|
|
|
|
|
|
=== New Enum Constants
|
|
|
|
|
Change log for September 6, 2016 Vulkan 1.0.26 spec update:
* Bump API patch number and header version number to 26 for this update.
Github Issues:
* Bring sample code in the +VK_KHR_surface+ and +VK_KHR_swapchain+
extension summary appendices up to date, and note they will be replaced
with pointers to the LunarG SDK examples in the future (public issue
279).
* Add a new <<fundamentals-commandsyntax-results-lifetime,Lifetime of
Retrieved Results>> section specifying that ftext:vkGet* and
ftext:VkEnumerate* results are invariant unless otherwise specified, and
specify behavior for individual commands which are not invariant (public
issue 280).
* Remove conflicting definition of
slink:VkDisplayPlaneCapabilitiesKHR::pname:maxSrcPosition and clean up
language of the remaining definition (public issue 351).
* Fix many minor spelling errors and add rules to the style guide to
prevent recurrences (public issue 352).
Internal Issues:
* Remove redundant descriptions of the etext:VK_USE_PLATFORM_* macros from
the <<wsi,Window System Integration>> chapter in favor of the
description in the <<boilerplate-wsi-header,Window System-Specific
Header Control>> appendix (internal issue 6).
* Replace misleading 'can: be destroyed when not X' with more correct
'must: not be destroyed while X' in the
<<fundamentals-objectmodel-lifetime,Object Lifetime>> section. Disallow
destroying a pipeline layout while a command buffer using it is
recording (internal issue 241).
* Clarify that ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT is valid for
all images used as attachments in elink:VkImageUsageFlagBits and the
slink:VkImageLayout validity language (internal issue 320).
* Note that <<extended-functionality-layers,Layers>> may wrap object
handles, but that this is a generally discouraged. A link to additional
information in the documentation for layer authors is provided (issue
398)
* Replace the mustnot: and shouldnot: macros with equivalent must: not and
should: not to get rid of non-English words while still highlighting
normative language (internal issue 407).
* Disallow creating multisampled images with
ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT in the slink:VkImageLayout
validity language and the <<features-supported-sample-counts,Supported
Sample Counts>> section (internal issue 445).
* Fix typo so that flink:vkCmdDrawIndexedIndirect is defined in terms of
flink:vkCmdDrawIndexed rather than flink:vkCmdDrawIndirect (internal
issue 446).
* Reorganize the per-extension information sections to all be in the
<<extensions,Layers & Extensions>> appendix. Also fix a typo in
+VK_IMG_filter_cubic+ which incorrectly identified it as a +KHR+
extension (internal issue 461).
Other Issues:
* Use asciidoc markup instead of latexmath to simplify diagrams in the
<<features-formats-non-packed,byte mapping tables>> for color formats.
* Fix a markup problem with the wildcarded enumerant names in a NOTE in
the <<textures-texel-replacement,Texel Replacement>> section.
* Fix missing attributes in the XML interface for
elink:VkExternalMemoryHandleTypeFlagBitsNV and
elink:VkExternalMemoryFeatureFlagBitsNV (KhronosGroup/Vulkan-Hpp issue
#25)
* Cleanup reference page builds so only core pages are built for releases.
2016-09-06 13:17:27 +00:00
|
|
|
* Extending elink:VkStructureType:
|
2016-08-28 10:47:19 +00:00
|
|
|
** ename:VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV
|
|
|
|
** ename:VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV
|
|
|
|
** ename:VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV
|
|
|
|
|
|
|
|
=== New Enums
|
|
|
|
|
|
|
|
None.
|
|
|
|
|
|
|
|
=== New Structures
|
|
|
|
|
|
|
|
* slink:VkDedicatedAllocationImageCreateInfoNV
|
|
|
|
* slink:VkDedicatedAllocationBufferCreateInfoNV
|
|
|
|
* slink:VkDedicatedAllocationMemoryAllocateInfoNV
|
|
|
|
|
|
|
|
=== New Functions
|
|
|
|
|
|
|
|
None.
|
|
|
|
|
|
|
|
=== Issues
|
|
|
|
|
|
|
|
None.
|
|
|
|
|
|
|
|
=== Examples
|
|
|
|
|
|
|
|
[source,{basebackend@docbook:c++:cpp}]
|
Change log for September 6, 2016 Vulkan 1.0.26 spec update:
* Bump API patch number and header version number to 26 for this update.
Github Issues:
* Bring sample code in the +VK_KHR_surface+ and +VK_KHR_swapchain+
extension summary appendices up to date, and note they will be replaced
with pointers to the LunarG SDK examples in the future (public issue
279).
* Add a new <<fundamentals-commandsyntax-results-lifetime,Lifetime of
Retrieved Results>> section specifying that ftext:vkGet* and
ftext:VkEnumerate* results are invariant unless otherwise specified, and
specify behavior for individual commands which are not invariant (public
issue 280).
* Remove conflicting definition of
slink:VkDisplayPlaneCapabilitiesKHR::pname:maxSrcPosition and clean up
language of the remaining definition (public issue 351).
* Fix many minor spelling errors and add rules to the style guide to
prevent recurrences (public issue 352).
Internal Issues:
* Remove redundant descriptions of the etext:VK_USE_PLATFORM_* macros from
the <<wsi,Window System Integration>> chapter in favor of the
description in the <<boilerplate-wsi-header,Window System-Specific
Header Control>> appendix (internal issue 6).
* Replace misleading 'can: be destroyed when not X' with more correct
'must: not be destroyed while X' in the
<<fundamentals-objectmodel-lifetime,Object Lifetime>> section. Disallow
destroying a pipeline layout while a command buffer using it is
recording (internal issue 241).
* Clarify that ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT is valid for
all images used as attachments in elink:VkImageUsageFlagBits and the
slink:VkImageLayout validity language (internal issue 320).
* Note that <<extended-functionality-layers,Layers>> may wrap object
handles, but that this is a generally discouraged. A link to additional
information in the documentation for layer authors is provided (issue
398)
* Replace the mustnot: and shouldnot: macros with equivalent must: not and
should: not to get rid of non-English words while still highlighting
normative language (internal issue 407).
* Disallow creating multisampled images with
ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT in the slink:VkImageLayout
validity language and the <<features-supported-sample-counts,Supported
Sample Counts>> section (internal issue 445).
* Fix typo so that flink:vkCmdDrawIndexedIndirect is defined in terms of
flink:vkCmdDrawIndexed rather than flink:vkCmdDrawIndirect (internal
issue 446).
* Reorganize the per-extension information sections to all be in the
<<extensions,Layers & Extensions>> appendix. Also fix a typo in
+VK_IMG_filter_cubic+ which incorrectly identified it as a +KHR+
extension (internal issue 461).
Other Issues:
* Use asciidoc markup instead of latexmath to simplify diagrams in the
<<features-formats-non-packed,byte mapping tables>> for color formats.
* Fix a markup problem with the wildcarded enumerant names in a NOTE in
the <<textures-texel-replacement,Texel Replacement>> section.
* Fix missing attributes in the XML interface for
elink:VkExternalMemoryHandleTypeFlagBitsNV and
elink:VkExternalMemoryFeatureFlagBitsNV (KhronosGroup/Vulkan-Hpp issue
#25)
* Cleanup reference page builds so only core pages are built for releases.
2016-09-06 13:17:27 +00:00
|
|
|
--------------------------------------
|
2016-08-28 10:47:19 +00:00
|
|
|
|
|
|
|
// Create an image with
|
|
|
|
// VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation
|
|
|
|
// set to VK_TRUE
|
|
|
|
|
|
|
|
VkDedicatedAllocationImageCreateInfoNV dedicatedImageInfo =
|
|
|
|
{
|
|
|
|
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV, // sType
|
|
|
|
NULL, // pNext
|
|
|
|
VK_TRUE, // dedicatedAllocation
|
|
|
|
};
|
|
|
|
|
|
|
|
VkImageCreateInfo imageCreateInfo =
|
|
|
|
{
|
|
|
|
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, // sType
|
|
|
|
&dedicatedImageInfo // pNext
|
|
|
|
// Other members set as usual
|
|
|
|
};
|
|
|
|
|
|
|
|
VkImage image;
|
|
|
|
VkResult result = vkCreateImage(
|
|
|
|
device,
|
|
|
|
&imageCreateInfo,
|
|
|
|
NULL, // pAllocator
|
|
|
|
&image);
|
|
|
|
|
|
|
|
VkMemoryRequirements memoryRequirements;
|
|
|
|
vkGetImageMemoryRequirements(
|
|
|
|
device,
|
|
|
|
image,
|
|
|
|
&memoryRequirements);
|
|
|
|
|
|
|
|
// Allocate memory with VkDedicatedAllocationMemoryAllocateInfoNV::image
|
|
|
|
// pointing to the image we're allocating the memory for
|
|
|
|
|
|
|
|
VkDedicatedAllocationMemoryAllocateInfoNV dedicatedInfo =
|
|
|
|
{
|
|
|
|
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV, // sType
|
|
|
|
NULL, // pNext
|
|
|
|
image, // image
|
|
|
|
VK_NULL_HANDLE, // buffer
|
|
|
|
};
|
|
|
|
|
|
|
|
VkMemoryAllocateInfo memoryAllocateInfo =
|
|
|
|
{
|
|
|
|
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, // sType
|
|
|
|
&dedicatedInfo, // pNext
|
|
|
|
memoryRequirements.size, // allocationSize
|
|
|
|
FindMemoryTypeIndex(memoryRequirements.memoryTypeBits), // memoryTypeIndex
|
|
|
|
};
|
|
|
|
|
|
|
|
VkDeviceMemory memory;
|
|
|
|
vkAllocateMemory(
|
|
|
|
device,
|
|
|
|
&memoryAllocateInfo,
|
|
|
|
NULL, // pAllocator
|
|
|
|
&memory);
|
|
|
|
|
|
|
|
// Bind the image to the memory
|
|
|
|
|
|
|
|
vkBindImageMemory(
|
|
|
|
device,
|
|
|
|
image,
|
|
|
|
memory,
|
|
|
|
0);
|
|
|
|
|
Change log for September 6, 2016 Vulkan 1.0.26 spec update:
* Bump API patch number and header version number to 26 for this update.
Github Issues:
* Bring sample code in the +VK_KHR_surface+ and +VK_KHR_swapchain+
extension summary appendices up to date, and note they will be replaced
with pointers to the LunarG SDK examples in the future (public issue
279).
* Add a new <<fundamentals-commandsyntax-results-lifetime,Lifetime of
Retrieved Results>> section specifying that ftext:vkGet* and
ftext:VkEnumerate* results are invariant unless otherwise specified, and
specify behavior for individual commands which are not invariant (public
issue 280).
* Remove conflicting definition of
slink:VkDisplayPlaneCapabilitiesKHR::pname:maxSrcPosition and clean up
language of the remaining definition (public issue 351).
* Fix many minor spelling errors and add rules to the style guide to
prevent recurrences (public issue 352).
Internal Issues:
* Remove redundant descriptions of the etext:VK_USE_PLATFORM_* macros from
the <<wsi,Window System Integration>> chapter in favor of the
description in the <<boilerplate-wsi-header,Window System-Specific
Header Control>> appendix (internal issue 6).
* Replace misleading 'can: be destroyed when not X' with more correct
'must: not be destroyed while X' in the
<<fundamentals-objectmodel-lifetime,Object Lifetime>> section. Disallow
destroying a pipeline layout while a command buffer using it is
recording (internal issue 241).
* Clarify that ename:VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT is valid for
all images used as attachments in elink:VkImageUsageFlagBits and the
slink:VkImageLayout validity language (internal issue 320).
* Note that <<extended-functionality-layers,Layers>> may wrap object
handles, but that this is a generally discouraged. A link to additional
information in the documentation for layer authors is provided (issue
398)
* Replace the mustnot: and shouldnot: macros with equivalent must: not and
should: not to get rid of non-English words while still highlighting
normative language (internal issue 407).
* Disallow creating multisampled images with
ename:VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT in the slink:VkImageLayout
validity language and the <<features-supported-sample-counts,Supported
Sample Counts>> section (internal issue 445).
* Fix typo so that flink:vkCmdDrawIndexedIndirect is defined in terms of
flink:vkCmdDrawIndexed rather than flink:vkCmdDrawIndirect (internal
issue 446).
* Reorganize the per-extension information sections to all be in the
<<extensions,Layers & Extensions>> appendix. Also fix a typo in
+VK_IMG_filter_cubic+ which incorrectly identified it as a +KHR+
extension (internal issue 461).
Other Issues:
* Use asciidoc markup instead of latexmath to simplify diagrams in the
<<features-formats-non-packed,byte mapping tables>> for color formats.
* Fix a markup problem with the wildcarded enumerant names in a NOTE in
the <<textures-texel-replacement,Texel Replacement>> section.
* Fix missing attributes in the XML interface for
elink:VkExternalMemoryHandleTypeFlagBitsNV and
elink:VkExternalMemoryFeatureFlagBitsNV (KhronosGroup/Vulkan-Hpp issue
#25)
* Cleanup reference page builds so only core pages are built for releases.
2016-09-06 13:17:27 +00:00
|
|
|
--------------------------------------
|
2016-08-28 10:47:19 +00:00
|
|
|
|
|
|
|
=== Version History
|
|
|
|
|
|
|
|
* Revision 1, 2016-05-31 (Jeff Bolz)
|
|
|
|
- Internal revisions
|