vulkan-wsi-layer/wsi/unsupported_surfaces.hpp
Iason Paraskevopoulos 9c9dff2291 Add surfaces the layer supports in unsupported_surfaces
Extends the unsupported_surfaces_ext_array to contain surfaces
supported by the layer, when the layer is built without supporting them.

Also handles the presentWait2 feature similar to presentWait.

Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I2e61d56425ff657de949797be86436c9675d1b1f
2025-12-16 14:26:53 +00:00

66 lines
2.4 KiB
C++

/*
* Copyright (c) 2024-2025 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <vulkan/vulkan_core.h>
#include <vulkan/vulkan.h>
#include <array>
/* Define the patch version directly as macros */
#define WSI_LAYER_VK_PATCH 325
/* Convert macros to string */
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#if VK_HEADER_VERSION > WSI_LAYER_VK_PATCH
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-W#pragma-messages"
#endif
#pragma message("The Vulkan header version is newer than the currently supported version.")
#pragma message("Current Vulkan header version: " TOSTRING(VK_HEADER_VERSION))
#pragma message("Supported Vulkan API version: " TOSTRING(WSI_LAYER_VK_PATCH))
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif
namespace wsi
{
/* A list of platform-specific unsupported surface extensions
Not using the extension macros and symbols due to missing definitions for native platform symbols. */
static constexpr std::array unsupported_surfaces_ext_array = {
"VK_KHR_win32_surface", "VK_KHR_xlib_surface", "VK_KHR_xcb_surface",
"VK_EXT_metal_surface", "VK_KHR_android_surface",
#if !BUILD_WSI_HEADLESS
"VK_EXT_headless_surface",
#endif
#if !BUILD_WSI_WAYLAND
"VK_KHR_wayland_surface",
#endif
#if !BUILD_WSI_DISPLAY
"VK_KHR_display",
#endif
};
} // namespace wsi