kc3-lang/angle/src/libANGLE/renderer/vulkan/doc/Allocators.md

Download

Allocators

Allocator helpers are used in the command buffer objects as a means to allocate memory for the latter. Regardless of the inner workings of the allocation method they use, they use the same interface in the ANGLE code.

Allocator types

There are currently two types of allocators defined in ANGLE:

ANGLE uses pool allocators by default. To switch to ring buffer allocators, the flag angle_enable_vulkan_shared_ring_buffer_cmd_alloc should be enabled in GN args. This flag appears as ANGLE_ENABLE_VULKAN_SHARED_RING_BUFFER_CMD_ALLOC in the code, which is used to select the allocator type.

Common interface

In SecondaryCommandBuffer.h, the helper classes related to the selected allocator type are aliased as the following:

Pool allocator helpers

Files: AllocatorHelperPool.cpp and AllocatorHelperPool.h

Notes

Ring buffer allocator helpers

Files: AllocatorHelperRing.cpp and AllocatorHelperRing.h

Notes


Source

Download