mirror of
https://github.com/sal063/AC6_recomp
synced 2026-09-10 12:35:06 -04:00
Refactor native graphics backend and fix build errors
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <mutex>
|
||||
|
||||
#include <rex/cvar.h>
|
||||
#include <rex/system/kernel_state.h>
|
||||
|
||||
REXCVAR_DEFINE_BOOL(ac6_unlock_fps, false, "AC6", "Unlock frame rate to 60fps");
|
||||
REXCVAR_DEFINE_BOOL(ac6_timing_hooks_enabled, true, "AC6",
|
||||
@@ -47,13 +48,14 @@ void ac6DeltaDivisorHook(PPCRegister& r29) {
|
||||
}
|
||||
|
||||
void ac6PresentTimingHook(PPCRegister& /*r31*/) {
|
||||
ac6::d3d::OnFrameBoundary();
|
||||
ac6::graphics::OnFrameBoundary();
|
||||
static uint64_t last_log = 0;
|
||||
if (g_frame_count % 60 == 0 && g_frame_count != last_log) {
|
||||
REXLOG_INFO("ac6PresentTimingHook firing: frame={}", g_frame_count);
|
||||
last_log = g_frame_count;
|
||||
}
|
||||
// ac6::d3d::OnFrameBoundary(); // MOVED TO GPU THREAD
|
||||
|
||||
const auto now = Clock::now();
|
||||
double frame_time_ms = 0.0;
|
||||
double fps = 0.0;
|
||||
uint64_t frame_count = 0;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(g_frame_mutex);
|
||||
if (g_frame_start.time_since_epoch().count() != 0) {
|
||||
@@ -63,9 +65,6 @@ void ac6PresentTimingHook(PPCRegister& /*r31*/) {
|
||||
++g_frame_count;
|
||||
}
|
||||
g_frame_start = now;
|
||||
frame_time_ms = g_frame_time_ms;
|
||||
fps = g_fps;
|
||||
frame_count = g_frame_count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user