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
@@ -346,6 +346,59 @@ fn feature_levels(data: *mut c_void) -> HRESULT {
|
||||
}
|
||||
}
|
||||
|
||||
/// Device methods 0x1c8 and 0x218 (`SLOT`). Grand Theft Auto VI calls both
|
||||
/// (title+0x2477578 and title+0x24800d5) as `(this, description, interface
|
||||
/// id, out)`, asks for `ID3D12PipelineState`, and on success keeps the
|
||||
/// object `out` names and draws with it; on failure it goes without that
|
||||
/// pipeline, silently. What the descriptions hold is not known: the calls
|
||||
/// fail as they always did, with `out` null, and the first ones log the
|
||||
/// description's words and what its first word points at, so that the two
|
||||
/// methods can be written.
|
||||
/// shortcut: not implemented. Answering `S_OK` here without making the
|
||||
/// pipeline would hand the title whatever its stack held as an object.
|
||||
extern "system" fn unknown_pipeline<const SLOT: usize>(
|
||||
_: This,
|
||||
desc: *const u8,
|
||||
_iid: *const Iid,
|
||||
out: *mut This,
|
||||
) -> HRESULT {
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
static CALLS: [AtomicU32; 2] = [const { AtomicU32::new(0) }; 2];
|
||||
let calls = CALLS[usize::from(SLOT == 0x218)].fetch_add(1, Ordering::Relaxed) + 1;
|
||||
if !out.is_null() {
|
||||
// SAFETY: the title's out pointer (a local of its own).
|
||||
unsafe { *out = std::ptr::null() };
|
||||
}
|
||||
if calls <= 4 || calls.is_power_of_two() {
|
||||
// Sixteen 64-bit words at `at`, read through the kernel: neither
|
||||
// pointer is known to be mapped.
|
||||
#[cfg(windows)]
|
||||
let words = |at: usize| -> Option<Vec<u64>> {
|
||||
let mut bytes = [0u8; 128];
|
||||
(at != 0 && crate::host::read_into(at as *const u8, &mut bytes)).then(|| {
|
||||
bytes
|
||||
.chunks_exact(8)
|
||||
.map(|c| c.iter().rev().fold(0u64, |v, &b| v << 8 | u64::from(b)))
|
||||
.collect()
|
||||
})
|
||||
};
|
||||
#[cfg(not(windows))]
|
||||
let words = |_: usize| None::<Vec<u64>>;
|
||||
let description = words(desc as usize);
|
||||
let first = description
|
||||
.as_ref()
|
||||
.and_then(|w| words(w[0] as usize));
|
||||
tracing::warn!(
|
||||
slot = format_args!("{:#x}", SLOT),
|
||||
calls,
|
||||
description = format_args!("{description:x?}"),
|
||||
first_points_at = format_args!("{first:x?}"),
|
||||
"a pipeline creation method that is not implemented: the title goes without this pipeline"
|
||||
);
|
||||
}
|
||||
E_NOTIMPL
|
||||
}
|
||||
|
||||
/// IUnknown 3, object methods 4, device methods 76 (0x18-0x290), then the
|
||||
/// methods `ID3D12Device1` to `ID3D12Device8` add, in order: 3, 1, 3, 6, 9,
|
||||
/// 1, 2, 9 (0x298-0x3a0, the console's own among them), then those of
|
||||
@@ -382,8 +435,10 @@ static FUNCTIONS: Table<160> = {
|
||||
f[39] = query::create as *const (); // 0x138
|
||||
f[41] = signature::create as *const (); // 0x148
|
||||
f[48] = queue::create_x as *const (); // 0x180
|
||||
f[57] = unknown_pipeline::<0x1c8> as *const (); // 0x1c8
|
||||
f[61] = descriptor::create_sampler_x as *const (); // 0x1e8
|
||||
f[62] = pipeline::create_compute_x as *const (); // 0x1f0
|
||||
f[67] = unknown_pipeline::<0x218> as *const (); // 0x218
|
||||
f[69] = object::ignore as *const (); // 0x228 debug error filter
|
||||
f[70] = descriptor::create_placed_srv as *const (); // 0x230
|
||||
f[71] = descriptor::create_placed_uav as *const (); // 0x238
|
||||
|
||||
Reference in new issue
Block a user