Refactor native graphics backend and fix build errors

This commit is contained in:
salh
2026-04-19 13:05:43 +03:00
parent 0a1c92d048
commit 882d20f686
49 changed files with 3383 additions and 567 deletions
+7 -8
View File
@@ -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;
}
}