victory-gta6: this fork's changes on top of VIctory main (ffe310e)
World rendering, lighting, frame-rate and memory work for Grand Theft Auto VI (Xbox Series X profile) on one Windows PC with an NVIDIA RTX 4070. The README describes the state, the changes and the credits. Based on VIctory by Marvisak and contributors (GPL-3.0-or-later); XCL by ivall and contributors was used as a reference. No game files are included. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
1 parent
45c6e80601
commit
6fa814fba5
61 files changed
+32259
-1274
No files matched your search
@@ -126,8 +126,22 @@ pub(crate) extern "system" fn wait(
|
||||
token: *mut u64,
|
||||
) -> HRESULT {
|
||||
let origin = kind == ORIGIN;
|
||||
let (tick, wait) = next_tick(kind);
|
||||
let (mut tick, mut wait) = next_tick(kind);
|
||||
let limit = Duration::from_millis(u64::from(timeout_ms));
|
||||
// A blocking wait for an event that has happened since the last wait
|
||||
// for it ended (a frame took longer than a tick) ends at once, on the
|
||||
// tick that passed: sleeping on to the next one cost 17 ms of every
|
||||
// 730 ms frame (run 58: "2.0 frame waits sleeping 16.8 ms"). Polls (a
|
||||
// time-out shorter than a tick) answer as before.
|
||||
// `VICTORY_LATE_WAITS=1` sleeps to the next tick, as before.
|
||||
static SLEEP: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
|
||||
if !*SLEEP.get_or_init(|| std::env::var_os("VICTORY_LATE_WAITS").is_some_and(|v| v == "1"))
|
||||
&& limit >= wait
|
||||
&& tick > last(kind).load(Ordering::Relaxed) + 1
|
||||
{
|
||||
tick -= 1;
|
||||
wait = Duration::ZERO;
|
||||
}
|
||||
let hr = if wait > limit {
|
||||
std::thread::sleep(limit);
|
||||
TIMEOUT
|
||||
@@ -136,6 +150,12 @@ pub(crate) extern "system" fn wait(
|
||||
last(kind).fetch_max(tick, Ordering::Relaxed);
|
||||
S_OK
|
||||
};
|
||||
#[cfg(all(windows, feature = "diagnostics"))]
|
||||
{
|
||||
use crate::copystat::{C, add};
|
||||
add(C::PaceWaits, 1);
|
||||
add(C::PaceUs, wait.min(limit).as_micros() as u64);
|
||||
}
|
||||
// A frame begun on a time-out takes no tick: its flip still does.
|
||||
if origin && (hr == S_OK || flags & TOKEN_ON_TIMEOUT != 0) {
|
||||
// Tokens count frames (consecutive), not ticks.
|
||||
|
||||
Reference in new issue
Block a user