diff --git a/rpcs3/Emu/RSX/VK/vkutils/swapchain_android.hpp b/rpcs3/Emu/RSX/VK/vkutils/swapchain_android.hpp index 6e6d0cada5..38da782e87 100644 --- a/rpcs3/Emu/RSX/VK/vkutils/swapchain_android.hpp +++ b/rpcs3/Emu/RSX/VK/vkutils/swapchain_android.hpp @@ -5,52 +5,7 @@ namespace vk { #if defined(ANDROID) - class swapchain_ANDROID : public native_swapchain_base - { - void* surface_handle = nullptr; // FIXME: No idea what the android native surface is called - - public: - swapchain_ANDROID(physical_device& gpu, u32 present_queue, u32 graphics_queue, u32 transfer_queue, VkFormat format = VK_FORMAT_B8G8R8A8_UNORM) - : native_swapchain_base(gpu, present_queue, graphics_queue, transfer_queue, format) - {} - - ~swapchain_ANDROID() {} - - bool init() override - { - //TODO: get from `surface` - m_width = 0; - m_height = 0; - - if (m_width == 0 || m_height == 0) - { - rsx_log.error("Invalid window dimensions %d x %d", m_width, m_height); - return false; - } - - init_swapchain_images(dev, 3); - return true; - } - - void create(display_handle_t& window_handle) override - { - surface_handle = window_handle; - } - - void destroy(bool full = true) override - { - swapchain_images.clear(); - - if (full) - dev.destroy(); - } - - VkResult present(VkSemaphore /*semaphore*/, u32 /*index*/) override - { - fmt::throw_exception("Native macOS swapchain is not implemented yet!"); - } - }; - + using swapchain_ANDROID = native_swapchain_base; using swapchain_NATIVE = swapchain_ANDROID; // TODO: Implement this diff --git a/rpcs3/Emu/RSX/VK/vkutils/swapchain_core.h b/rpcs3/Emu/RSX/VK/vkutils/swapchain_core.h index bb0f3db3c0..37285c4f77 100644 --- a/rpcs3/Emu/RSX/VK/vkutils/swapchain_core.h +++ b/rpcs3/Emu/RSX/VK/vkutils/swapchain_core.h @@ -121,6 +121,28 @@ namespace vk VkResult acquire_next_swapchain_image(VkSemaphore semaphore, u64 timeout, u32* result) override; + // Clients must implement these methods to render without WSI support + bool init() override + { + fmt::throw_exception("Native swapchain is not implemented yet!"); + } + + void create(display_handle_t& /*window_handle*/) override + { + fmt::throw_exception("Native swapchain is not implemented yet!"); + } + + void destroy(bool /*full*/ = true) override + { + fmt::throw_exception("Native swapchain is not implemented yet!"); + } + + VkResult present(VkSemaphore /*semaphore*/, u32 /*index*/) override + { + fmt::throw_exception("Native swapchain is not implemented yet!"); + } + + // Generic accessors void end_frame(command_buffer& cmd, u32 index) override { swapchain_images[index].second->do_dma_transfer(cmd); diff --git a/rpcs3/Emu/RSX/VK/vkutils/swapchain_macos.hpp b/rpcs3/Emu/RSX/VK/vkutils/swapchain_macos.hpp index 7b06a854dd..ec53ab1812 100644 --- a/rpcs3/Emu/RSX/VK/vkutils/swapchain_macos.hpp +++ b/rpcs3/Emu/RSX/VK/vkutils/swapchain_macos.hpp @@ -5,52 +5,7 @@ namespace vk { #if defined(__APPLE__) - class swapchain_MacOS : public native_swapchain_base - { - void* nsView = nullptr; - - public: - swapchain_MacOS(physical_device& gpu, u32 present_queue, u32 graphics_queue, u32 transfer_queue, VkFormat format = VK_FORMAT_B8G8R8A8_UNORM) - : native_swapchain_base(gpu, present_queue, graphics_queue, transfer_queue, format) - {} - - ~swapchain_MacOS() {} - - bool init() override - { - //TODO: get from `nsView` - m_width = 0; - m_height = 0; - - if (m_width == 0 || m_height == 0) - { - rsx_log.error("Invalid window dimensions %d x %d", m_width, m_height); - return false; - } - - init_swapchain_images(dev, 3); - return true; - } - - void create(display_handle_t& window_handle) override - { - nsView = window_handle; - } - - void destroy(bool full = true) override - { - swapchain_images.clear(); - - if (full) - dev.destroy(); - } - - VkResult present(VkSemaphore /*semaphore*/, u32 /*index*/) override - { - fmt::throw_exception("Native macOS swapchain is not implemented yet!"); - } - }; - + using swapchain_MacOS = native_swapchain_base; using swapchain_NATIVE = swapchain_MacOS; static diff --git a/rpcs3/Emu/RSX/VK/vkutils/swapchain_unix.hpp b/rpcs3/Emu/RSX/VK/vkutils/swapchain_unix.hpp index 7431054936..a2bf589346 100644 --- a/rpcs3/Emu/RSX/VK/vkutils/swapchain_unix.hpp +++ b/rpcs3/Emu/RSX/VK/vkutils/swapchain_unix.hpp @@ -122,36 +122,7 @@ namespace vk #endif #if defined(HAVE_WAYLAND) - - class swapchain_Wayland : public native_swapchain_base - { - public: - swapchain_Wayland(physical_device& gpu, u32 present_queue, u32 graphics_queue, u32 transfer_queue, VkFormat format = VK_FORMAT_B8G8R8A8_UNORM) - : native_swapchain_base(gpu, present_queue, graphics_queue, transfer_queue, format) - {} - - ~swapchain_Wayland() {} - - bool init() override - { - fmt::throw_exception("Native Wayland swapchain is not implemented yet!"); - } - - void create(display_handle_t& window_handle) override - { - fmt::throw_exception("Native Wayland swapchain is not implemented yet!"); - } - - void destroy(bool full = true) override - { - fmt::throw_exception("Native Wayland swapchain is not implemented yet!"); - } - - VkResult present(VkSemaphore /*semaphore*/, u32 index) override - { - fmt::throw_exception("Native Wayland swapchain is not implemented yet!"); - } - }; + using swapchain_Wayland = native_swapchain_base; #ifndef HAVE_X11 using swapchain_NATIVE = swapchain_Wayland;