From 05a3ee816635dfeb4e948fae690b394df9d2d2fe Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 26 Feb 2023 18:54:57 +0100 Subject: [PATCH] early-access version 3417 --- CMakeLists.txt | 3 +++ README.md | 2 +- externals/CMakeLists.txt | 18 ++++++++---------- .../renderer_vulkan/vk_swapchain.cpp | 19 +++++++------------ src/yuzu/applets/qt_controller.cpp | 9 ++------- 5 files changed, 21 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a4bf17a7..a9299c812 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,6 +242,9 @@ endif() if (ENABLE_WEB_SERVICE) find_package(cpp-jwt 1.4 CONFIG) find_package(httplib 0.12 MODULE) + if (NOT cpp-jwt_FOUND OR NOT httplib_FOUND) + find_package(OpenSSL 1.1 MODULE COMPONENTS Crypto SSL) + endif() endif() if (YUZU_TESTS) diff --git a/README.md b/README.md index e846c7186..fff34165c 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3416. +This is the source code for early-access 3417. ## Legal Notice diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 7d3f30a0a..432870b74 100755 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -100,17 +100,9 @@ endif() # Sirit add_subdirectory(sirit EXCLUDE_FROM_ALL) -# httplib -if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib) - if (NOT WIN32) - find_package(OpenSSL 1.1) - if (OPENSSL_FOUND) - set(OPENSSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) - endif() - endif() - +# LibreSSL +if (ENABLE_WEB_SERVICE AND DEFINED OPENSSL_FOUND) if (WIN32 OR NOT OPENSSL_FOUND) - # LibreSSL set(LIBRESSL_SKIP_INSTALL ON) set(OPENSSLDIR "/etc/ssl/") add_subdirectory(libressl EXCLUDE_FROM_ALL) @@ -119,8 +111,13 @@ if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib) get_directory_property(OPENSSL_LIBRARIES DIRECTORY libressl DEFINITION OPENSSL_LIBS) + else() + set(OPENSSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) endif() +endif() +# httplib +if (ENABLE_WEB_SERVICE AND NOT TARGET httplib::httplib) add_library(httplib INTERFACE) target_include_directories(httplib INTERFACE ./cpp-httplib) target_compile_definitions(httplib INTERFACE -DCPPHTTPLIB_OPENSSL_SUPPORT) @@ -136,6 +133,7 @@ if (ENABLE_WEB_SERVICE AND NOT TARGET cpp-jwt::cpp-jwt) add_library(cpp-jwt INTERFACE) target_include_directories(cpp-jwt INTERFACE ./cpp-jwt/include) target_compile_definitions(cpp-jwt INTERFACE CPP_JWT_USE_VENDORED_NLOHMANN_JSON) + target_link_libraries(cpp-jwt INTERFACE ${OPENSSL_LIBRARIES}) add_library(cpp-jwt::cpp-jwt ALIAS cpp-jwt) endif() diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index d17ff5240..9a3ebe077 100755 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp @@ -36,23 +36,18 @@ VkSurfaceFormatKHR ChooseSwapSurfaceFormat(vk::Span formats) VkPresentModeKHR ChooseSwapPresentMode(vk::Span modes) { // Mailbox (triple buffering) doesn't lock the application like fifo (vsync), // prefer it if vsync option is not selected - // AMD proprietary drivers can't render past the screen's refresh rate const auto found_mailbox = std::find(modes.begin(), modes.end(), VK_PRESENT_MODE_MAILBOX_KHR); - const auto found_imm = std::find(modes.begin(), modes.end(), VK_PRESENT_MODE_IMMEDIATE_KHR); - if (!Settings::values.use_speed_limit.GetValue() && found_imm != modes.end()) { - return VK_PRESENT_MODE_IMMEDIATE_KHR; + if (Settings::values.fullscreen_mode.GetValue() == Settings::FullscreenMode::Borderless && + found_mailbox != modes.end() && !Settings::values.use_vsync.GetValue()) { + return VK_PRESENT_MODE_MAILBOX_KHR; } - if (Settings::values.use_vsync.GetValue()) { - if (found_mailbox != modes.end()) { - return VK_PRESENT_MODE_MAILBOX_KHR; - } - } else { + if (!Settings::values.use_speed_limit.GetValue()) { + // FIFO present mode locks the framerate to the monitor's refresh rate, + // Find an alternative to surpass this limitation if FPS is unlocked. + const auto found_imm = std::find(modes.begin(), modes.end(), VK_PRESENT_MODE_IMMEDIATE_KHR); if (found_imm != modes.end()) { return VK_PRESENT_MODE_IMMEDIATE_KHR; } - if (found_mailbox != modes.end()) { - return VK_PRESENT_MODE_MAILBOX_KHR; - } } return VK_PRESENT_MODE_FIFO_KHR; } diff --git a/src/yuzu/applets/qt_controller.cpp b/src/yuzu/applets/qt_controller.cpp index 397eeefad..56aa17fd1 100755 --- a/src/yuzu/applets/qt_controller.cpp +++ b/src/yuzu/applets/qt_controller.cpp @@ -542,19 +542,14 @@ void QtControllerSelectorDialog::UpdateControllerState(std::size_t player_index) const auto player_connected = player_groupboxes[player_index]->isChecked() && controller_type != Core::HID::NpadStyleIndex::Handheld; - if (controller->GetNpadStyleIndex(true) == controller_type && - controller->IsConnected(true) == player_connected) { - return; - } - // Disconnect the controller first. UpdateController(controller, controller_type, false); // Handheld if (player_index == 0) { + auto* handheld = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); + UpdateController(handheld, controller_type, false); if (controller_type == Core::HID::NpadStyleIndex::Handheld) { - auto* handheld = - system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld); UpdateController(handheld, Core::HID::NpadStyleIndex::Handheld, player_groupboxes[player_index]->isChecked()); }