Ensure allocations happen through custom allocators
authorNormunds Rieksts <normunds.rieksts@arm.com>
Thu, 27 May 2021 12:53:07 +0000 (13:53 +0100)
committerNormunds Rieksts <normunds.rieksts@arm.com>
Mon, 28 Jun 2021 10:51:33 +0000 (11:51 +0100)
commitaf2af233337c7ec7fa349da28cd87e547d160388
tree4aaf001d4e00509941346d3e51c7724e7b8fb263
parent241e05d3e4965509e0b329623814310282f2b615
Ensure allocations happen through custom allocators

Document instance_private_data and device_private_data.

Add additional utility containers (util::unordered_set,
util::unordered_map) that ensure that the storage containers
we use allow the use of the Vulkan allocation callbacks.
Additionally, ensure that these allocations don't throw in
case host runs out of memory but rather return the appropriate
Vulkan error code.
Also keep a copy the allocators so they can be used in other layer
functionality to facilitate following the Vulkan specification around
memory allocation.

Add additional utility util::optional that currently makes it easier
to handle errors in the containers described above.

Fix some small issues with the vkCreateInstance/vkCreateDevice
handling and ensure that vkDestroyDevice is called in the layer
handler.

Change-Id: Ic9d8ece405c82e743a2c016cc3dabf984cf77fc1
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
14 files changed:
layer/layer.cpp
layer/private_data.cpp
layer/private_data.hpp
layer/swapchain_api.cpp
util/custom_allocator.cpp
util/custom_allocator.hpp
util/optional.hpp [new file with mode: 0644]
util/unordered_map.hpp [new file with mode: 0644]
util/unordered_set.hpp [new file with mode: 0644]
wsi/swapchain_base.cpp
wsi/swapchain_base.hpp
wsi/wayland/surface_properties.cpp
wsi/wsi_factory.cpp
wsi/wsi_factory.hpp