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

96 lines
3.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/
VkSystemAllocationScope(3)
==========================
Name
----
VkSystemAllocationScope - allocation scope
C Specification
---------------
// refBegin VkSystemAllocationScope allocation scope
[[memory-host-allocation-scope]]
Each allocation has a _scope_ which defines its lifetime and which object it
is associated with. The scope is provided in the pname:allocationScope
parameter passed to callbacks defined in slink:VkAllocationCallbacks.
Possible values for this parameter are defined by
elink:VkSystemAllocationScope:
include::../api/enums/VkSystemAllocationScope.txt[]
Description
-----------
* ename:VK_SYSTEM_ALLOCATION_SCOPE_COMMAND - The allocation is scoped to
the duration of the Vulkan command.
* ename:VK_SYSTEM_ALLOCATION_SCOPE_OBJECT - The allocation is scoped to
the lifetime of the Vulkan object that is being created or used.
* ename:VK_SYSTEM_ALLOCATION_SCOPE_CACHE - The allocation is scoped to the
lifetime of a sname:VkPipelineCache object.
* ename:VK_SYSTEM_ALLOCATION_SCOPE_DEVICE - The allocation is scoped to
the lifetime of the Vulkan device.
* ename:VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE - The allocation is scoped to
the lifetime of the Vulkan instance.
Most Vulkan commands operate on a single object, or there is a sole
object that is being created or manipulated. When an allocation uses a scope
of ename:VK_SYSTEM_ALLOCATION_SCOPE_OBJECT or
ename:VK_SYSTEM_ALLOCATION_SCOPE_CACHE, the allocation is scoped to the
object being created or manipulated.
When an implementation requires host memory, it will make callbacks to the
application using the most specific allocator and scope available:
* If an allocation is scoped to the duration of a command, the allocator
will use the ename:VK_SYSTEM_ALLOCATION_SCOPE_COMMAND scope. The most
specific allocator available is used: if the object being created or
manipulated has an allocator, that object's allocator will be used, else
if the parent sname:VkDevice has an allocator it will be used, else if
the parent sname:VkInstance has an allocator it will be used. Else,
* If an allocation is associated with an object of type
sname:VkPipelineCache, the allocator will use the
ename:VK_SYSTEM_ALLOCATION_SCOPE_CACHE scope. The most specific
allocator available is used (pipeline cache, else device, else
instance). Else,
* If an allocation is scoped to the lifetime of an object, that object is
being created or manipulated by the command, and that object's type is
not sname:VkDevice or sname:VkInstance, the allocator will use a scope
of ename:VK_SYSTEM_ALLOCATION_SCOPE_OBJECT. The most specific allocator
available is used (object, else device, else instance). Else,
* If an allocation is scoped to the lifetime of a device, the allocator
will use scope of ename:VK_SYSTEM_ALLOCATION_SCOPE_DEVICE. The most
specific allocator available is used (device, else instance). Else,
* If the allocation is scoped to the lifetime of an instance and the
instance has an allocator, its allocator will be used with a scope of
ename:VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE.
* Otherwise an implementation will allocate memory through an alternative
mechanism that is unspecified.
// refEnd VkSystemAllocationScope VkAllocationCallbacks
See Also
--------
slink:VkAllocationCallbacks
Document Notes
--------------
For more information, see the Vulkan Specification at URL
https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkSystemAllocationScope
This page is extracted from the Vulkan Specification.
Fixes and changes should be made to the Specification,not directly.
include::footer.txt[]