Vulkan-Docs/doc/specs/vulkan/man/vkAllocateMemory.txt

87 lines
2.8 KiB
Plaintext

// Copyright (c) 2014-2016 Khronos Group. This work is licensed under a
// Creative Commons Attribution 4.0 International License; see
// http://creativecommons.org/licenses/by/4.0/
vkAllocateMemory(3)
===================
Name
----
vkAllocateMemory - Allocate GPU memory.
C Specification
---------------
// refBegin vkAllocateMemory Allocate GPU memory.
To allocate memory objects, call:
include::../api/protos/vkAllocateMemory.txt[]
Parameters
----------
* pname:device is the logical device that owns the memory.
* pname:pAllocateInfo is a pointer to an instance of the
slink:VkMemoryAllocateInfo structure describing parameters of the
allocation. A successful returned allocation must: use the requested
parameters -- no substitution is permitted by the implementation.
* pname:pAllocator controls host memory allocation as described in
the <<memory-allocation, Memory Allocation>> chapter.
* pname:pMemory is a pointer to a sname:VkDeviceMemory handle in which
information about the allocated memory is returned.
Description
-----------
Allocations returned by fname:vkAllocateMemory are guaranteed to meet any
alignment requirement by the implementation. For example, if an
implementation requires 128 byte alignment for images and 64 byte alignment
for buffers, the device memory returned through this mechanism would be
128-byte aligned. This ensures that applications can: correctly suballocate
objects of different types (with potentially different alignment
requirements) in the same memory object.
When memory is allocated, its contents are undefined.
There is an implementation-dependent maximum number of memory allocations
which can: be simultaneously created on a device. This is specified by the
<<features-limits-maxMemoryAllocationCount,pname:maxMemoryAllocationCount>>
member of the sname:VkPhysicalDeviceLimits structure. If
pname:maxMemoryAllocationCount is exceeded, fname:vkAllocateMemory will
return ename:VK_ERROR_TOO_MANY_OBJECTS.
[NOTE]
.Note
====
Some platforms may: have a limit on the maximum size of a single allocation.
For example, certain systems may: fail to create allocations with a size
greater than or equal to 4GB. Such a limit is implementation-dependent, and
if such a failure occurs then the error ename:VK_ERROR_OUT_OF_DEVICE_MEMORY
should: be returned.
====
include::../validity/protos/vkAllocateMemory.txt[]
See Also
--------
slink:VkAllocationCallbacks, slink:VkDevice, slink:VkDeviceMemory, slink:VkMemoryAllocateInfo
Document Notes
--------------
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkAllocateMemory
This page is extracted from the Vulkan Specification.
Fixes and changes should be made to the Specification,not directly.
include::footer.txt[]