From 87cacbeed49facf18355c55cc93d0a2a0142be09 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 22 Oct 2025 04:53:40 +0200 Subject: [compat] HaikuOS port (#2805) Still had the issues with libusb, but that should get solved with the other PRs anyways Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2805 Reviewed-by: MaranBr Reviewed-by: crueter Co-authored-by: lizzie Co-committed-by: lizzie --- src/video_core/vulkan_common/vulkan_surface.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/video_core/vulkan_common/vulkan_surface.cpp') diff --git a/src/video_core/vulkan_common/vulkan_surface.cpp b/src/video_core/vulkan_common/vulkan_surface.cpp index e45f8e43fb..f1b56cc0a8 100644 --- a/src/video_core/vulkan_common/vulkan_surface.cpp +++ b/src/video_core/vulkan_common/vulkan_surface.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -54,6 +57,23 @@ vk::SurfaceKHR CreateSurface( throw vk::Exception(VK_ERROR_INITIALIZATION_FAILED); } } +#elif defined(__HAIKU__) + if (window_info.type == Core::Frontend::WindowSystemType::Xcb) { + const VkXcbSurfaceCreateInfoKHR xcb_ci{ + .sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR, + .pNext = nullptr, + .flags = 0, + .connection = static_cast(window_info.display_connection), + .window = xcb_window_t(uintptr_t(window_info.render_surface)) + }; + const auto vkCreateXcbSurfaceKHR = reinterpret_cast( + dld.vkGetInstanceProcAddr(*instance, "vkCreateXcbSurfaceKHR")); + if (!vkCreateXcbSurfaceKHR || + vkCreateXcbSurfaceKHR(*instance, &xcb_ci, nullptr, &unsafe_surface) != VK_SUCCESS) { + LOG_ERROR(Render_Vulkan, "Failed to initialize Xcb surface"); + throw vk::Exception(VK_ERROR_INITIALIZATION_FAILED); + } + } #else if (window_info.type == Core::Frontend::WindowSystemType::X11) { const VkXlibSurfaceCreateInfoKHR xlib_ci{ -- cgit v1.2.3