The layer needs functionality that is not part of Vulkan 1.0 and is
provided by either Vulkan 1.1 or separate Vulkan extensions.
The layer used to solve this issue by bumping the API version passed
by the application in VkCreateInfo to 1.1 if this was set to 1.0.
This workaround does not seem to be working anymore with recent
versions of the loader. Fortunately, the loader now allows layers
to change the extension lists passed by the application.
This patch changes the layer to use this approach and removes the
API bump logic.
Documentation is updated accordingly.
Change-Id: I61c426311612c7f288a0f7d969782d6c5365acf5
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Implement support for VK_EXT_image_compression_control_swapchain
for both the Wayland and the headless windowing systems.
The extension can be conditionally enabled through the new build option
BUILD_WSI_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN. Compiling with this
option enabled requires recent Vulkan headers (1.3.213)
Note also that support in the layer is enabled conditionally to
the ICD supporting VK_EXT_image_compression_control.
Update the WSIALLOC interface to version 2 and add support to
prefer selection of a format with the highest fixed rate compression
from the formats provided. This is used to pick a fixed rate
compression when VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT is
specified during swapchain creation.
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Change-Id: Ie37e6901042a65f2a408e428a705b5a24227b262
Adds support for the VK_KHR_get_surface_capabilities2 extension.
Change-Id: Iae882a41819baf413a0ba949ec44d6e722ebca5a
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Stores the enabled instance and device extensions during
vkCreateInstance and vkCreateDevice respectively. This fixes an issue
where function pointers for functions of disabled extensions were
returned during vkGetInstanceProcAddr/vkGetDeviceProcAddr.
Adds functionality for adding extensions that belong to a subset of
other extensions in util::extension_list.
Adds function for checking if the proper surface extension has been
enabled in each WSI backend.
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: If5e23e0d07c9f09006be18c410c4e1d4c3a1e676
Fix warnings given by clang-tidy 8 with checks 'bugprone-*,modernize-*'
Change-Id: I2e5660c5872728f957869c66b1143cfcc76bc20e
Signed-off-by: Ben Davis <ben.davis@arm.com>
Reduce the number of functions that are exported by the layer. This
helps resolve dynamic linking issues where multiple functions are named
the same in different shared libraries. Also add function specifiers and
calling conventions to all extern "C" functions.
Change-Id: I07b33ff8d066e33c5dbdf0cbc13aa7835a78220b
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Updates the api_version to 1.2 in the json manifest. Also, adds the
entrypoints node in the device extensions as it is mandated by the
loader's documentation when an extension adds Vulkan API functions.
Removes support for intercepting vkEnumerateInstanceLayerProperties,
vkEnumerateInstanceExtensionProperties and
vkEnumerateDeviceExtensionProperties as the loader can get the
information they provide from the layer's json manifest in its
terminator functions.
Change-Id: I2c304d1d2ea17d3ea0c723694f8fc4c8a92054a0
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
This commit adds support for VkBindImageMemorySwapchainInfoKHR and
VkImageSwapchainCreateInfoKHR.
Change-Id: I3d87cd7df380e59ceb386f08437c5d6f09dcee1f
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
The vkDestroyDevice entrypoint was listed as a instance level
entrypoint, that is, to be returned by vkGetInstanceProcAddr; however,
vkDestroyDevice is a device level entrypoint. Consequently, the layer
implementation was not called by the loader upon application calls to
vkDestroyDevice and this caused memory leaks within the layer.
Change-Id: I9d5807ff17965281580cd80eb74b07fb038073b1
Signed-off-by: David Harvey-Macaulay <david.harvey-macaulay@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>
Implement vkGetDeviceGroupSurfacePresentModesKHR,
vkGetDeviceGroupPresentCapabilitiesKHR, vkAcquireNextImage2KHR and
vkGetPhysicalDevicePresentRectanglesKHR function entrypoints in the
layer.
We assume that if the layer should not handle the surface the device or
instance should handle it as appropriate and fallback to this
implmentation.
Change-Id: Iafc585d8738ad80413ad616d834d966f92c4f8cb
Signed-off-by: Ben Davis <ben.davis@arm.com>
Unused methods removed. Specialised methods moved out
of the extension_list utility and closer to the point
of usage.
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Change-Id: I8e6d2786881b5306de21797cfdda46d0e678da8d
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>
Very basic Wayland support is implemented by importing
memory with VK_EXT_image_drm_format_modifiers.
The current implementation requires an external system
memory allocator. An API for this allocator is defined
in util/wsialloc/wsialloc.h and an implementation using
the ION memory allocator is included.
Outstanding issues:
* This is an initial prototype for Wayland support and
has many outstanding TODOs which need addressing to
properly use the Wayland protocol.
* Using ICD Exported memory instead of a system allocator
is not implemented.
Wayland support is still experimental and outstanding issues
will be fixed in future commits.
Change-Id: I1b0d5991e15ff1cf25ebbab3392a631b021e8c17
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
In vkCreateInstance:
- ppEnabledExtensionNames is checked to determine which window-system
platforms the layer should enable support for.
- support in the layer is always enabled if possible, even if this may
be provided by the ICDs. Platforms not supported by the layer should
still be correctly supported by the ICDs (untested.)
- pApplicationInfo is changed to bump the Vulkan API version
in order to enable instance extensions that are necessary for some
of the platforms implemented in the layer.
In vkCreateDevice:
- ppEnabledExtensionNames is extended with device extensions required
by the layer.
- if the extensions are not supported by the physical device, the
layer fails to initialize the device.
Change-Id: Ibdd69fca38e7909d5b8f0ac7698805ea5f425ac6
Signed-off-by: Joe Jenner-Bailey <joe.jenner-bailey@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Fixes the wrong allocation of extensions properties.
Adds a call to the dispacher's DestroyInstance function before the
destruction of the instance.
Change-Id: I169bb3ba670d89e30af1f6ce47c536477978c169
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Move all WSI type specific calls to WSI factory methods. This
removes headless references in layer/ and allows for simpler
support of multiple windowing systems.
Change-Id: I757a7a3bb4267783420b52cceb3bde8ce233297e
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
This commit adds the initial sources for the vulkan-wsi-layer project:
a Vulkan layer which implements some of the Vulkan window system
integration extensions such as VK_KHR_swapchain.
The layer is designed to be GPU vendor agnostic when used as part of the
Vulkan ICD/loader architecture.
The project currently implements support for VK_EXT_headless_surface and
its dependencies. We hope to extend support for further platforms such
as Wayland and direct-to-display rendering in the future.
This initial commit collects contributions from different individuals
employed by Arm.
More information on the project (building instructions, how to
contribute, etc.) can be found on the README.md file at the top of the
project tree.
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>