Adds a per-device check for a 'best' queue family to
use for present timing, rather than always using index 0.
wsi_ext_present_timing holds resources (such as the command
buffer) per queue family, rather than supporting only one. However,
currently, only one queue family is supported at a time.
In future, we can hook vkGetDeviceQueue calls to map
VkQueues to their family index. Doing this will transparently
give present timing support for multiple queue families.
Signed-off-by: Alex Bates <alex.bates@arm.com>
Change-Id: I5becb29dfc4a082e301031e0c693acd23eb95a51
Implements the entrypoint vkSetSwapchainPresentTimingQueueSizeEXT and
handles VkPresentTimingsInfoEXT. The presentation timing queue is
also implemented the present id from parsing VkPresentTimingsInfoEXT is
stored in the queue.
Signed-off-by: ginujacob <ginu.jacob@arm.com>
Change-Id: I81b6113b54db5e59f7018ef9a22e80af6dcdd568
Fixes an issue where there was a chance that an exception would be
thrown when out of memory rather than returning an
appropriate VkResult code.
Additionally introduces a noncopyable utility class that can be used to
mark classes that should not have copy semantics
Change-Id: I1f84dc9bb1ea96db2a88a90d56adbee78b17c5e3
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Fix warnings given by clang-tidy 8 with checks 'bugprone-*,modernize-*'
Change-Id: I2e5660c5872728f957869c66b1143cfcc76bc20e
Signed-off-by: Ben Davis <ben.davis@arm.com>
Defines an abstract wsi::surface object to be implemented by each WSI
backend. This object is then associated with the corresponding VkSurface
object in the instance specific data.
To keep track of these objects the layer now intercepts
vkDestroySurfaceKHR, while specific surface creation entrypoints are
intercepted by individual WSI backends.
In addition this change should allow for fixing incompatibility issues
with layers that wrap VkSurface which breaks casting to the Loader's ICD
VkSurface type.
Make greater use of util::unique_ptr and allow for such pointers to be
constructable when casting derived types.
Change-Id: I163e9c47088ad9989583ebce1319b1fc05559d73
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
Add brief documentation to explain what the custom util::unique_ptr and
deleter class is used for.
Change-Id: I7f4d456a34d55c09ad470b7c34e32b069203ca6b
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Remove all the leftover instances in layer that still use the
generic allocator rather than the VkAllocationCallbacks
Add additional memory utility that allows to release memory
allocated by custom allocators using RAII
Change-Id: I43594ddd3c506048ca0f02e31b64597a7abc481b
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
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>
This utility will be used in future commits.
Also add -Wno-undefined to the linker flags to prevent leaving
undefined symbols in the layer .so file. Fix issues highlighted while
using this flag.
Change-Id: I682e266f7b3f313742cb2da83e5ad2569fc72da3
Signed-off-by: Joe Jenner-Bailey <joe.jenner-bailey@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
Change util::allocator's create and destroy methods so that they can
allocate multiple objects, in line with the allocate and deallocate
methods of std::allocator.
Also add documentation for util::allocator and its methods.
Finally, use util::allocator in swapchain.cpp, rather than allocating
memory directly via VkAllocationCallbacks.
Change-Id: I0bc25abe3cbc3af9608218411da8d70e04dd9749
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Add util::vector to provide functionality similar to std::vector,
i.e. growable arrays. util::vector does its allocations via a custom
allocator provided via VkAllocationCallbacks and provides methods to
check whether the allocation fails, e.g. try_push_back() returns false
when the allocation fails and replaces std::vector's push_back() method
that would rather raise an exception to report an allocation failure.
Note that this commit switches on exceptions in the layer by removing
the flag -fno-exceptions.
util::vector is also used to store swapchain images.
Change-Id: I2bf2b24bd06e198c198c4f4aedd8f7fced96a346
Signed-off-by: Joe Jenner-Bailey <joe.jenner-bailey@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>