Rework CoreTiming
This commit is contained in:
parent
c765d5be0b
commit
240650f6a6
13 changed files with 154 additions and 82 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <cstdlib>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "core/core.h"
|
||||
|
@ -25,13 +26,15 @@ u64 expected_callback = 0;
|
|||
std::mutex control_mutex;
|
||||
|
||||
template <unsigned int IDX>
|
||||
void HostCallbackTemplate(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) {
|
||||
std::optional<std::chrono::nanoseconds> HostCallbackTemplate(std::uintptr_t user_data, s64 time,
|
||||
std::chrono::nanoseconds ns_late) {
|
||||
std::unique_lock<std::mutex> lk(control_mutex);
|
||||
static_assert(IDX < CB_IDS.size(), "IDX out of range");
|
||||
callbacks_ran_flags.set(IDX);
|
||||
REQUIRE(CB_IDS[IDX] == user_data);
|
||||
delays[IDX] = ns_late.count();
|
||||
++expected_callback;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
struct ScopeInit final {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue