From d3748cad73f5a4bc11e6cd0ad178a8828676e45e Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Thu, 15 Jul 2021 21:02:00 -0400 Subject: emu_window_sdl2_vk: Use the generated SDL config On Linux, due to the way we include SDL2 as a submodule, it makes it difficult for us to specify which SDL_config.h we intended to include. Before, CMake would default to the dummy one included with SDL and ignore the generated one. This tells CMake to use the generated one. In addition, we define USING_GENERATED_CONFIG_H to throw an error in case the dummy config is used by accident. Fixes Vulkan not working on Linux yuzu-cmd. --- src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/yuzu_cmd/emu_window') diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index 3401ad4b4..b6049b032 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp @@ -15,6 +15,12 @@ #include "video_core/renderer_vulkan/renderer_vulkan.h" #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" +#ifdef YUZU_USE_EXTERNAL_SDL2 +// Include this before SDL.h to prevent the external from including a dummy +#define USING_GENERATED_CONFIG_H +#include +#endif + // Include these late to avoid polluting everything with Xlib macros // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 #ifdef __clang__ -- cgit v1.2.3 From 0e6ba0cd0db6f338696ffba9180e15ea4a092323 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Thu, 15 Jul 2021 21:02:38 -0400 Subject: emu_window_sdl2_vk: Specify the window manager if it should be supported The original language "not implemented" is wrong if the implementation exists but is not compiled. This causes a bit of a debugging headache when it goes wrong. Log it if the window manager is known before exiting. --- src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/yuzu_cmd/emu_window') diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index b6049b032..7c870aea1 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp @@ -57,6 +57,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste window_info.type = Core::Frontend::WindowSystemType::Windows; window_info.render_surface = reinterpret_cast(wm.info.win.window); break; +#else + case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS: + LOG_CRITICAL(Frontend, "Window manager subsystem Windows not compiled"); + std::exit(EXIT_FAILURE); + break; #endif #ifdef SDL_VIDEO_DRIVER_X11 case SDL_SYSWM_TYPE::SDL_SYSWM_X11: @@ -64,6 +69,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste window_info.display_connection = wm.info.x11.display; window_info.render_surface = reinterpret_cast(wm.info.x11.window); break; +#else + case SDL_SYSWM_TYPE::SDL_SYSWM_X11: + LOG_CRITICAL(Frontend, "Window manager subsystem X11 not compiled"); + std::exit(EXIT_FAILURE); + break; #endif #ifdef SDL_VIDEO_DRIVER_WAYLAND case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND: @@ -71,6 +81,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste window_info.display_connection = wm.info.wl.display; window_info.render_surface = wm.info.wl.surface; break; +#else + case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND: + LOG_CRITICAL(Frontend, "Window manager subsystem Wayland not compiled"); + std::exit(EXIT_FAILURE); + break; #endif default: LOG_CRITICAL(Frontend, "Window manager subsystem not implemented"); -- cgit v1.2.3 From f7859331252646748c00fbda6ad0b8765de5718b Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Thu, 15 Jul 2021 23:26:00 -0400 Subject: sdl_impl, emu_window: Remove clang ignore Fixed upstream by libsdl-org/SDL@25fc40b0bd44c484051064bc6b945ea9943f88dd --- src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 8 -------- src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 8 -------- src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 9 --------- 3 files changed, 25 deletions(-) (limited to 'src/yuzu_cmd/emu_window') diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 06b20c975..896181f0b 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -2,15 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wimplicit-fallthrough" -#endif #include -#ifdef __clang__ -#pragma clang diagnostic pop -#endif #include "common/logging/log.h" #include "common/scm_rev.h" diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 837a44be7..eadb41790 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp @@ -7,15 +7,7 @@ #include #define SDL_MAIN_HANDLED -// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wimplicit-fallthrough" -#endif #include -#ifdef __clang__ -#pragma clang diagnostic pop -#endif #include #include diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index 7c870aea1..152e56db8 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp @@ -21,16 +21,7 @@ #include #endif -// Include these late to avoid polluting everything with Xlib macros -// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wimplicit-fallthrough" -#endif #include -#ifdef __clang__ -#pragma clang diagnostic pop -#endif #include EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) -- cgit v1.2.3