60 lines
2.0 KiB
Plaintext
60 lines
2.0 KiB
Plaintext
vkAllocateMemory(3)
|
|
===================
|
|
|
|
Name
|
|
----
|
|
vkAllocateMemory - Allocate GPU memory.
|
|
|
|
C Specification
|
|
---------------
|
|
|
|
include::../protos/vkAllocateMemory.txt[]
|
|
|
|
Parameters
|
|
----------
|
|
|
|
pname:device::
|
|
The device from which to allocate memory.
|
|
|
|
pname:pAllocateInfo::
|
|
Pointer to a slink:VkMemoryAllocateInfo structure containing a description of the desired memory allocation.
|
|
|
|
pname:pAllocator::
|
|
A pointer to a slink:VkAllocationCallbacks structure containing the allocation callbacks to be used when allocating the object.
|
|
|
|
pname:pMemory::
|
|
Pointer to a variable which will receive the newly allocated sname:VkDeviceMemory object.
|
|
|
|
Description
|
|
-----------
|
|
|
|
fname:vkAllocateMemory allocates memory using the device specified in pname:device. The properties of the
|
|
new allocation are specified in the structure pointed to by pname:pAllocateInfo, which is an instance
|
|
of slink:VkMemoryAllocateInfo. The definition of slink:VkMemoryAllocateInfo is:
|
|
|
|
include::../structs/VkMemoryAllocateInfo.txt[]
|
|
|
|
The pname:sType member of the slink:VkMemoryAllocateInfo structure must be set to
|
|
ename:VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO and the pname:pNext member of the structure is reserved
|
|
for use by extensions and should be set to code:NULL if none are in use.
|
|
|
|
The pname:allocationSize member specifies the size in bytes of the requested allocation
|
|
and the pname:memoryTypeIndex member specifies the type of memory to allocate. The number of
|
|
available memory types and their properties is a feature of the physical device and may
|
|
be obtained by calling flink:vkGetPhysicalDeviceMemoryProperties.
|
|
|
|
include::../validity/protos/vkAllocateMemory.txt[]
|
|
|
|
If any host memory is required to create the memory object, the allocators passed in the
|
|
structure pointed to by the pname:pAllocator parameter are used and will be used to free the object
|
|
when flink:vkFreeMemory is called.
|
|
|
|
On success, a handle to the new memory object is placed in the variable pointed to by pname:pMemory.
|
|
|
|
See Also
|
|
--------
|
|
|
|
flink:vkFreeMemory
|
|
|
|
include::footer.txt[]
|