mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-27 07:14:23 +01:00
Tests/HostTiming: Correct GCC Compile error.
This commit is contained in:
parent
e77ee67bfa
commit
45d29436b3
@ -22,7 +22,6 @@ static std::array<s64, 5> delays{};
|
||||
|
||||
static std::bitset<CB_IDS.size()> callbacks_ran_flags;
|
||||
static u64 expected_callback = 0;
|
||||
static s64 lateness = 0;
|
||||
|
||||
template <unsigned int IDX>
|
||||
void HostCallbackTemplate(u64 userdata, s64 nanoseconds_late) {
|
||||
@ -34,8 +33,6 @@ void HostCallbackTemplate(u64 userdata, s64 nanoseconds_late) {
|
||||
++expected_callback;
|
||||
}
|
||||
|
||||
static u64 callbacks_done = 0;
|
||||
|
||||
struct ScopeInit final {
|
||||
ScopeInit() {
|
||||
core_timing.Initialize();
|
||||
@ -47,6 +44,20 @@ struct ScopeInit final {
|
||||
Core::HostTiming::CoreTiming core_timing;
|
||||
};
|
||||
|
||||
#pragma optimize("", off)
|
||||
|
||||
static u64 TestTimerSpeed(Core::HostTiming::CoreTiming& core_timing) {
|
||||
u64 start = core_timing.GetGlobalTimeNs().count();
|
||||
u64 placebo = 0;
|
||||
for (std::size_t i = 0; i < 1000; i++) {
|
||||
placebo += core_timing.GetGlobalTimeNs().count();
|
||||
}
|
||||
u64 end = core_timing.GetGlobalTimeNs().count();
|
||||
return (end - start);
|
||||
}
|
||||
|
||||
#pragma optimize("", on)
|
||||
|
||||
TEST_CASE("HostTiming[BasicOrder]", "[core]") {
|
||||
ScopeInit guard;
|
||||
auto& core_timing = guard.core_timing;
|
||||
@ -85,18 +96,6 @@ TEST_CASE("HostTiming[BasicOrder]", "[core]") {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma optimize("", off)
|
||||
u64 TestTimerSpeed(Core::HostTiming::CoreTiming& core_timing) {
|
||||
u64 start = core_timing.GetGlobalTimeNs().count();
|
||||
u64 placebo = 0;
|
||||
for (std::size_t i = 0; i < 1000; i++) {
|
||||
placebo += core_timing.GetGlobalTimeNs().count();
|
||||
}
|
||||
u64 end = core_timing.GetGlobalTimeNs().count();
|
||||
return (end - start);
|
||||
}
|
||||
#pragma optimize("", on)
|
||||
|
||||
TEST_CASE("HostTiming[BasicOrderNoPausing]", "[core]") {
|
||||
ScopeInit guard;
|
||||
auto& core_timing = guard.core_timing;
|
||||
|
Loading…
Reference in New Issue
Block a user