From 318dc2a69d13d4498dc01ce5759bb12e049d76d9 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 25 Jan 2024 07:35:49 +0100 Subject: [PATCH] early-access version 4086 --- README.md | 2 +- src/common/arm64/native_clock.cpp | 8 ++------ src/common/arm64/native_clock.h | 3 --- src/common/wall_clock.cpp | 9 +-------- src/common/wall_clock.h | 2 -- src/common/x64/native_clock.cpp | 8 ++------ src/common/x64/native_clock.h | 3 --- src/core/core_timing.cpp | 1 - src/video_core/vulkan_common/vulkan_wrapper.cpp | 10 ++++++++++ 9 files changed, 16 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index aa6cc055d..0a7eb3885 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 4085. +This is the source code for early-access 4086. ## Legal Notice diff --git a/src/common/arm64/native_clock.cpp b/src/common/arm64/native_clock.cpp index 55147f0f2..76ffb74ba 100755 --- a/src/common/arm64/native_clock.cpp +++ b/src/common/arm64/native_clock.cpp @@ -29,10 +29,6 @@ NativeClock::NativeClock() { gputick_cntfrq_factor = GetFixedPointFactor(GPUTickFreq, host_cntfrq); } -void NativeClock::Reset() { - start_ticks = GetUptime(); -} - std::chrono::nanoseconds NativeClock::GetTimeNS() const { return std::chrono::nanoseconds{MultiplyHigh(GetUptime(), ns_cntfrq_factor)}; } @@ -46,11 +42,11 @@ std::chrono::milliseconds NativeClock::GetTimeMS() const { } s64 NativeClock::GetCNTPCT() const { - return MultiplyHigh(GetUptime() - start_ticks, guest_cntfrq_factor); + return MultiplyHigh(GetUptime(), guest_cntfrq_factor); } s64 NativeClock::GetGPUTick() const { - return MultiplyHigh(GetUptime() - start_ticks, gputick_cntfrq_factor); + return MultiplyHigh(GetUptime(), gputick_cntfrq_factor); } s64 NativeClock::GetUptime() const { diff --git a/src/common/arm64/native_clock.h b/src/common/arm64/native_clock.h index 39cad5710..94bc1882e 100755 --- a/src/common/arm64/native_clock.h +++ b/src/common/arm64/native_clock.h @@ -11,8 +11,6 @@ class NativeClock final : public WallClock { public: explicit NativeClock(); - void Reset() override; - std::chrono::nanoseconds GetTimeNS() const override; std::chrono::microseconds GetTimeUS() const override; @@ -42,7 +40,6 @@ private: FactorType ms_cntfrq_factor; FactorType guest_cntfrq_factor; FactorType gputick_cntfrq_factor; - s64 start_ticks; }; } // namespace Common::Arm64 diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp index 22174fcc1..e25fedf2d 100755 --- a/src/common/wall_clock.cpp +++ b/src/common/wall_clock.cpp @@ -20,10 +20,6 @@ class StandardWallClock final : public WallClock { public: explicit StandardWallClock() {} - void Reset() override { - start_time = std::chrono::system_clock::now(); - } - std::chrono::nanoseconds GetTimeNS() const override { return std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch()); @@ -49,16 +45,13 @@ public: s64 GetUptime() const override { return std::chrono::duration_cast( - std::chrono::system_clock::now() - start_time) + std::chrono::steady_clock::now().time_since_epoch()) .count(); } bool IsNative() const override { return false; } - -private: - std::chrono::system_clock::time_point start_time{}; }; std::unique_ptr CreateOptimalClock() { diff --git a/src/common/wall_clock.h b/src/common/wall_clock.h index 192d4466a..eddad0d99 100755 --- a/src/common/wall_clock.h +++ b/src/common/wall_clock.h @@ -19,8 +19,6 @@ public: virtual ~WallClock() = default; - virtual void Reset() = 0; - /// @returns The time in nanoseconds since the construction of this clock. virtual std::chrono::nanoseconds GetTimeNS() const = 0; diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 21dfce8a8..48af5e915 100755 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp @@ -15,10 +15,6 @@ NativeClock::NativeClock(u64 rdtsc_frequency_) cntpct_rdtsc_factor{GetFixedPoint64Factor(CNTFRQ, rdtsc_frequency)}, gputick_rdtsc_factor{GetFixedPoint64Factor(GPUTickFreq, rdtsc_frequency)} {} -void NativeClock::Reset() { - start_ticks = FencedRDTSC(); -} - std::chrono::nanoseconds NativeClock::GetTimeNS() const { return std::chrono::nanoseconds{MultiplyHigh(GetUptime(), ns_rdtsc_factor)}; } @@ -32,11 +28,11 @@ std::chrono::milliseconds NativeClock::GetTimeMS() const { } s64 NativeClock::GetCNTPCT() const { - return MultiplyHigh(GetUptime() - start_ticks, cntpct_rdtsc_factor); + return MultiplyHigh(GetUptime(), cntpct_rdtsc_factor); } s64 NativeClock::GetGPUTick() const { - return MultiplyHigh(GetUptime() - start_ticks, gputick_rdtsc_factor); + return MultiplyHigh(GetUptime(), gputick_rdtsc_factor); } s64 NativeClock::GetUptime() const { diff --git a/src/common/x64/native_clock.h b/src/common/x64/native_clock.h index 1fa151b09..0d000e3c8 100755 --- a/src/common/x64/native_clock.h +++ b/src/common/x64/native_clock.h @@ -11,8 +11,6 @@ class NativeClock final : public WallClock { public: explicit NativeClock(u64 rdtsc_frequency_); - void Reset() override; - std::chrono::nanoseconds GetTimeNS() const override; std::chrono::microseconds GetTimeUS() const override; @@ -28,7 +26,6 @@ public: bool IsNative() const override; private: - u64 start_ticks; u64 rdtsc_frequency; u64 ns_rdtsc_factor; diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 8918f46d3..9f9744e14 100755 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -66,7 +66,6 @@ void CoreTiming::Initialize(std::function&& on_thread_init_) { event_fifo_id = 0; shutting_down = false; cpu_ticks = 0; - clock->Reset(); if (is_multicore) { timer_thread = std::make_unique(ThreadEntry, std::ref(*this)); } diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 965bd2e6a..64a2404a0 100755 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -39,6 +39,10 @@ void SortPhysicalDevicesPerVendor(std::vector& devices, } } +bool IsMicrosoftDozen(const char* device_name) { + return std::strstr(device_name, "Microsoft") != nullptr; +} + void SortPhysicalDevices(std::vector& devices, const InstanceDispatch& dld) { // Sort by name, this will set a base and make GPUs with higher numbers appear first // (e.g. GTX 1650 will intentionally be listed before a GTX 1080). @@ -52,6 +56,12 @@ void SortPhysicalDevices(std::vector& devices, const InstanceD }); // Prefer Nvidia over AMD, AMD over Intel, Intel over the rest. SortPhysicalDevicesPerVendor(devices, dld, {0x10DE, 0x1002, 0x8086}); + // Demote Microsoft's Dozen devices to the bottom. + SortPhysicalDevices( + devices, dld, + [](const VkPhysicalDeviceProperties& lhs, const VkPhysicalDeviceProperties& rhs) { + return IsMicrosoftDozen(rhs.deviceName) && !IsMicrosoftDozen(lhs.deviceName); + }); } template