The game is no longer named in the tree
Comments, documents and descriptions now say "the title". No code changes. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
1 parent
90228a7dc6
commit
4e17478b9c
55 files changed
+161
-161
No files matched your search
@@ -31,11 +31,11 @@ pub(crate) fn listed(n: u64) -> bool {
|
||||
// `VICTORY_CAPTURE_WORLD`: also the 2nd and the 6th frame after the first
|
||||
// one that ran 500 draws or more (a title's first 3D frames: their
|
||||
// numbers depend on how long the menus were shown), and the 30th and
|
||||
// the 80th (Grand Theft Auto VI opens with a cutscene made in the
|
||||
// the 80th (the title opens with a cutscene made in the
|
||||
// engine: later shots of it, in case the first is dark by design).
|
||||
//
|
||||
// `VICTORY_CAPTURE_WORLD_ALSO` (comma-separated): more frames counted
|
||||
// from that first one (Grand Theft Auto VI's blue patches show from
|
||||
// from that first one (the title's blue patches show from
|
||||
// about the 118th frame on, when the window's model has arrived and
|
||||
// the reflections hold values: none of the four above has them).
|
||||
static ALSO: std::sync::OnceLock<Vec<u64>> = std::sync::OnceLock::new();
|
||||
@@ -63,7 +63,7 @@ pub(crate) fn op(list: usize, what: impl FnOnce() -> String) {
|
||||
if !listed(frame) {
|
||||
// Before the world: the last lines are kept, and written out when
|
||||
// it starts (`before-world-ops.txt`): what the title drew just
|
||||
// before (Grand Theft Auto VI shows a title card there, whose text
|
||||
// before (the title shows a title card there, whose text
|
||||
// did not show).
|
||||
if world_on() && WORLD.load(std::sync::atomic::Ordering::Relaxed) == u64::MAX {
|
||||
// At most 300 lines of a frame: the world's first frame alone
|
||||
|
||||
@@ -17,7 +17,7 @@ impl Console {
|
||||
/// advanced configuration; Series S has one range, counted as standard
|
||||
/// (7,776 MiB, the published console-mode figure).
|
||||
// shortcut: later system updates gave Series S titles more (amount not
|
||||
// published here); Grand Theft Auto VI sizes nothing from this figure
|
||||
// published here); the title sizes nothing from this figure
|
||||
// (it goes by the device type), so update it if a title does.
|
||||
pub const fn title_memory(self) -> (usize, usize) {
|
||||
match self {
|
||||
|
||||
@@ -34,7 +34,7 @@ pub(crate) struct HeapDesc {
|
||||
nodes: u32,
|
||||
}
|
||||
|
||||
/// Newer titles (Grand Theft Auto VI) pass the description followed by
|
||||
/// Newer titles (the title) pass the description followed by
|
||||
/// memory of their own for the descriptors: an address and its size in
|
||||
/// bytes, or a null address to have the heap allocate (inferred from the
|
||||
/// title's call sites; older titles pass the plain description).
|
||||
@@ -73,7 +73,7 @@ impl Heap {
|
||||
}
|
||||
|
||||
/// The host heap, made on first use from what the title wrote so far.
|
||||
/// Made late because a host view heap the size of Grand Theft Auto VI's
|
||||
/// Made late because a host view heap the size of the title's
|
||||
/// costs over 100 MB of commit, which its boot needs for its page pool.
|
||||
#[cfg(windows)]
|
||||
pub(crate) fn host(&self) -> Option<&host::HostHeap> {
|
||||
@@ -330,7 +330,7 @@ impl View {
|
||||
/// Views without a resource object have nothing that releases them, and a
|
||||
/// title copies descriptors as bytes, so nothing says when the last
|
||||
/// descriptor naming an entry is gone: such entries were kept for the run.
|
||||
/// Grand Theft Auto VI writes some 14,000 constant buffer views a frame,
|
||||
/// The title writes some 14,000 constant buffer views a frame,
|
||||
/// each at the address its constants have that frame: 2,450,139 entries
|
||||
/// after four minutes of play, 1,047 MB with the index, and 11,000 more
|
||||
/// every second (run 65). So the two kinds that carry an address are not
|
||||
@@ -600,7 +600,7 @@ impl View {
|
||||
|
||||
/// Title slots (their handles) written with a view of a texture object
|
||||
/// that had no host copy then, by texture. A title texture gets its host
|
||||
/// copy on first use (`resource.rs` `Hosted`), and Grand Theft Auto VI
|
||||
/// copy on first use (`resource.rs` `Hosted`), and the title
|
||||
/// writes each texture's views into its view heap when it creates the
|
||||
/// texture: making those host slots would make every host copy at once.
|
||||
/// They are made when the texture is: translated shaders index the heap
|
||||
@@ -1157,7 +1157,7 @@ mod tests {
|
||||
assert_ne!(old, new, "a new generation");
|
||||
}
|
||||
|
||||
/// Grand Theft Auto VI places its shader-visible heap in its own memory
|
||||
/// The title places its shader-visible heap in its own memory
|
||||
/// and checks that the heap starts there.
|
||||
#[test]
|
||||
fn placed_heaps_start_at_the_title_memory() {
|
||||
|
||||
@@ -76,7 +76,7 @@ pub(crate) struct HostHeap {
|
||||
/// the last [`TABLED_FRAMES`] frames is due only [`TABLED_GRACE`]
|
||||
/// frames later, by when its draw has read it. A title that builds a
|
||||
/// table per draw writes thousands of texture views a frame into slots
|
||||
/// only tables read (Grand Theft Auto VI: some 2,500 a frame in its
|
||||
/// only tables read (the title: some 2,500 a frame in its
|
||||
/// opening cutscene, a few hundred textures over and over), and every
|
||||
/// one of them stood in the queue of textures picked by index, ahead
|
||||
/// of or behind the ones shaders do pick by index.
|
||||
@@ -252,7 +252,7 @@ const TABLED_FRAMES: u64 = 240;
|
||||
/// Frames a write of a table's slot waits in the queue for the draw that
|
||||
/// reads it, before the slot is taken for one shaders pick by index.
|
||||
/// Frames as `crate::frame::current` counts them: in its opening cutscene
|
||||
/// Grand Theft Auto VI begins two or three of them per frame it presents
|
||||
/// The title begins two or three of them per frame it presents
|
||||
/// (435 begun in the 353 s of run 52's, for some 140 presented).
|
||||
const TABLED_GRACE: u64 = 8;
|
||||
|
||||
@@ -512,7 +512,7 @@ const PORTABLE_VIEWS: u32 = 1_000_000;
|
||||
/// Asks the host, once, whether it caps view heaps at [`PORTABLE_VIEWS`],
|
||||
/// and if so tells the translator now (`set_view_heap_limit`) instead of
|
||||
/// when the title's heap is made: a shader keeps the limit it was
|
||||
/// translated with, and Grand Theft Auto VI makes 25 pipelines (their
|
||||
/// translated with, and the title makes 25 pipelines (their
|
||||
/// shaders translated at once) before it makes its view heap. Those would
|
||||
/// read a view index past the heap unclamped, the read that hangs NVIDIA.
|
||||
/// Called before a shader is translated.
|
||||
|
||||
@@ -29,7 +29,7 @@ pub static IID: Iid = guid(
|
||||
);
|
||||
|
||||
/// The levels the device answers to, as on PC: `ID3D12Device1` to
|
||||
/// `ID3D12Device8`, and `ID3D12Device11`, which Grand Theft Auto VI creates
|
||||
/// `ID3D12Device8`, and `ID3D12Device11`, which the title creates
|
||||
/// its device as. Each level's table is the one before plus its methods.
|
||||
const LEVEL_IIDS: [Iid; 9] = [
|
||||
guid(
|
||||
@@ -94,7 +94,7 @@ pub(crate) fn is_device(iid: *const Iid) -> bool {
|
||||
}
|
||||
|
||||
/// The interface version these layouts were checked against (2.4). Both
|
||||
/// Minecraft (March 2022) and Grand Theft Auto VI (April 2026) pass it.
|
||||
/// Minecraft (March 2022) and the title (April 2026) pass it.
|
||||
pub const CHECKED_VERSION: u32 = 0x0002_0004;
|
||||
|
||||
/// Feature level 12_2, what the console hardware supports.
|
||||
@@ -160,7 +160,7 @@ pub extern "system" fn create(
|
||||
/// queues then have the newer layouts (two more methods each; see
|
||||
/// `list` and `queue`), although the interface version stays 2.4.
|
||||
/// shortcut: the creation interface is the only sign of the newer layouts
|
||||
/// we have (Grand Theft Auto VI, April 2026, versus Minecraft, March 2022);
|
||||
/// we have (the title, April 2026, versus Minecraft, March 2022);
|
||||
/// look for a better one if a title breaks the rule.
|
||||
static NEWER: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
|
||||
|
||||
@@ -346,7 +346,7 @@ fn feature_levels(data: *mut c_void) -> HRESULT {
|
||||
}
|
||||
}
|
||||
|
||||
/// Device methods 0x1c8 and 0x218 (`SLOT`). Grand Theft Auto VI calls both
|
||||
/// Device methods 0x1c8 and 0x218 (`SLOT`). The title 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
|
||||
@@ -490,7 +490,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn newer_device_levels_are_the_same_device() {
|
||||
// ID3D12Device11, as Grand Theft Auto VI asks for it.
|
||||
// ID3D12Device11, as the title asks for it.
|
||||
let (hr, device) = create_as(&LEVEL_IIDS[8]);
|
||||
assert_eq!((hr, device), (S_OK, super::device()));
|
||||
let mut same = std::ptr::null();
|
||||
|
||||
@@ -124,7 +124,7 @@ const WINDOW_MOST: u64 = 64;
|
||||
///
|
||||
/// The step is the one the title is seen to take, not the stride its
|
||||
/// command signature names: it draws one record a call, for which the
|
||||
/// stride means nothing, and Grand Theft Auto VI names 12 bytes (the three
|
||||
/// stride means nothing, and the title names 12 bytes (the three
|
||||
/// words of a mesh dispatch) for records it keeps 32 bytes apart (2,173 of
|
||||
/// a frame's 3,349 mesh records in run 87's listed frame; 283 are 16
|
||||
/// apart, which ends a window). Walked by the named stride the window
|
||||
@@ -235,7 +235,7 @@ impl State {
|
||||
}
|
||||
|
||||
/// An experiment on the title's scissor rectangles (`VICTORY_SCISSOR_TEST=full`):
|
||||
/// they are all widened to the whole target. Grand Theft Auto VI's room at
|
||||
/// they are all widened to the whole target. The title's room at
|
||||
/// the start of the prologue lost its walls in five runs of seven, and in
|
||||
/// those runs the player's body and the world outside were cut by one
|
||||
/// rectangle around the window (run 85, frame 2046): one run with this on
|
||||
@@ -1739,7 +1739,7 @@ impl State {
|
||||
let targets: Vec<String> = self.targets.iter().filter_map(|&t| described(t)).collect();
|
||||
let _ = write!(text, " targets {targets:?} depth {:?} state [{}]", described(self.depth), p.state);
|
||||
// The title's scissor and viewport at this draw (the first of
|
||||
// each): Grand Theft Auto VI draws what it sees through a
|
||||
// each): the title draws what it sees through a
|
||||
// portal (a window, from inside a room) under the portal's
|
||||
// rectangle, and the listing did not say which draws those are.
|
||||
if let Some(r) = self.scissors.first() {
|
||||
@@ -2291,7 +2291,7 @@ impl State {
|
||||
crate::pipeline::note_drop(self.pipeline as This);
|
||||
return false;
|
||||
};
|
||||
// Indirect rectangles (Grand Theft Auto VI's tiled lighting, 256
|
||||
// Indirect rectangles (the title's tiled lighting, 256
|
||||
// indirect draws a frame, makes their corners from the vertex
|
||||
// number) are completed by the pipeline's geometry stage: the
|
||||
// arguments stay the title's, three vertices a rectangle. They
|
||||
|
||||
@@ -240,7 +240,7 @@ fn display_size() -> (u32, u32) {
|
||||
})
|
||||
}
|
||||
|
||||
/// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks
|
||||
/// The console's mode list: one 4K mode at 60 Hz (the title looks
|
||||
/// for a 120 Hz one to allow 120 Hz frame intervals).
|
||||
/// shortcut: fixed mode, not the host display's; report the host's rates if
|
||||
/// a title paces by them.
|
||||
|
||||
@@ -182,7 +182,7 @@ mod tests {
|
||||
// SAFETY: as above.
|
||||
assert_eq!(unsafe { WaitForSingleObject(event, 0) }, WAIT_OBJECT_0);
|
||||
assert_eq!(wait(f, 9, std::ptr::null_mut()), E_NOTIMPL);
|
||||
// Grand Theft Auto VI reads the value at the fence's address.
|
||||
// The title reads the value at the fence's address.
|
||||
let at = slot::<extern "system" fn(This) -> u64>(f, 0x60)(f);
|
||||
// SAFETY: the fence's value.
|
||||
assert_eq!(unsafe { *(at as *const u64) }, 5);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! to begin. Ours is a clock started by the first interval set, ticking
|
||||
//! once per interval; the token is the frame number. Each event kind
|
||||
//! (origin, vblank, flip) happens once per tick, so two waits for the same
|
||||
//! kind never end on the same tick: Grand Theft Auto VI polls the origin
|
||||
//! kind never end on the same tick: the title polls the origin
|
||||
//! with "token on time-out" (starting its next frame at once) and is paced
|
||||
//! by a blocking wait for the flip before each present.
|
||||
//!
|
||||
|
||||
@@ -808,7 +808,7 @@ struct TwinUse {
|
||||
///
|
||||
/// A 16-bit twin holds whole steps of 1/65535, and the depth written is
|
||||
/// the step times the float nearest 1/65535 (0x37800080). That is how
|
||||
/// Grand Theft Auto VI's tiled lighting computes the depth of the
|
||||
/// The title's tiled lighting computes the depth of the
|
||||
/// rectangles it then draws with the test "equal", one class of materials
|
||||
/// a draw (all six of its vertex shaders multiply the class number by that
|
||||
/// constant), so the pass and the draw give the host the same float, and
|
||||
@@ -1129,7 +1129,7 @@ fn record_twin_copy(
|
||||
// shortcut: the depth plane's twin is not given the plane (that is a
|
||||
// pass the other way: the plane read by a shader, the twin as its
|
||||
// target). The twin then lacks what draws and clears wrote to the
|
||||
// plane since shaders last wrote the twin. In Grand Theft Auto VI
|
||||
// plane since shaders last wrote the twin. In the title
|
||||
// nothing writes that plane but the twin's pass (its 192 draws against
|
||||
// it only test, run 29), so the twin lacks nothing. Counted.
|
||||
if colour && twin.plane.is_some() {
|
||||
@@ -4636,7 +4636,7 @@ impl HostList {
|
||||
/// are given what was written, and left readable by shaders. Shaders
|
||||
/// that pick a view from the heap by a computed index are not seen by
|
||||
/// `twin_use` and read the depth texture in lists that never name it
|
||||
/// (in a captured frame of Grand Theft Auto VI no table names a shadow
|
||||
/// (in a captured frame of the title no table names a shadow
|
||||
/// map for reading but the pass that fills the next one).
|
||||
fn twins_to_depth(&self) {
|
||||
const SHADER_RESOURCE: u32 = 0x40 | 0x80;
|
||||
|
||||
@@ -85,7 +85,7 @@ void main(uint3 id : SV_DispatchThreadID) {
|
||||
// Mesh dispatches: the console's are one-dimensional.
|
||||
uint3 g = src_args.Load3(src_at);
|
||||
// Ahead of its draw, a record over the most a dispatch runs is a
|
||||
// slot the title has not filled (Grand Theft Auto VI leaves all
|
||||
// slot the title has not filled (the title leaves all
|
||||
// ones there): empty, and not counted below either.
|
||||
if (ahead && g.x > 65535u) {
|
||||
g = uint3(0, 0, 0);
|
||||
|
||||
@@ -32,7 +32,7 @@ const ALLOCATOR_IIDS: [Iid; 4] = [
|
||||
|
||||
/// The list interfaces up to `ID3D12GraphicsCommandList6` (the table has
|
||||
/// all their slots): those whose ids are the same as on PC, the console's
|
||||
/// own List5 and List6 (Grand Theft Auto VI asks for List6), then the
|
||||
/// own List5 and List6 (the title asks for List6), then the
|
||||
/// device child's.
|
||||
const LIST_IIDS: [Iid; 10] = [
|
||||
guid(
|
||||
@@ -106,7 +106,7 @@ struct List {
|
||||
graphics_root_headers: [u32; 128],
|
||||
compute_root_headers: [u32; 128],
|
||||
pipeline_shadow: [u32; 8],
|
||||
/// Newer titles' lists are larger: Grand Theft Auto VI's state flush
|
||||
/// Newer titles' lists are larger: the title's state flush
|
||||
/// (title+0x32786) copies a pipeline's 32 bytes to +0x544..+0x564 and
|
||||
/// tests +0x548, so its layout runs past 0x560. Its size is unknown;
|
||||
/// this keeps our fields clear of whatever the title writes there.
|
||||
@@ -921,8 +921,8 @@ extern "system" fn copy_texture_region(
|
||||
let Some(to) = crate::resource::host_resource(dst.resource) else {
|
||||
// Texture to buffer: a read back. The list copies the texels
|
||||
// into a host buffer of ours; once it has run they go to the
|
||||
// title's buffer (`HostList::defer_read_back`). Grand Theft
|
||||
// Auto VI reads two tiny float targets back every frame (5x1
|
||||
// title's buffer (`HostList::defer_read_back`).
|
||||
// The title reads two tiny float targets back every frame (5x1
|
||||
// and 1x1 RGBA32F, 80 and 16 bytes: run 90), and read a buffer
|
||||
// nobody wrote. `VICTORY_READ_BACK=0` leaves them unmade, as
|
||||
// before.
|
||||
@@ -1406,7 +1406,7 @@ extern "system" fn reset_x(this: This, allocator: This, pipeline: This, _flags:
|
||||
|
||||
/// Newer lists' 0x4a0 `(size, alignment) -> pointer`: memory the list
|
||||
/// owns until it is reset, which the CPU writes and the GPU reads at the
|
||||
/// same address; null on failure. Grand Theft Auto VI's BVH builder puts
|
||||
/// same address; null on failure. The title's BVH builder puts
|
||||
/// its instance descriptions there (and wrote through our old
|
||||
/// `E_NOTIMPL` as a pointer).
|
||||
extern "system" fn allocate_upload(this: This, size: u64, alignment: u64) -> *mut u8 {
|
||||
@@ -1672,7 +1672,7 @@ extern "system" fn draw(_: This) {
|
||||
}
|
||||
|
||||
/// `ExecuteIndirect(signature, max count, arguments, offset, count buffer,
|
||||
/// offset)`. Grand Theft Auto VI's signatures (title+0x2479466, 2026-11-24)
|
||||
/// offset)`. The title's signatures (title+0x2479466, 2026-11-24)
|
||||
/// hold one argument each: draw (stride 16), indexed draw (20), dispatch
|
||||
/// (12), mesh dispatch (12), and the console's single-pass dispatch, type
|
||||
/// 105 (stride 12: the three group counts; its flags live in the
|
||||
@@ -1778,7 +1778,7 @@ impl ValueWait {
|
||||
/// end of the region: the title keeps these values in a 1.1 GB
|
||||
/// allocation (0xd00000000), where one question took about 8 ms, and a
|
||||
/// queue asks at every submission and every signal, for each queue that
|
||||
/// stands at a wait (Grand Theft Auto VI has five queues). That was
|
||||
/// stands at a wait (the title has five queues). That was
|
||||
/// 1.0-2.2 s of every cutscene frame on the thread that submits (runs
|
||||
/// 36-49: "between its submissions ... kernel"; 47 of 110 looks at
|
||||
/// that thread in run 49 found it in this question).
|
||||
@@ -1847,7 +1847,7 @@ static VALUE_WAITS: std::sync::Mutex<Vec<(usize, ValueWait)>> = std::sync::Mutex
|
||||
|
||||
/// The waits of the submitted `lists` that are not met yet (taken from
|
||||
/// them): what the console's GPU would stop at. The title orders work
|
||||
/// between its queues this way (Grand Theft Auto VI: the compute queue's
|
||||
/// between its queues this way (the title: the compute queue's
|
||||
/// lighting passes wait for a value the graphics queue's depth pass writes
|
||||
/// at the bottom of the pipe; run at once, they read a cleared depth
|
||||
/// buffer and nothing was lit).
|
||||
@@ -1985,7 +1985,7 @@ extern "system" fn write64(this: This, address: u64, value: u64, _flush: u32, fl
|
||||
/// the host list is cut right behind it, so that the value is stored when
|
||||
/// the card has run the list up to there, as on the console, and not when
|
||||
/// the whole list has run. Lists of other queues wait for these values
|
||||
/// (Grand Theft Auto VI: the compute list that builds the depth pyramid
|
||||
/// (the title: the compute list that builds the depth pyramid
|
||||
/// waits for one, and the meshlet culling of the same frame reads that
|
||||
/// pyramid). Off by default: every such write then ends a host list, and
|
||||
/// each part is a submission of its own.
|
||||
@@ -2126,7 +2126,7 @@ const MORE_METHODS: [(usize, *const ()); 9] = [
|
||||
/// base list, after the clears (0x198/0x1a0 as before) and before
|
||||
/// ExecuteIndirect, which moved from 0x1d8 to 0x1e8: every slot from 0x1d8
|
||||
/// on is two later (taken here as starting exactly at 0x1d8). Inferred from
|
||||
/// Grand Theft Auto VI's call shapes: ExecuteIndirect 0x1e8, bottom-of-pipe
|
||||
/// The title's call shapes: ExecuteIndirect 0x1e8, bottom-of-pipe
|
||||
/// writes 0x238/0x240, waits 0x248/0x250, depth bounds 0x230, shading rate
|
||||
/// 0x3f0/0x400, syncs 0x418/0x420, ResetX 0x458 (asserts on failure).
|
||||
const fn newer_slot(slot: usize) -> usize {
|
||||
@@ -2136,7 +2136,7 @@ const fn newer_slot(slot: usize) -> usize {
|
||||
/// Methods only newer titles' lists have. 0x490: the enhanced barrier
|
||||
/// `(group count, groups)`, with 16-byte groups `(type, count, barriers)`
|
||||
/// and 40-byte buffer barriers (title+0x95e0 builds them). 0x470 `(u64)`,
|
||||
/// called from Grand Theft Auto VI's state flush with its result unused.
|
||||
/// called from the title's state flush with its result unused.
|
||||
/// shortcut: 0x470's purpose is unknown; ignored until a title shows it
|
||||
/// matters.
|
||||
const NEWER_METHODS: [(usize, *const ()); 3] = [
|
||||
@@ -2193,7 +2193,7 @@ mod tests {
|
||||
(at(0x18), at(0x28), at(0x30))
|
||||
};
|
||||
assert!(put >= draw_limit && put >= api_limit);
|
||||
// The console's ID3D12GraphicsCommandList6, as Grand Theft Auto VI asks.
|
||||
// The console's ID3D12GraphicsCommandList6, as the title asks.
|
||||
let mut same = null;
|
||||
assert_eq!(list_query(list, &LIST_IIDS[7], &mut same), S_OK);
|
||||
assert_eq!(same, list);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! types.
|
||||
//!
|
||||
//! Host pipelines are made on a pipeline's first draw, not at creation:
|
||||
//! Grand Theft Auto VI creates some 60,000 pipelines in its first 20
|
||||
//! The title creates some 60,000 pipelines in its first 20
|
||||
//! seconds and draws with a few dozen (decision 0007, step 3). Shader
|
||||
//! containers are shared by content hash and translated once, on first
|
||||
//! use (decision 0003).
|
||||
@@ -787,7 +787,7 @@ mod tests {
|
||||
assert_eq!(slot::<extern "system" fn(This) -> u32>(p, 0x10)(p), 0);
|
||||
}
|
||||
|
||||
/// The stream layout Grand Theft Auto VI builds (title+0x86f090): root
|
||||
/// The stream layout the title builds (title+0x86f090): root
|
||||
/// signature, five shader slots (the first a mesh shader), blend, sample
|
||||
/// mask, rasterizer, depth-stencil 1, sample description, input layout,
|
||||
/// topology, render target and depth formats: 0x2b0 bytes.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Host pipelines are made by workers, not by the title thread that first
|
||||
//! records a draw with them. Translating a shader and the host driver's
|
||||
//! compile take from milliseconds to seconds each (structurisation of the
|
||||
//! biggest compute programs ~0.4 s, some driver compiles 3.4 s), and Grand
|
||||
//! Theft Auto VI's first world frame wants over 1,200 new pipelines: made
|
||||
//! biggest compute programs ~0.4 s, some driver compiles 3.4 s), and
|
||||
//! the title's first world frame wants over 1,200 new pipelines: made
|
||||
//! on its recording threads, that frame took more than 30 s and the
|
||||
//! title's GPU watchdog ended the run (decision 0007, "Pipelines made off
|
||||
//! the title's threads").
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Console primitive types the host lacks. A rectangle list gives three
|
||||
//! corners per rectangle, the second the one between the other two, and
|
||||
//! the hardware adds the fourth at `v0 + v2 - v1` (Grand Theft Auto VI's
|
||||
//! the hardware adds the fourth at `v0 + v2 - v1` (the title's
|
||||
//! full-screen rectangles come as top left, bottom left, bottom right); on
|
||||
//! the host each rectangle becomes two triangles, with the fourth vertex
|
||||
//! made from the other three on the CPU.
|
||||
|
||||
@@ -896,7 +896,7 @@ const PAGE: u64 = 64 << 10;
|
||||
|
||||
/// `CopyPageMappingsBatchX(count, batches, pool, pool pages, flags)`: maps
|
||||
/// pages of a pool (memory the title mapped physical pages into) at the
|
||||
/// batches' addresses. Grand Theft Auto VI streams textures into pool pages
|
||||
/// batches' addresses. The title streams textures into pool pages
|
||||
/// and maps them into its tiled heap this way (title+0xf2c470, ranges of
|
||||
/// one constant page or of unmapped pages). Done at once: every earlier
|
||||
/// submission has run.
|
||||
@@ -978,7 +978,7 @@ const METHODS: [(usize, *const ()); 15] = [
|
||||
/// Newer titles' queues have two more methods before Signal, which moved
|
||||
/// from 0x70 to 0x80: every slot from 0x70 on is two later (taken here as
|
||||
/// starting exactly at 0x70, the methods before it kept in place).
|
||||
/// Inferred from Grand Theft Auto VI's calls: Signal 0x80 `(fence,
|
||||
/// Inferred from the title's calls: Signal 0x80 `(fence,
|
||||
/// value)`, timestamp frequency 0x90 (title+0x24841a6), suspend and resume
|
||||
/// 0xb8/0xc0, PresentX 0x100, the frame-token submission 0x118 `(count,
|
||||
/// lists, token, flags)` (title+0x24821dd).
|
||||
@@ -1046,7 +1046,7 @@ mod tests {
|
||||
assert_eq!(slot::<extern "system" fn(This) -> u32>(q, 0x10)(q), 0);
|
||||
}
|
||||
|
||||
/// Grand Theft Auto VI's compute queue: `{COMPUTE, 0, pipe 1, queue 0}`.
|
||||
/// The title's compute queue: `{COMPUTE, 0, pipe 1, queue 0}`.
|
||||
#[test]
|
||||
fn console_queues_are_created_as_on_pc() {
|
||||
let null = std::ptr::null();
|
||||
|
||||
@@ -178,8 +178,8 @@ fn footprint(desc: &ResourceDesc) -> Option<AllocationInfo> {
|
||||
&& let Some(t) = texture_layout(desc)
|
||||
{
|
||||
// As the console: the layout's own alignment unless more is asked
|
||||
// (4 KiB for 4 KiB modes, where PC says 64 KiB). Grand Theft Auto
|
||||
// VI keeps these sizes in its texture tables, and its streaming
|
||||
// (4 KiB for 4 KiB modes, where PC says 64 KiB).
|
||||
// The title keeps these sizes in its texture tables, and its streaming
|
||||
// asserts when they disagree with the streamed layout.
|
||||
let alignment = desc.alignment.max(t.alignment);
|
||||
if !alignment.is_power_of_two() {
|
||||
@@ -239,8 +239,8 @@ pub(crate) fn pc_format(format: u32) -> u32 {
|
||||
|
||||
/// The format of a texture the host GPU renders to or writes as unordered
|
||||
/// access, for the title's `format`. The console's GPU does both with the
|
||||
/// 16-bit colour formats B5G5R5A1 (86) and B4G4R4A4 (115), and Grand Theft
|
||||
/// Auto VI has full-screen targets in both; a host that refuses either use
|
||||
/// 16-bit colour formats B5G5R5A1 (86) and B4G4R4A4 (115), and
|
||||
/// the title has full-screen targets in both; a host that refuses either use
|
||||
/// (NVIDIA) refused the whole texture, so every pass that wrote it drew
|
||||
/// nothing. There 8-bit RGBA stands in: the same channels in the same
|
||||
/// order, every 4-bit level exact and every 5-bit level within 1/510.
|
||||
@@ -327,8 +327,8 @@ pub(crate) fn depth_and_unordered(this: This) -> bool {
|
||||
/// when a side is used after the other was written
|
||||
/// (`HostList::twin_use`).
|
||||
/// shortcut: whole textures are copied, not the mips and slices written.
|
||||
/// A depth texture with a stencil plane gets a twin for each plane (Grand
|
||||
/// Theft Auto VI's tiled lighting writes each pixel's material class into
|
||||
/// A depth texture with a stencil plane gets a twin for each plane (
|
||||
/// the title's tiled lighting writes each pixel's material class into
|
||||
/// the depth plane and masks into the stencil plane, then draws each class
|
||||
/// with the depth test "equal"): the stencil plane's is copied through a
|
||||
/// buffer, the depth plane's is drawn into the plane by a pass of ours
|
||||
@@ -921,7 +921,7 @@ static ALLOCATOR: std::sync::OnceLock<(AllocRoutine, FreeRoutine)> = std::sync::
|
||||
|
||||
/// Committed resources get their memory from the title's general
|
||||
/// allocator, as on the console, where titles hook it to place graphics
|
||||
/// memory themselves (Grand Theft Auto VI places its back buffers in a
|
||||
/// memory themselves (the title places its back buffers in a
|
||||
/// block of its own and checks they fill it). The runtime names it before
|
||||
/// the device exists.
|
||||
pub fn use_allocator(alloc: AllocRoutine, free: FreeRoutine) {
|
||||
@@ -1133,7 +1133,7 @@ pub(crate) struct HostTexture {
|
||||
type Made = (std::sync::Arc<HostTexture>, Option<std::sync::Arc<Twin>>);
|
||||
|
||||
/// A title texture's host side. The host copy is made when something first
|
||||
/// uses the texture, not when the title creates it: Grand Theft Auto VI
|
||||
/// uses the texture, not when the title creates it: the title
|
||||
/// had created 3,871 textures (9.2 GB on the host) before its world's first
|
||||
/// frame, of which a frame's lists name some hundreds (run 23), on a card
|
||||
/// with 12 GB. A title texture is memory the title has either way; its host
|
||||
@@ -1189,7 +1189,7 @@ static TARGETS_AT: std::sync::Mutex<std::collections::BTreeMap<u64, usize>> =
|
||||
/// same memory, if there is one of the same size, levels and layers with
|
||||
/// texels of the same width. The console reads such a texture through the
|
||||
/// view as it is
|
||||
/// (Grand Theft Auto VI packs light as R9G9B9E5 into R32_UINT textures
|
||||
/// (the title packs light as R9G9B9E5 into R32_UINT textures
|
||||
/// with compute shaders, which cannot write R9G9B9E5, and samples them
|
||||
/// through R9G9B9E5 views placed at the textures' addresses: the sky, the
|
||||
/// sky and light probes, the bounced light the lighting pass adds). On the
|
||||
@@ -1633,7 +1633,7 @@ fn host_texture(
|
||||
d.alignment = 0;
|
||||
d.flags &= PC_FLAGS;
|
||||
// PC refuses depth targets that are also unordered-access (the console
|
||||
// allows both; Grand Theft Auto VI's shadow maps ask for it).
|
||||
// allows both; the title's shadow maps ask for it).
|
||||
// The host copy loses the unordered access: shaders write a colour
|
||||
// twin instead ([`Twin`]).
|
||||
const DEPTH: u32 = 2;
|
||||
@@ -1895,7 +1895,7 @@ pub(crate) extern "system" fn create_committed(
|
||||
)
|
||||
}
|
||||
|
||||
/// Device method 0x3f8, inferred from Grand Theft Auto VI's calls
|
||||
/// Device method 0x3f8, inferred from the title's calls
|
||||
/// (title+0x193e1b4: its back buffers, heap flag "allow display"): the
|
||||
/// committed resource creation of the enhanced-barrier interfaces,
|
||||
/// `(heap, heap flags, desc1, initial layout, clear value, protected
|
||||
@@ -1958,7 +1958,7 @@ pub(crate) extern "system" fn unregister_page_pool(_: This, handle: usize) -> HR
|
||||
}
|
||||
|
||||
/// Device method 0x428, one of the `ID3D12Device9` to `ID3D12Device11`
|
||||
/// additions. From Grand Theft Auto VI's call: a resource at a virtual
|
||||
/// additions. From the title's call: a resource at a virtual
|
||||
/// address the title mapped itself, `(address, desc1, initial barrier
|
||||
/// layout, clear value, iid, out)`, as `CreatePlacedResourceX` with
|
||||
/// enhanced barriers. GPU addresses are CPU addresses, so the resource is
|
||||
@@ -2008,7 +2008,7 @@ pub(crate) extern "system" fn create_at_address(
|
||||
}
|
||||
|
||||
/// Textures the title placed in its own memory and views without a
|
||||
/// resource object (device 0x230, Grand Theft Auto VI's streamed and
|
||||
/// resource object (device 0x230, the title's streamed and
|
||||
/// interface textures), by address and description: a resource at that
|
||||
/// address, made the first time a draw reads one.
|
||||
/// The resource is kept for the run (views and lists name its address);
|
||||
@@ -2346,7 +2346,7 @@ mod tests {
|
||||
slot::<Custom>(device, 0xd0)(&mut p, device, 1, 1);
|
||||
assert_eq!(p.cpu_pages, 1, "default: not CPU-visible");
|
||||
|
||||
// 0x428: a buffer over memory the title owns, as GTA VI asks.
|
||||
// 0x428: a buffer over memory the title owns, as the title asks.
|
||||
type At = extern "system" fn(
|
||||
This,
|
||||
u64,
|
||||
|
||||
@@ -147,7 +147,7 @@ type Deserialize =
|
||||
/// `d3d12_xs!D3D12CreateRootSignatureDeserializer`: our blobs are the
|
||||
/// host's serialization, so the host's deserializer reads them, and its
|
||||
/// object (IUnknown, then the description getter) is laid out as the
|
||||
/// console's. Grand Theft Auto VI's upscaler asks with the PC interface id.
|
||||
/// console's. The title's upscaler asks with the PC interface id.
|
||||
pub extern "system" fn create_deserializer(
|
||||
blob: *const u8,
|
||||
size: usize,
|
||||
|
||||
@@ -2838,8 +2838,8 @@ fn lookup(address: u64, len: u64, any: bool) -> Option<Arc<Shadow>> {
|
||||
entry.shadow.clone()
|
||||
}
|
||||
|
||||
/// Titles also use memory outside any buffer object as GPU memory (Grand
|
||||
/// Theft Auto VI's interface vertices, from its own allocator). Such memory
|
||||
/// Titles also use memory outside any buffer object as GPU memory (
|
||||
/// the title's interface vertices, from its own allocator). Such memory
|
||||
/// gets copies of the aligned windows it touches.
|
||||
/// A window nothing names any more is let go ([`let_go_idle`]).
|
||||
/// shortcut: a window is 4 MiB however little of it is read (the memory
|
||||
|
||||
Reference in new issue
Block a user