From 6d16ab8a990136045bcf77a52249dc761275ec0e Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 14 May 2023 12:14:58 +0200 Subject: [PATCH] early-access version 3589 --- README.md | 2 +- .../helpers/joycon_protocol/joycon_types.h | 1 + src/input_common/helpers/joycon_protocol/nfc.cpp | 10 +++++++--- src/input_common/helpers/joycon_protocol/nfc.h | 5 ++++- src/video_core/vulkan_common/vulkan_device.cpp | 10 ++++++++++ .../vulkan_common/vulkan_memory_allocator.cpp | 2 +- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 172a1b5a3..d7ddc0698 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3588. +This is the source code for early-access 3589. ## Legal Notice diff --git a/src/input_common/helpers/joycon_protocol/joycon_types.h b/src/input_common/helpers/joycon_protocol/joycon_types.h index b03143e04..1c8d294b0 100755 --- a/src/input_common/helpers/joycon_protocol/joycon_types.h +++ b/src/input_common/helpers/joycon_protocol/joycon_types.h @@ -394,6 +394,7 @@ enum class DriverResult { InvalidHandle, NotSupported, Disabled, + Delayed, Unknown, }; diff --git a/src/input_common/helpers/joycon_protocol/nfc.cpp b/src/input_common/helpers/joycon_protocol/nfc.cpp index 77ea6d5cf..14818ae33 100755 --- a/src/input_common/helpers/joycon_protocol/nfc.cpp +++ b/src/input_common/helpers/joycon_protocol/nfc.cpp @@ -72,6 +72,11 @@ DriverResult NfcProtocol::StartNFCPollingMode() { } DriverResult NfcProtocol::ScanAmiibo(std::vector& data) { + if (update_counter++ < AMIIBO_UPDATE_DELAY) { + return DriverResult::Delayed; + } + update_counter = 0; + LOG_DEBUG(Input, "Start NFC pooling Mode"); ScopedSetBlocking sb(this); DriverResult result{DriverResult::Success}; @@ -87,7 +92,7 @@ DriverResult NfcProtocol::ScanAmiibo(std::vector& data) { result = WaitUntilNfcIsReady(); } if (result == DriverResult::Success) { - result = StartPolling(tag_data); + result = StartPolling(tag_data, 7); } if (result == DriverResult::Success) { result = GetAmiiboData(data); @@ -129,9 +134,8 @@ DriverResult NfcProtocol::WaitUntilNfcIsReady() { return DriverResult::Success; } -DriverResult NfcProtocol::StartPolling(TagFoundData& data) { +DriverResult NfcProtocol::StartPolling(TagFoundData& data, std::size_t timeout_limit) { LOG_DEBUG(Input, "Start Polling for tag"); - constexpr std::size_t timeout_limit = 7; MCUCommandResponse output{}; std::size_t tries = 0; diff --git a/src/input_common/helpers/joycon_protocol/nfc.h b/src/input_common/helpers/joycon_protocol/nfc.h index 11e263e07..eddf5932e 100755 --- a/src/input_common/helpers/joycon_protocol/nfc.h +++ b/src/input_common/helpers/joycon_protocol/nfc.h @@ -32,6 +32,8 @@ public: bool IsEnabled() const; private: + static constexpr std::size_t AMIIBO_UPDATE_DELAY = 15; + struct TagFoundData { u8 type; std::vector uuid; @@ -39,7 +41,7 @@ private: DriverResult WaitUntilNfcIsReady(); - DriverResult StartPolling(TagFoundData& data); + DriverResult StartPolling(TagFoundData& data, std::size_t timeout_limit = 1); DriverResult ReadTag(const TagFoundData& data); @@ -56,6 +58,7 @@ private: NFCReadBlockCommand GetReadBlockCommand(NFCPages pages) const; bool is_enabled{}; + std::size_t update_counter{}; }; } // namespace InputCommon::Joycon diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 5bc424897..cfaa85836 100755 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -406,6 +406,14 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable = false; features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation = false; dynamic_state3_blending = false; + + const u32 version = (properties.properties.driverVersion << 3) >> 3; + if (version < VK_MAKE_API_VERSION(0, 23, 1, 0)) { + LOG_WARNING(Render_Vulkan, + "RADV versions older than 23.1.0 have broken depth clamp dynamic state"); + features.extended_dynamic_state3.extendedDynamicState3DepthClampEnable = false; + dynamic_state3_enables = false; + } } if (extensions.vertex_input_dynamic_state && is_radv) { // TODO(ameerj): Blacklist only offending driver versions @@ -1009,6 +1017,8 @@ void Device::CollectPhysicalMemoryInfo() { device_access_memory += mem_properties.memoryHeaps[element].size; } if (!is_integrated) { + const u64 reserve_memory = std::min(device_access_memory / 8, 2_GiB); + device_access_memory -= reserve_memory; return; } const s64 available_memory = static_cast(device_access_memory - device_initial_usage); diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp index 28307f3fa..fc94c578b 100755 --- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp +++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp @@ -147,7 +147,7 @@ public: /// Returns whether this allocation is compatible with the arguments. [[nodiscard]] bool IsCompatible(VkMemoryPropertyFlags flags, u32 type_mask) const { - return (flags & property_flags) == property_flags && (type_mask & shifted_memory_type) != 0; + return (flags & property_flags) == flags && (type_mask & shifted_memory_type) != 0; } private: