diff options
| author | 2021-07-19 20:54:03 -0400 | |
|---|---|---|
| committer | 2021-07-19 20:54:03 -0400 | |
| commit | ffc78ce9c17554bc72f205d6ea55ef7bc3363b47 (patch) | |
| tree | d117cb643addb8d3ffb363951d892fd07278e1c7 /src | |
| parent | Merge pull request #6651 from lat9nq/update-settings (diff) | |
| parent | sdl_impl, emu_window: Remove clang ignore (diff) | |
| download | yuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.tar.gz yuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.tar.xz yuzu-ffc78ce9c17554bc72f205d6ea55ef7bc3363b47.zip | |
Merge pull request #6652 from lat9nq/cmd-vulkan-fixes
yuzu-cmd: Linux Vulkan fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/input_common/sdl/sdl_impl.h | 8 | ||||
| -rw-r--r-- | src/yuzu_cmd/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 28 |
5 files changed, 25 insertions, 32 deletions
diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.h index b77afcbd8..7a9ad6346 100644 --- a/src/input_common/sdl/sdl_impl.h +++ b/src/input_common/sdl/sdl_impl.h | |||
| @@ -10,15 +10,7 @@ | |||
| 10 | #include <thread> | 10 | #include <thread> |
| 11 | #include <unordered_map> | 11 | #include <unordered_map> |
| 12 | 12 | ||
| 13 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 14 | #ifdef __GNUC__ | ||
| 15 | #pragma GCC diagnostic push | ||
| 16 | #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" | ||
| 17 | #endif | ||
| 18 | #include <SDL.h> | 13 | #include <SDL.h> |
| 19 | #ifdef __GNUC__ | ||
| 20 | #pragma GCC diagnostic pop | ||
| 21 | #endif | ||
| 22 | 14 | ||
| 23 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 24 | #include "common/threadsafe_queue.h" | 16 | #include "common/threadsafe_queue.h" |
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index 4bf25727b..e55a19649 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt | |||
| @@ -38,6 +38,11 @@ target_include_directories(yuzu-cmd PRIVATE ${RESOURCES_DIR}) | |||
| 38 | 38 | ||
| 39 | target_include_directories(yuzu-cmd PRIVATE ../../externals/Vulkan-Headers/include) | 39 | target_include_directories(yuzu-cmd PRIVATE ../../externals/Vulkan-Headers/include) |
| 40 | 40 | ||
| 41 | if (YUZU_USE_EXTERNAL_SDL2) | ||
| 42 | target_compile_definitions(yuzu-cmd PRIVATE -DYUZU_USE_EXTERNAL_SDL2) | ||
| 43 | target_include_directories(yuzu-cmd PRIVATE ${PROJECT_BINARY_DIR}/externals/SDL/include) | ||
| 44 | endif() | ||
| 45 | |||
| 41 | if(UNIX AND NOT APPLE) | 46 | if(UNIX AND NOT APPLE) |
| 42 | install(TARGETS yuzu-cmd RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") | 47 | install(TARGETS yuzu-cmd RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") |
| 43 | endif() | 48 | endif() |
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 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 6 | #ifdef __clang__ | ||
| 7 | #pragma clang diagnostic push | ||
| 8 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 9 | #endif | ||
| 10 | #include <SDL.h> | 5 | #include <SDL.h> |
| 11 | #ifdef __clang__ | ||
| 12 | #pragma clang diagnostic pop | ||
| 13 | #endif | ||
| 14 | 6 | ||
| 15 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 16 | #include "common/scm_rev.h" | 8 | #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 @@ | |||
| 7 | #include <string> | 7 | #include <string> |
| 8 | 8 | ||
| 9 | #define SDL_MAIN_HANDLED | 9 | #define SDL_MAIN_HANDLED |
| 10 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 11 | #ifdef __clang__ | ||
| 12 | #pragma clang diagnostic push | ||
| 13 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 14 | #endif | ||
| 15 | #include <SDL.h> | 10 | #include <SDL.h> |
| 16 | #ifdef __clang__ | ||
| 17 | #pragma clang diagnostic pop | ||
| 18 | #endif | ||
| 19 | 11 | ||
| 20 | #include <fmt/format.h> | 12 | #include <fmt/format.h> |
| 21 | #include <glad/glad.h> | 13 | #include <glad/glad.h> |
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..152e56db8 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | |||
| @@ -15,16 +15,13 @@ | |||
| 15 | #include "video_core/renderer_vulkan/renderer_vulkan.h" | 15 | #include "video_core/renderer_vulkan/renderer_vulkan.h" |
| 16 | #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" | 16 | #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" |
| 17 | 17 | ||
| 18 | // Include these late to avoid polluting everything with Xlib macros | 18 | #ifdef YUZU_USE_EXTERNAL_SDL2 |
| 19 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | 19 | // Include this before SDL.h to prevent the external from including a dummy |
| 20 | #ifdef __clang__ | 20 | #define USING_GENERATED_CONFIG_H |
| 21 | #pragma clang diagnostic push | 21 | #include <SDL_config.h> |
| 22 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 23 | #endif | 22 | #endif |
| 23 | |||
| 24 | #include <SDL.h> | 24 | #include <SDL.h> |
| 25 | #ifdef __clang__ | ||
| 26 | #pragma clang diagnostic pop | ||
| 27 | #endif | ||
| 28 | #include <SDL_syswm.h> | 25 | #include <SDL_syswm.h> |
| 29 | 26 | ||
| 30 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) | 27 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) |
| @@ -51,6 +48,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste | |||
| 51 | window_info.type = Core::Frontend::WindowSystemType::Windows; | 48 | window_info.type = Core::Frontend::WindowSystemType::Windows; |
| 52 | window_info.render_surface = reinterpret_cast<void*>(wm.info.win.window); | 49 | window_info.render_surface = reinterpret_cast<void*>(wm.info.win.window); |
| 53 | break; | 50 | break; |
| 51 | #else | ||
| 52 | case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS: | ||
| 53 | LOG_CRITICAL(Frontend, "Window manager subsystem Windows not compiled"); | ||
| 54 | std::exit(EXIT_FAILURE); | ||
| 55 | break; | ||
| 54 | #endif | 56 | #endif |
| 55 | #ifdef SDL_VIDEO_DRIVER_X11 | 57 | #ifdef SDL_VIDEO_DRIVER_X11 |
| 56 | case SDL_SYSWM_TYPE::SDL_SYSWM_X11: | 58 | case SDL_SYSWM_TYPE::SDL_SYSWM_X11: |
| @@ -58,6 +60,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste | |||
| 58 | window_info.display_connection = wm.info.x11.display; | 60 | window_info.display_connection = wm.info.x11.display; |
| 59 | window_info.render_surface = reinterpret_cast<void*>(wm.info.x11.window); | 61 | window_info.render_surface = reinterpret_cast<void*>(wm.info.x11.window); |
| 60 | break; | 62 | break; |
| 63 | #else | ||
| 64 | case SDL_SYSWM_TYPE::SDL_SYSWM_X11: | ||
| 65 | LOG_CRITICAL(Frontend, "Window manager subsystem X11 not compiled"); | ||
| 66 | std::exit(EXIT_FAILURE); | ||
| 67 | break; | ||
| 61 | #endif | 68 | #endif |
| 62 | #ifdef SDL_VIDEO_DRIVER_WAYLAND | 69 | #ifdef SDL_VIDEO_DRIVER_WAYLAND |
| 63 | case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND: | 70 | case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND: |
| @@ -65,6 +72,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste | |||
| 65 | window_info.display_connection = wm.info.wl.display; | 72 | window_info.display_connection = wm.info.wl.display; |
| 66 | window_info.render_surface = wm.info.wl.surface; | 73 | window_info.render_surface = wm.info.wl.surface; |
| 67 | break; | 74 | break; |
| 75 | #else | ||
| 76 | case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND: | ||
| 77 | LOG_CRITICAL(Frontend, "Window manager subsystem Wayland not compiled"); | ||
| 78 | std::exit(EXIT_FAILURE); | ||
| 79 | break; | ||
| 68 | #endif | 80 | #endif |
| 69 | default: | 81 | default: |
| 70 | LOG_CRITICAL(Frontend, "Window manager subsystem not implemented"); | 82 | LOG_CRITICAL(Frontend, "Window manager subsystem not implemented"); |