diff options
| author | lizzie <lizzie@eden-emu.dev> | 2025-10-22 04:53:40 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-10-22 04:53:40 +0200 |
| commit | 87cacbeed49facf18355c55cc93d0a2a0142be09 (patch) | |
| tree | 320ab5933dd97b5f54f5fcc2cb4ed775587c9cbf /src/video_core/vulkan_common/vulkan_surface.cpp | |
| parent | 992bae4e2a14ca2547c09637b7dc6fc5f73b353a (diff) | |
[compat] HaikuOS port (#2805)
Still had the issues with libusb, but that should get solved with the other PRs anyways
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2805
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_surface.cpp')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_surface.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
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<xcb_connection_t*>(window_info.display_connection), + .window = xcb_window_t(uintptr_t(window_info.render_surface)) + }; + const auto vkCreateXcbSurfaceKHR = reinterpret_cast<PFN_vkCreateXcbSurfaceKHR>( + 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{ |
