Run Minecraft: runtime HLE, D3D12.X device on the host GPU, shader IR
Loader: map title-shipped DLLs, patch static TLS loads to slot 0, crash reporter, title paths for GetModuleFileName*. HLE: task queue and async, XUser (one offline user), system ids, title id, features, invites, game events, persistent local storage, GameInput with no devices, xmem, console audio hardware queues, life cycle (close suspends, then terminates), and a file layer with virtual drives rewritten in path-taking imports. GPU: D3D12.X device, DXGI chain, heaps, resources, fences, queues and command lists translated onto a host D3D12 device; clears, barriers, copies, resolves and PresentX into the title's window. Shaders: SGD5 reader and `victory translate`; SSA IR with node splitting for irreducible flow; structurisation removing EXEC. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
12caefe804
commit
754619f30e
61 files changed
+12775
-88
No files matched your search
@@ -0,0 +1,51 @@
|
||||
//! `d3d12_xs.dll`: device creation. The device and everything it creates
|
||||
//! live in `victory-gpu`.
|
||||
|
||||
use victory_gpu::device;
|
||||
|
||||
use crate::{HleExport, HleModule};
|
||||
|
||||
pub(crate) fn module() -> HleModule {
|
||||
HleModule {
|
||||
name: "d3d12x",
|
||||
dlls: &["d3d12_xs.dll"],
|
||||
exports: vec![
|
||||
HleExport {
|
||||
name: "D3D12XboxCreateDevice",
|
||||
address: device::create as *const () as usize,
|
||||
},
|
||||
HleExport {
|
||||
name: "D3D12SerializeRootSignature",
|
||||
address: victory_gpu::root::serialize as *const () as usize,
|
||||
},
|
||||
// A data import: the title reads the id at this address.
|
||||
HleExport {
|
||||
name: "IID_ID3D12Device",
|
||||
address: (&raw const device::IID) as usize,
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{HleResolver, HostPolicy};
|
||||
use victory_loader::ImportResolver;
|
||||
use victory_loader::Resolution;
|
||||
use victory_pe::ImportSymbol;
|
||||
|
||||
#[test]
|
||||
fn the_interface_id_import_is_bound_to_data() {
|
||||
let symbol = ImportSymbol::Name {
|
||||
hint: 0,
|
||||
name: "IID_ID3D12Device".into(),
|
||||
};
|
||||
let r = HleResolver::new(HostPolicy::none());
|
||||
let Resolution::Found { address, .. } = r.resolve("d3d12_xs.dll", &symbol) else {
|
||||
panic!("not bound");
|
||||
};
|
||||
// SAFETY: the address is our static id.
|
||||
assert_eq!(unsafe { *(address as *const [u8; 16]) }, device::IID);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user