# Leonida D3D12 runtime This is Leonida's Direct3D 12 runtime: it builds as `leonida.exe`, takes `LEONIDA_*` settings (older `VICTORY_*` names still work) and is launched by Leonida's `scripts/play-d3d12.ps1` on Windows and `scripts/play-linux.sh` on Linux (with VKD3D-Proton bundled, `docs/linux.md`). It grew from the VIctory runtime: Marvisak/VIctory, through trustno1-coder/VIctory-NVIDIA (merged into Leonida at `bafb0e25b`) and the forks credited below. Like them it is GPL-3.0-or-later (`LICENSE`). Leonida renamed it and adds its own work on top; everything below this section is trustno1-coder/VIctory-NVIDIA's README as it came, with the project name changed where it named the program. ## Where it stands (2026-11-29) On a Ryzen 5 7600X with a GeForce RTX 4060 Ti 16 GB, the Series X profile with a 2560x1440 output and the title's own dynamic resolution between 1080 and 1440 lines (`-Lowest 1080`, the default of `scripts/play-d3d12.ps1`; `LEONIDA_RENDER_SCALE_MIN`, the loader's `hooks.rs`) runs **16 to 18 frames a second** standing at the test save's spot (median frame 57.0 and 59.6 ms in two series, against 66.0 and 67.9 held at 1440 with `-Resolution 1440`); the title's choice sits at its 1080 floor there. The card is busy about 92% of the frame and the submit thread about 56 ms: both limit it. A steady 30 rendered frames a second is not reached yet. On RTX 40 and 50 cards, DLSS frame generation is on by default when NVIDIA's files are there (`Get-NVIDIA-DLSS.cmd`): it shows twice the frames, held to 28 a second by Reflex (`LEONIDA_FG_LIMIT_FPS`) with presents paced evenly (`LEONIDA_PRESENT_SMOOTH`); `-NoFrameGen` turns it off. The measurements and what is still wrong in the picture are in the [top-level README](../README.md#where-it-stands). ## Leonida's picture fixes | What it fixes | Setting (default) | Where | Credit | | --- | --- | --- | --- | | A 540p picture | DLSS, the default of `scripts/play-d3d12.ps1` since the renderer merged at `00698e1e8`: the title renders its own 1280x720 on Series S and DLSS takes it to 1920x1080 in place of the title's upscaler (`d3d12/Get-NVIDIA-DLSS.cmd` fetches NVIDIA's files once). Before that: `-Resolution native`, the title's own upscaler at 1:1 | `scripts/play-nvidia.ps1`, `crates/leonida-gpu/src/dlss.rs` | DLSS: avatarmanz/VIctory-7900XTX pull request 203 through trustno1-coder/VIctory-NVIDIA `6395727` | | A soft world | `LEONIDA_DLSS_SHARPNESS` (F1 menu, live). `LEONIDA_SHARPEN`, Leonida's own sharpening of the game plane, lived in the compose pass the merged renderer replaced and is gone with it | `crates/leonida-gpu/src/dlss.rs` | trustno1-coder/VIctory-NVIDIA `6395727` | | Black skin, faces and clothes | `LEONIDA_PAGE_WRITES` (bits 1, 2 and 8): textures picked by index that were uploaded before DirectStorage or a plain read filled them are uploaded again | `crates/leonida-gpu/src/watch.rs` | fxceless/victory-fork `e4245f3` | | Skin that turns black later and stays so | `LEONIDA_HEAP_RECHECK_EVERY` (300 frames; 0 off): uploaded textures picked by index are looked at again on a slow beat after the first five looks | `crates/leonida-gpu/src/draw.rs` | fxceless/victory-fork, after RyanCase94 `920423a9` | | Black pixels where a NaN or infinity was scrubbed | `v_mac_legacy_f32` / `v_mad_legacy_f32` fused with flushed sources, as RDNA 2 runs them: a subnormal factor is a zero, so subnormal times infinity is no longer infinity (test `mad_legacy_takes_a_subnormal_factor_as_a_zero`) | `crates/leonida-shader/src/emit/lower.rs` | fxceless/victory-fork `f6a09d3` | | White glitter on floors, glowing windows and eyes (an oily white sheen on wooden floors indoors) | `LEONIDA_REFLECT_MOST` (0.5 in `scripts/play-nvidia.ps1` since 2026-11-28; off unless set from the renderer merge at `00698e1e8` until then, and it did not run at all on that renderer, which dispatches `CS_UpdateHistory` indirectly: the guard follows indirect dispatches too now. In Jason's house, on and off by turns in one run, the floors are wood and the eyes plain with it, and outdoors nothing changes. It is not what posterizes some runs: those come out so with it off too): after `CS_UpdateHistory`, reflections are capped at a multiple of the room's light and colours far from grey pulled towards it; without rays they hold the sky of every miss | `crates/leonida-gpu/src/ambient.rs` | Leonida's own pass; the program and its view from lepotane/VIctory-leonida | | Interiors nearly black (Jason's house, rooms lit by bounced light) | Always, 2026-11-28: the resolve of the title's diffuse light binds its depth's stencil plane where the stand-in looked for the depth, so the stand-in for the indirect light had not run since 2026-11-27 (the log said "missing depth SRV"); the depth plane of the same texture the dispatch reads elsewhere is taken now. `LEONIDA_AMBIENT_FLOOR=` (off) also holds the estimate at least at a warm fill | `crates/leonida-gpu/src/draw.rs`, `crates/leonida-gpu/src/ambient.rs` | TaynanGT's `292adb5a8` in Fayberr/Victory-United; the floor from DoubleGhosty/cool_fox `98c3333` | | White specks all over rooms (the dust in the air) | `LEONIDA_AMBIENT_ALPHA` (4 in `scripts/play-nvidia.ps1` since 2026-11-28; unset or 0 off): the title lights glass, particles and the air's dust from a volume its own rays fill (`CS_GatherAlphaVBuffer` ... `CS_SpatialFilterAlpha`); with every ray missing it holds the open sky everywhere. Right after `CS_SpatialFilterAlpha` it is bounded by 4 times the light around, by the pass that bounds the air's light. Inside Jason's house, on and off by turns in one view: specks without, none with; outdoors the same either way | `crates/leonida-gpu/src/ambient.rs`, `crates/leonida-gpu/src/draw.rs` | KyleS98/VIctory-Neo `a6e85c6` | | Ghosting and blocky smears when the camera turns | The title's motion blur is left out unless `-MotionBlur` (`scripts/play-nvidia.ps1` adds its first pass, the downsample `CS_MotionBlurDownSample*`, four variants, to `LEONIDA_SKIP_PIPELINES`). It blurs by one frame's movement, so at 12-14 frames a second its smears are twice as long as at 30, and its tiles show as blocks of an older picture. Camera turns recorded at the waterside save: with it, smears at the end of every turn and blocky streaks on trees; without it, none and no stale blocks. Leaving out a later pass pastes stale tiles instead | `scripts/play-nvidia.ps1` | voidopcode/vilocity `a0aa988` | | Objects fading between levels of detail drawn twice (a likely cause of plants that flicker) | `LEONIDA_SAMPLE_MASK` (on; 0 ignores it as before): the title fades between an object's levels of detail with `OMSetSampleMaskX` (command list slot 142), the two levels drawn with complementary 2x2 masks; the slot was ignored, so both drew every pixel. Draws under a mask that leaves pixels out take a masked twin of their pipeline, whose pixel program discards at entry the pixels whose quad bit is clear (`USER_PIXEL_MASK`, a root constant) and loses early depth; the twin is made on first use. Unlike the fork, the masked program reads the position from the row the vertex or mesh stage writes it in (the fork's layout was refused by the RTX 4060 Ti). Two starts at the waterside save: masked pipelines made and used, no more refused pipelines than without it, nothing broken in the picture; that it ends the flicker is not confirmed yet | `crates/leonida-gpu/src/list.rs`, `draw.rs`, `pipeline/*.rs`, `crates/leonida-shader/src/emit/*.rs` | trustno1-coder/VIctory-NVIDIA `0938dd9` | | The interface ghosting and smearing in generated frames | `LEONIDA_FG_HUDLESS` (on while frame generation makes frames; 0 off): on Series X the title presents one plane with its interface drawn into it. Right before the title's draw that lays the interface on (one triangle of its interface composite pipeline), the plane is copied into one of two textures of ours, and the present after that list's submission tags the copy as the picture without the interface (Streamline `kBufferTypeHUDLessColor`), so frame generation keeps the interface out of what it moves. Costs one copy of the presented picture a frame and two textures of its size (about 30 MB at 2560x1440); nothing while frame generation is off. In the running title (2026-11-29, standing, 2x): 299 copies and 300 presents tagged in 300, none missing or overwritten (the log's "the picture without the interface" lines) | `crates/leonida-gpu/src/fg.rs`, `draw.rs`, `host.rs` | trustno1-coder/VIctory-NVIDIA `1d0fa87` | | A generated frame of garbage now and then | Always (frame generation on the G-buffer pass's depth and motion vectors): the title also fills a 960x960 pass that looks like its G-buffer (four or more targets, motion vectors among them, a depth of their size: a probe's), and whichever pass was recorded last was tagged, recorded at once on the thin threads before the present of the frame before was served (four switches in four seconds standing, 2026-11-29). Each list now carries the pass it bound to its submission, and a present tags the largest one submitted before it; a frame whose only such pass is under half the last one's area keeps the last | `crates/leonida-gpu/src/fg.rs`, `host.rs`, `draw.rs` | Leonida | | Garbage from compute programs that write past their shared memory | `LEONIDA_LDS_BOUNDS` (on; 0 off): a console program's LDS accesses are bounded by its own allocation, as on the console (a read past it gives 0, a write or atomic is dropped), so none reaches the words the translator keeps after it (the halves' counter, the exchange, the ticket) or a packed neighbour's slice; before, no access was bounded | `crates/leonida-shader/src/emit/lower.rs` (test `lds_accesses_past_the_allocation_are_dropped_and_read_zero`) | D33T0X/Native-Runtime `733b7cc`, `745db9a` (its `xlate`, GPL-3.0-or-later), whose runs had a program clearing 4,096 bytes of its 3,300 write into the exchange | | BC7 textures streamed through DirectStorage with their texels shifted, most of every stream | Always (`leonida-formats` `bcpack.rs`): the BC7 dictionary's entries are read as Microsoft's decoder reads them, all 32 index slots in order (the word that repeats an entry's widths is pixel 0's index); read with that word skipped, 2,101,646 of 2,866,176 blocks of 381 of the title's streams came out unlike that decoder's output, a wrong entry carrying on through every block predicted from it, and none now. Checked on this PC against the GDK's `BCPack.dll` with streams `LEONIDA_BCPACK_DUMP=` saves (they stay on the PC); BC1, BC3, BC5 and BC6 were alike already | `crates/leonida-formats/src/bcpack.rs` | trustno1-coder/VIctory-NVIDIA f9de61c5 | | Torn or flashing triangles where a refresh sends title memory's older bytes over what shaders wrote through views they pick from the heap (skinning) | `LEONIDA_PICKED_WRITES` (now 1; 0 off, 2 lands them too): the buffers found written that way are declared, so no refresh goes over them while a flight may write them. Free here in turns of 4 s standing (frame median -0.02 +-0.75 ms, card +0.06 +-0.45); it found 60 of 575 buffers so written | `crates/leonida-gpu/src/picked.rs` | aki-gta6/aki-runtime 975f161 (turned on there) | | Blocks of noise in a texture streamed into pages that held another's bytes, kept up to 30 frames after its own texels landed | `LEONIDA_PARTIAL_WRITTEN` (on; 0 off): a partly mapped texture is read again the frame after the guards see a write to it (every 30th frame otherwise). Free in turns of 4 s moving (frame median -0.45 +-1.58 ms, card -0.47 +-0.44) | `crates/leonida-gpu/src/texture.rs` | trustno1-coder/VIctory-NVIDIA dbba4ad7 (101Leafy) | | A texture the title paints through another view of its pages shown as it was up to 40 frames before | `LEONIDA_PAINTED_EVERY` (8 frames; 0 off): one a look found changed with nothing told of it is looked at on that beat for good, at its memory under any slot | `crates/leonida-gpu/src/draw.rs` | trustno1-coder/VIctory-NVIDIA cbf5d68d, 76db3ec3 (Chris James) | | A face in noise or black for a whole scene (a list recorded on another thread a moment before the decoration bake's copy into a make-up or stubble texture, and submitted after it, uploaded that texture from title memory over the copy) | `LEONIDA_UPLOAD_GUARD` (on; 0 off): a list's prelude leaves out its upload of a title texture from title memory when another list wrote that texture on the host GPU and was submitted before it; each such upload is warned of (`UPLOAD OVER HOST WRITE`, the first eight, then at powers of two). Not measured here; the fork saw the face broken "about one launch in three" before | `crates/leonida-gpu/src/texture.rs`, `crates/leonida-gpu/src/list.rs` | trustno1-coder/VIctory-NVIDIA e530c003 (aventureroestelar-source), with the check where 3f6ba011 (Ahyildiz) makes its own | | Cutscene faces with only their eyes and teeth (since `LEONIDA_LDS_BOUNDS`) | `LEONIDA_LDS_BOUNDS_EXEMPT` (unset: the face programs; `0` none): the face network's operations and the two programs that rebuild a face's normals from its blend shapes use group-shared memory past their header's size, so these 25 programs keep their LDS accesses unbounded; only they are translated again. Six of them run in the waterside tour | `crates/leonida-gpu/src/shader_cache.rs`, `crates/leonida-shader/src/emit/{mod,lower}.rs` | trustno1-coder/VIctory-NVIDIA 9eb44fa6 (Victorywillbeours222) | | Mesh programs whose loops lost their triangles on NVIDIA | `LEONIDA_MESH_LOOP_EXITS` (on; 0 off): a mesh loop closed by a plain jump stops at the iteration limit through its own exit, not a `ret` (one, even never taken, lost the group's shared memory and triangles on NVIDIA, where WARP drew them); and the half a 16-bit write keeps of a register with no value is zeros | `crates/leonida-shader/src/emit/lower.rs` (tests `a_mesh_loop_closed_by_a_jump_stops_at_its_own_exit`, `a_half_written_over_the_primitive_id_keeps_zeros`) | trustno1-coder/VIctory-NVIDIA 6bbb6bca | | Faces in blocks of colour, clothes in another texture's colours (the title streams a texture's small levels in by a copy on the GPU, then samples them through a view it places over that memory, whose host copy is made from title memory the copy never reached: the log's "HERO LEAD") | `LEONIDA_COPY_BACK` (on; 0 off): every copy and resolve into a texture the title fills goes back into title memory once its list has run, only the subresources it wrote and of them only the 4 KiB pages that change; such a write survives the title releasing the texture or making a view there, and only a change of mapping stops it | `crates/leonida-gpu/src/texback.rs`, `list.rs`, `host.rs` | voidopcode/vilocity ee93826 (clothes broken in three runs of the opening without it, none with) | | The decal heap never relocated (its relocation program dropped every frame), and white blotches once its blocks move | The paired form takes a group of several console waves that meet only at barriers each passes once (`emit::barriers_on_every_way`), with the LDS operations the relocations use (`ds_read2st64`/`ds_write2st64`, atomics with the old value back, `ds_cmpst_rtn_b32`); and a program named in `LEONIDA_PAIRED_FOR` takes the paired form before its own translation. The launcher names `CS_DefragHeap_ComputeRelocations` and the five programs that move the heap's blocks, which copy overlapping 1 KB blocks and in 32-lane halves stored over what the other half had not read yet. In the waterside tour (run d47) the relocations and the mover in use run, nothing else refused but two particle programs, no removed device | `crates/leonida-shader/src/emit/{mod,paired}.rs` (tests `a_barrier_every_way_passes_lets_several_waves_pair`, `the_lds_operations_the_paired_form_takes`), `scripts/play-nvidia.ps1` | voidopcode/vilocity add4873 | | Draws of programs kept unpacked in their container dropped (three of the title's text programs) | Always: a container's raw FSSM record (XDAT kind 0x0c) is read beside the zlib-packed one (0x0d); before, such a container had no program and its draws were dropped | `crates/leonida-shader/src/native.rs` | fuzeofficial (Marvisak/VIctory#3116 ef15cada), through Androtim/MiniVI 96e788c7 and trustno1-coder/VIctory-NVIDIA 87d73cb2 | | Rain particles never updated on NVIDIA (the pipeline of `weatherParticle:CS_BeginUpdate` refused) | Always: an atomic subtract on group-shared memory (`ds_sub_u32`, or an add of `0 - x`) is a compare-exchange loop, as NVIDIA's compiler stopped at an assertion on it (driver 621.40, "not enough memory resources"); the same old value back and the same dword after (tests `lds_subtracts_return_the_old_value_and_subtract`, `lds_subtracts_are_atomic_across_waves`, on the card and on WARP) | `crates/leonida-shader/src/emit/lower.rs`, `emit/paired.rs` | voidopcode/vilocity 5c8149f | | The near ground black with white specks on dirt and sand edges up close | Always: an indirect mesh dispatch record runs its X with Y and Z of 1, as the console reads it (X alone); the terrain's tessellation writes (X, 0, 0), which D3D12 drops, so the ground was in depth but missing from the G-buffer. Unfilled slots (X past 65,535) still run empty (tests `warp_window_leaves_unfilled_slots_empty_and_uncharged`, `warp_batch_clamps_as_the_clamp_of_one_does`, on WARP) | `crates/leonida-gpu/src/indirect.rs`, `indirect/batch.rs`, `indirect/bench.rs` | VIctory-NVIDIA 216bca9 (invismann), through voidopcode/vilocity 41bccf0 | | Particles from a character's body missing on NVIDIA | Always: the model emitters `CS_Emit_Dynamic_Model_Skinned`, `_AttachMesh` and `CS_Emit_Dynamic_Model` (ae0deeafe219c15c, 407eca669212d400, 18d957e62926ed3e) take the paired form (named in the launcher's `LEONIDA_PAIRED_FOR`): alone none of them translates for 32-lane host waves (LDS read and written in one lane branch of a 64-thread group), paired all three do | `scripts/play-nvidia.ps1` | voidopcode/vilocity 324fe01, 4244b51 | | A black disc where the sun is, toward water | Always, with `LEONIDA_NAN_SCRUB=1` (the launcher sets it): the floats an image store writes keep an infinity, as on the console, and only NaN becomes 0 there (`LEONIDA_NAN_SCRUB_STORE_INF=0`: held at 65504 with its sign, as before). The water's plain transmission volumetrics (6871d6e4b3ac9a10, a10179ab7eda0dc3) store an infinity for "no surface along this ray"; held at 65504 it was a surface 65 km off, and toward the sun the light crossed that much volume and none was left. The colours a pixel program writes are held as before (test `the_nan_scrub_keeps_the_integer_bits_an_image_store_writes`) | `crates/leonida-shader/src/emit/lower.rs` | voidopcode/vilocity 767369a | | Wrong values out of float-to-integer conversions past their range (a negative level of a depth pyramid in the culling programs), and branches on a stale SCC after shift-adds | `LEONIDA_CVT_SATURATE` (on; 0 off): `v_cvt_{i32,u32,flr_i32,rpi_i32}_f32` clamp their operand before the conversion, NaN to 0 and past the range to its top (+inf and 2^31 give 0x7fffffff), as RDNA 2 does, since in DXIL a conversion out of range is undefined; `LEONIDA_LSHL_ADD_SCC` (on; 0 off): `s_lshl{1..4}_add_u32` set SCC to the carry of the 64-bit sum (tests `float_to_integer_conversions_saturate`, `scalar_shift_adds_set_scc_to_their_carry`, on the card and on WARP) | `crates/leonida-shader/src/emit/lower.rs` | ReTerryDavis/ReVIctory a892756, 9c99926, through voidopcode/vilocity eaa934e | | Infinity where a division's fix-up should give zero (0/y or x/inf with a NaN quotient) | `LEONIDA_DIV_FIXUP_ZERO_FIRST` (on; 0 off): `v_div_fixup_f32` resolves the zero cases before a NaN quotient's infinity, as the ISA orders them (test `division_fixup_puts_zeros_before_a_nan_quotient`) | `crates/leonida-shader/src/emit/lower.rs` | DoubleGhosty/cool_fox 2b2b00fa and trustno1-coder/VIctory-NVIDIA feb90ade, through voidopcode/vilocity 83bcc2a | | BC7 blocks of modes other than 4 and 5 with two channels' precisions swapped and the p-bit lost, where their control word has bits 4:3 set | Always (`leonida-formats` `bcpack.rs`): only modes 4 and 5 have a rotation field (test `bc7_rotation_is_only_of_modes_4_and_5`) | `crates/leonida-formats/src/bcpack.rs` | fxceless/victory-fork 06702fe8, through voidopcode/vilocity 4365d81 | | Stale constants read through a slot the title emptied (a constant buffer view made with no description left the view there before live) | Always: such a view is a null view, as in D3D12, and a draw's table makes that slot null (test `a_null_constant_view_replaces_the_view_there_before`) | `crates/leonida-gpu/src/descriptor.rs`, `draw.rs` | makmatvey (Marvisak/VIctory#2449), through trustno1-coder/VIctory-NVIDIA 8d2d77c4 and voidopcode/vilocity 12cf6fb | | Guards, clean blocks and views of freed 32-bit title memory taken for true of the next memory at its address | Always: `XMemFreeDefault`'s 32-bit path tells the GPU side before it releases the reservation, as the title's own `VirtualFree` does | `crates/leonida-hle/src/modules/xmem.rs` | ZigZagBoi1/ScarlettPort 745d6f3, through voidopcode/vilocity ed024d5 | | A pad's press waiting up to 8 ms for its reading | `LEONIDA_PAD_QUICK` (on; 0 off): the input thread looks every millisecond at XInput's packet numbers of the pads it has and at the Sony readers' count of new readings, and polls at once when one moved; keyboard and mouse stay at every 8 ms (gameinput module tests) | `crates/leonida-hle/src/modules/gameinput.rs`, `gameinput/hid.rs` | voidopcode/vilocity 3eda937 | | The world slower than the wall clock under 15 frames a second (the title's game step stops at 1/15 s a frame) | `LEONIDA_SIM_MAX_STEP_MS=100`, `125`, `200` or `250` (unset: the title's own): the two loads of the step's ceiling (+0x2226045, +0x2226833 in 1.0.2.1) read another constant of the image that holds the value asked for; all places checked first (test `the_game_step_loads_point_at_the_ceiling_asked_for`, the retail executable's check) | `crates/leonida-loader/src/hooks.rs` | kylepelham/El1xr 9372c47f (game time 0.97-0.98 of the wall clock there, 0.89-0.92 without) | | With the 60 fps patch the scripts told 60 frames a second, from which the title halves a count it hands them | Always with the 60 fps patch: the function that tells the scripts the frame rate answers 59 (test `the_scripts_are_told_fifty_nine`) | `crates/leonida-loader/src/vipatch.rs` | trustno1-coder/VIctory-NVIDIA PR #65 and kylepelham/El1xr `sim_target.rs` | | Textures wait for room that render targets never use | `LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS` (0, off: the reserve of `LEONIDA_CARD_ROOM_FOR_TARGETS_MB` is kept for the run, as before; 20000 is the value measured upstream): once the world's render targets hold half of the reserve and have not grown by 64 MiB for that many ms, nothing is kept for targets any more, and the texture queue gets the rest back; 64 MiB of growth brings the reserve back. Where the targets level off at 2.1-2.9 GB, 160-990 MB stayed reserved for targets that never came while thousands of textures waited (test `room_for_targets_is_given_up_once_they_settle`; upstream's 5-second log line of the room test is not part of this change) | `crates/leonida-gpu/src/resource.rs` | readmet3xt-lab, trustno1-coder/VIctory-NVIDIA `21b040da` | | No trainer menu | `LEONIDA_MENU` (on; 0 off): F4 (or RB + d-pad Left) opens an in-game menu beside the F1 settings and the F3 panel; arrows or numpad 8/2/4/6 move, Enter or 5 selects, Backspace or 0 goes back; `LEONIDA_MENU_OPEN=1` starts it open. DLSS sharpness, the frame-rate cap and the FPS panel (the renderer's own settings, shared with the F1 menu), screenshots, frame recording and the title's clock rate work; script features (god mode, vehicles, weather, ...) wait for the title's natives. Built and unit-tested, not yet tried in the running title (`docs/mod-menu.md`) | `crates/leonida-menu`, `crates/leonida-gpu/src/host/trainer.rs` | Leonida's own; the classic single-player trainer layout, no code or art from one | | No Lua mods | `LEONIDA_LUA` (on; 0 off, no thread): Lua 5.4 mods in `mods\\` (`mod.json` with `"script": "main.lua"`, `LEONIDA_MODS` names the folder) run in a sandbox on a thread of their own, with the `leonida` API (version 1): frame, key and menu events, an overlay, the live settings (frame cap, DLSS sharpness, panel), pages in the F4 menu under Mods (and Reload Lua mods), keys held for the title, and checked reads, writes and pattern scans of the title's memory; a failing mod is switched off alone. `mods\example_lua` ships disabled. Not the title's own script functions (god mode, vehicles, weather: none can be called). Built and unit-tested, not yet tried in the running title (`docs/lua-modding.md`) | `crates/leonida-lua`, `crates/leonida-menu/src/{overlay,mods}.rs`, `crates/leonida-gpu/src/host/trainer.rs` | Leonida's own; Lua 5.4 through the `mlua` crate (MIT) | | No frame generation on RTX 20 and 30 cards (DLSS's runs on RTX 40 and 50 only) | `LEONIDA_FSR_FRAMEGEN=1` (off; `-FsrFrameGen`, or FSR 3 FRAME GEN in the F1 menu from the next start, off and on again while it runs) with AMD's signed `amd_fidelityfx_loader_dx12.dll` and `amd_fidelityfx_framegeneration_dx12.dll` in `amd-sdk\FidelityFX\bin` (`LEONIDA_FIDELITYFX_DIR`): the swap chain is FidelityFX's frame interpolation swap chain, given the depth and motion vectors DLSS frame generation is given, and one frame is generated between each two rendered; on Series S the base plane is the colour without the interface. Never with DLSS frame generation or ray tracing | `crates/leonida-gpu/src/fsr.rs`, `crates/leonida-gpu/src/fg.rs`, `scripts/play-nvidia.ps1` | trustno1-coder/VIctory-NVIDIA `29d8dbf` (`crates/victory-gpu/src/streamline/fsr.rs`, GPL-3.0) | ## Shaders and pipelines are made before the title starts `scripts/play-d3d12.ps1` (through `d3d12/scripts/play-nvidia.ps1`) precompiles before it starts the title, as Hookshot's release builds do; `-NoPrecompile` skips it. `-PrecompileAll` makes every pipeline the title has created in earlier runs, not only those drawn with; those never drawn with go into the driver's cache only, not the pipeline library. 1. `leonida shaders ` translates every shader into the cache with the settings of this start. That takes minutes the first time and after a change of the translator or of a setting a translation depends on (`crates/leonida-gpu/src/shader_cache.rs` lists them); later starts find every shader there. 2. `leonida warm --used` makes the host pipelines earlier runs drew with, in processes of their own, so that the driver's cache on disk has them (`crates/leonida-gpu/src/pipeline/known.rs`). Runs write the title's pipelines down for it (`LEONIDA_PIPELINE_BOOK=1`, set by the launcher), so the first session in a place still makes that place's pipelines as it meets them; from the next start on they are made ahead. --- > **Before you play** > > - **You must install DLSS yourself:** run `Get-NVIDIA-DLSS.cmd` once (it is > in this folder; a double click does it), or have your AI assistant run it > for you. It downloads NVIDIA's DLSS and frame generation files, about 70 MB, > from NVIDIA's own GitHub; they are not part of this repository. Without > them there is no DLSS and no frame generation, and the picture is only > stretched to the screen. > - **F1 in the game brings up the settings menu** (arrow keys pick and > change, Enter does it). F3 shows the numbers panel. > > The steps are under [How to run it](#how-to-run-it). ## From trustno1-coder/VIctory-NVIDIA's README: built from many projects This repository did not come from one place. Over several weeks we built, ran and measured the work of many projects on the same NVIDIA machine, kept what worked on this card, and brought the best of each together here. No single one of them runs this well on NVIDIA by itself; the combination is what gets it to where it is now. Code that is in this repository: - [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX): Its threading, write relay, card fills, copy queue and texture read-back are all kept. - [Marvisak/VIctory](https://github.com/Marvisak/VIctory): the original compatibility layer under everything else (loader, runtime services, Direct3D 12 back end, shader recompiler). - [fxceless/victory-fork](https://github.com/fxceless/victory-fork) (formerly leonida-gta6): the fork the 7900 XTX one grew from, the Series S interface plane (pull request 1189, Tissma95), which fixed the black menus, and the face network fix (pull request 927, tippythetaidum), which made faces move. - leonida-perf, carrying patches from [ZigZagBoi1/ScarlettPort](https://github.com/ZigZagBoi1/ScarlettPort): the title patches for render scale, the title's own upscaler and the watchdog. - Through the 7900 XTX fork: [DexNom/VIctory](https://github.com/DexNom/VIctory), [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD), [FQY55kai/ZJOU-VICTORY](https://github.com/FQY55kai/ZJOU-VICTORY), [myokex/victory-amd](https://github.com/myokex/victory-amd), Geckomacabre and cxy0072019-sketch. Projects we ran, tested or studied along the way, whose lessons shaped the settings and fixes here (none of their code is in this repository unless listed above): - [edsuuu/VI-BR-PORT](https://github.com/edsuuu/VI-BR-PORT): its RTX 4060 Laptop (8 GB) session and switch A/B documentation is ported with source and authorship noted at [`docs/benchmarks-4060-laptop-8gb.md`](docs/benchmarks-4060-laptop-8gb.md). - ProjectLeonida/Leonida (no longer public): the first attempt, where the retail executable's boot was worked through. - Our own builds of Marvisak/VIctory and fxceless/victory-fork, where the ray-walk skip, the half render scale and most of the measurements in the table below came from. - [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD) builds with its fixes combined. - [zm0kiemedia/Neptune_VI](https://github.com/zm0kiemedia/Neptune_VI) (formerly vicecitybaby). - [xcl-dev/xcl](https://github.com/xcl-dev/xcl), another layer for the same title, read for how the title behaves there. Full credits, with what each person contributed, are at the end of this README. ## What this fork changes, and how it gets its frame rate Everything below is what `scripts\play-nvidia.ps1` turns on. Measured on an RTX 5070 12 GB with a Ryzen 7 9800X3D, in the prologue: | Setup | fps | GPU time a frame | |---|---|---| | The 7900 XTX fork's own settings, Series X | high, but thousands of draws a frame skipped (the picture jumps) | - | | With the descriptor fix, Series X, full scale | 6.0 | 110 ms | | The same, half render scale | 7.2 | 82-88 ms | | Series S, half scale, own upscaler, ray walks skipped | 11.0 | 33 ms | | Plus memory compares on the card | 21.8 | about 6 ms | ### Settings that lower the picture a bit 1. **Series S profile** (`--console series-s`). The title believes it runs on the smaller console and picks that console's settings. The biggest change is resolution: the game image is 1920x1080 instead of the Series X's 4K-class target. Menus, the HUD and subtitles are still drawn at 4K on a separate plane, so they stay sharp. 2. **Half render scale** (`LEONIDA_RENDER_SCALE=0.5`). A patch to the title's 1.0.2.1 executable pins its internal render scale: the 3D world is drawn at half width and half height (960x540 on Series S), a quarter of the pixels, then stretched back to 1080p. This is why the world is softer than the menus. Other resolutions: see [Picking a resolution](#picking-a-resolution). 3. **The title's own upscaler** (`LEONIDA_OWN_UPSCALER=1`). On Series S the title upscales with AMD FidelityFX (FSR), whose compute programs cannot be translated here, so that step drew nothing. A patch makes the title use its own temporal upscaler on every profile. It is not a quality setting in itself, but Series S needs it for a scale below 1. 4. **Ray walks end at the root** (`LEONIDA_BVH_MISS=1`). The part of the title that builds its ray-tracing structures is off, so their nodes are stale. Instead of walking stale nodes, every box and triangle test is a miss. That avoids a hang and saves about 10 ms a frame, but light bounced off nearby surfaces is lost, so some dim rooms look darker. ### Settings that make it faster without changing the picture 5. **Memory compares on the card** (`LEONIDA_CARD_BUFFERS_MIN_MB=1`, `LEONIDA_CARD_BUFFERS_MB=1536`). Once the settings above had cut the GPU's work, the CPU was the limit: every frame it compared about 190 MB of title memory to find what the title had changed. These move the compares of copies of 1 MiB or more to the graphics card. Copying back fell from about 27 to 10 ms a frame, and the frame rate doubled (11 to 21.8 fps). 6. **Wait for new shaders** (`LEONIDA_PIPELINE_WAIT_MS=10000`). Draws wait for a pipeline still being made instead of being skipped: nothing is missing, with a short hitch the first time a place is seen. 7. **NVIDIA Smooth Motion** (by default in `play-nvidia.ps1`). The script starts a copy of the build named `leonida_sm.exe`; with Smooth Motion turned on for that exe in the NVIDIA App, the driver inserts a generated frame between real ones, so motion looks about twice as smooth. The title still runs at the real rate underneath, so controls respond at about 20 fps. ### Code changes (what makes it work on NVIDIA at all) 8. **No more skipped draws on NVIDIA** (`LEONIDA_DYNAMIC_SLOTS=524288`, `crates/leonida-gpu/src/descriptor/host.rs`). NVIDIA caps the shader-visible view heap at 1,000,000 views, below the 1,245,184 the title asks for. The pool of dynamic descriptor slots (2^18) then ran out, and 1,100-4,800 descriptor tables a frame were refused, each one a dropped draw: the screen rarely updated and the character jumped from place to place. The pool can now take up to half the heap: 0-33 refused a frame. 9. **Series S interface plane** (`LEONIDA_COMPOSE=1`, `crates/leonida-gpu/src/compose.rs`, `host.rs`, `queue.rs`). A Series S title presents two planes: the game (1080p) and the interface (4K). Only the first was shown, so menus, loading screens and subtitles were black until gameplay. One compute pass now lays the interface over the game before it is shown. Ported from fxceless/victory-gta6 pull request 1189 (Tissma95), without its FSR stand-in (the own upscaler is used instead). 10. **Title patches** (`crates/leonida-loader/src/hooks.rs`, `lib.rs`, `windows.rs`): render scale, own upscaler, and the watchdog's patch (keeps the title's watchdog from ending a slow frame; on unless `LEONIDA_NO_WATCHDOG=0`, as trustno1-coder/VIctory-NVIDIA and KyleS98/VIctory-Neo quiet it by default), taken from the leonida-perf patches. 11. **Ray walks end at the root** (`crates/leonida-shader/src/emit/intersect.rs`, `crates/leonida-gpu/src/shader_cache.rs`): the `LEONIDA_BVH_MISS` switch, made part of the shader cache key so translated shaders with and without it are kept apart. 12. **`scripts/play-nvidia.ps1`**: the launcher with all of this list. 13. **Faces move** (`crates/leonida-shader/src/emit/halves.rs`, `lower.rs`, `crates/leonida-gpu/src/descriptor/host.rs`, `draw.rs`). Faces are driven by a network of compute programs whose numbers travel as 16-bit values through integer views; they were read as floats and came back as zeros on NVIDIA, so no face moved. They now move as integers. Ported from fxceless/victory-fork pull request 927 (tippythetaidum). 14. **Ray tracing mostly off** (`scripts/rt_off_hashes.txt`, used by `play-nvidia.ps1` through `LEONIDA_SKIP_PIPELINES`; `-RayTracing` keeps the passes). The title's ray-tracing structure builder cannot run on NVIDIA (its 64-lane programs are refused; Marvisak/VIctory pull request 2311), so every ray misses. The passes that turn those misses into light made rooms go white and hazy depending on the view angle. The 1,000 `CS_RaytracingResolve` and 34 traced-shadow shaders are skipped. The screen-probe and visibility traces keep running: skipping them too (all 1,052 shaders of fxceless pull request 465's rule) left their outputs as garbage, rainbow glitter everywhere. Needs the `diag` build (the skip list is a diagnostics switch). 15. **The intro video no longer flickers** (`crates/leonida-gpu/src/texture.rs`). The movie's planes (linear, one-level R8 textures in a ring of three) were written by the decoder through another view of the same memory, judged clean when the frame was recorded, and copied a list late: frames from the ring showed out of order. Video planes now always record their copy. ### Settings The default set of `play-nvidia.ps1` is the speed set (about 18-22 fps on the RTX 5070). `-Quality` trades about 7 fps for fewer of the first two faults below. | Fault | Cause | Fix | |---|---|---| | Stretched bodies that jump | The relay's second stage and card steps hand skinned meshes back before they are done (avatarmanz issue 13; fxceless issue 89 on an RTX 5070) | `-Quality`: `VICTORY_RELAY=1`, `VICTORY_CARD_STEPS=0` | | Rainbow, pixelated skin | A texture refresh that does not wait for the runtime's remapping fills its upload from pages not there yet | `-Quality`: `LEONIDA_TEXTURE_NO_WAIT=0` | | Some views far too bright | Without rays the light probes keep the sky's light indoors, and the fog takes it too | Always: `LEONIDA_AMBIENT_AIR=1.5` (fog at most 1.5 times the light around), `LEONIDA_AMBIENT_MOST=2` (new, `ambient.rs`; was a fixed 4) | | The picture stops until you look away | A pipeline that takes longer than the wait was waited for again in every frame it was in view | Always: each pipeline is waited for once at most (`VICTORY_PIPELINE_WAIT_ONCE`, on; `pipeline/make.rs`; the problem of fxceless issue 1181) | | Black blobs on faces and in the air | A NaN that a shader writes is spread by blur and the temporal upscaler | Always: `LEONIDA_NAN_SCRUB=1` (new, `emit/lower.rs`): colours and image stores with NaN become 0 (an image store of 32 bits no float instruction made, which may be an integer's, loses only the NaN and infinity bit patterns a card's arithmetic gives; `LEONIDA_NAN_SCRUB=2` scrubs every image store as a float, as 1 did before); an infinity is held at 65504 with its sign instead of made 0, which had turned the brightest pixels black (`LEONIDA_NAN_SCRUB_INF=0`: 0 as before), and an image store keeps it (`LEONIDA_NAN_SCRUB_STORE_INF`, vilocity 767369a); NaN in the fog volume is cleared too | Known faults left: the common room by its sunlit windows still goes beige and hazy (sky light in the fog); smearing when the camera moves fast at half scale (the title's own temporal upscaler); two orange glows on some corridor walls. Render scale 1.0 on Series S runs since the loader gives two of its budgets the other consoles' sizes (below). Also in, off by default: - `VICTORY_CONSTANT_MARKS=1`, a port of fxceless pull request 1216 (GamingRipperDoc): a slot picked from the heap is read as a constant buffer only if it holds one (else a texture's descriptor was read as one, in the meshlet culling passes). - `VICTORY_TARGET_VARIANTS=1`, a port of fxceless a35c557393: a pipeline is made again for the render target formats bound at the draw. - F9 frame capture (`capture.rs`): with `LEONIDA_CAPTURE=` and `LEONIDA_DUMP_TARGETS=1`, F9 saves the next frame's picture, its commands and every 2D target. - `LEONIDA_ADAPTER=` (`host.rs`): the card to run on when there is more than one (`play-nvidia.ps1 -Adapter`). --- A fork of [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX), itself a fork of [VIctory](https://github.com/Marvisak/VIctory), a compatibility layer that runs an Xbox Series title natively on Windows from files the user supplies. That fork is tuned for an AMD RX 7900 XTX. This one makes it **draw everything on NVIDIA cards and run fastest there**, using the Series S profile. **This repository contains no game files, code or assets.** You need your own copy of the game. It is not affiliated with or endorsed by the game's developer or publisher. ## New on 2026-11-27: DLSS and frame generation on Series X, a window of another shape Written without a run of the game (the card was busy): the places changed in the title are checked against the 1.0.2.1 executable by a unit test, the rest by unit tests and the launcher's `-DryRun`. Nothing changes unless one of the parameters below, or its line in the F1 menu, is used. - **Why DLSS was Series S only.** DLSS (and the stretch) stand in for one call, the title's FidelityFX upscale (`ffxDispatch`), and the title only upscales through FidelityFX when its device type is a Series S. On Series X its own temporal upscaler runs instead, as passes of its own that hand nothing over. Frame generation was tied to the same call: its depth and motion vectors are the ones that upscale is given. - **DLSS on Series X**: `-Dlss quality|balanced|performance|ultra` (UPSCALER and RENDER SCALE in the F1 menu). The loader makes the title upscale through FidelityFX there too (`LEONIDA_FSR_UPSCALER=1`), at the mode's render scale (2/3, 0.6, 1/2 or 1/3 of the 2160 lines: 1440, 1296, 1080 or 720), and DLSS makes the 3840x2160 output. DLSS's own mode follows those sizes. - **Frame generation on Series X**: `-FrameGen 2` (FRAME GEN in the menu). It needs the DLSS upscale there, so the launcher turns DLSS on with it (quality unless a mode is given) and says so. The log says `frame generation: the first upscale's numbers` once its inputs arrive, and after 600 presents without any says that too. - **A window of another shape**: `-Aspect 21:9|32:9|W:H|auto` with `-PresentScale fit|stretch` (WINDOW SHAPE and PICTURE IN ANOTHER SHAPE in the menu). The game still draws 16:9: `fit` shows it centred with black bars, `stretch` fills the window. What a real ultrawide picture needs, and the experimental `LEONIDA_OUTPUT`, are in [docs/ultrawide.md](../docs/ultrawide.md). - `-DryRun` prints the settings a start would run with, after the menu's saved ones, and stops. ## New on 2026-11-26: another renderer, DLSS, a settings menu The default of `scripts\play-nvidia.ps1` changed. What is below this section was written on 2026-11-25 for the settings before it, which `-Resolution` still reaches. - **The renderer is CGBJ's** ([codec-d/cool_fox](https://github.com/codec-d/cool_fox) `f4b48ad`, GPL-3.0 like this fork), with this fork's NVIDIA fixes on top. - **DLSS does the title's upscale** (from pull request 203 of [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX)): the game renders its own 720p and DLSS takes it to 1080p, in place of the render scale and the title's upscaler. Series S only. - **F1 in the game opens a settings menu** (arrows pick and change, Enter does it): upscaler, DLSS model and sharpness, frame generation, frame rate cap, ray tracing, Smooth Motion, console profile, graphics card, and the speed switches. Lines marked LIVE change at once; the others are saved to `leonida-settings.txt` and apply at the next start, which "SAVE AND RESTART NOW" does for you. F3 shows the numbers panel. The last choice wins, one setting at a time: a switch you type (`-Resolution`, `-SeriesS`, `-Fullscreen` ...) wins over what the menu saved for the same setting, the menu file drops that value, and the menu shows the command line's; every setting you did not type keeps the menu's. "SAVE AND RESTART NOW" keeps the menu's values, since they were chosen after the switches it starts with again. Each start says which values came from the menu and which the command line replaced. - **DLSS frame generation** (NVIDIA Streamline), 2x to 6x, from the menu. The amount changes while playing. Frames are only generated while the game's window has the focus. - **Frame rate cap**: the title asks for 30 frames a second on its own; the loader's frame-rate patch, always on, makes that 60 ([docs/vi_patch.md](../docs/vi_patch.md)), and the menu's FRAME RATE CAP changes it (30, 60, 120 or none). - **Game patches after VI-Patch** ([docs/vi_patch.md](../docs/vi_patch.md)): 60 frames a second always; no vignette by `LEONIDA_VIPATCH_NO_VIGNETTE=1` or the menu. - **Real ray tracing**, off by default: `-RayTracing` or the menu. On this renderer the title's structure builder runs on NVIDIA (53 programs), and the draws dropped for it go from hundreds or thousands a frame to one. Measured on the RTX 5070 below (Series S, DLSS, opening rooms): about 15-17 fps without ray tracing and 13-15 with it, before generated frames. Known to be wrong with it: - **Ray tracing and DLSS frame generation together do not work**: about 0.1 fps and a white picture. Each alone is fine. The launcher and the layer leave frame generation off when ray tracing is on (Smooth Motion can do the extra frames then). The cause is not found. - **Without ray tracing, lit places further into the game blow out to white with black holes** (the bank, outdoors): the lighting runs with every ray missing. With ray tracing on, that has not been checked that far yet. - **With ray tracing, shaders build for minutes** the first time a place is seen (about 1,700 pipelines for the opening alone). - **A posterized "oil paint" look** comes in some runs and not in others. - "SAVE AND RESTART NOW" can leave the old game's process behind without a window; it goes when the PC restarts. ## Where it stands (2026-11-25) Tested on one machine only: Windows 11, AMD Ryzen 7 9800X3D, 64 GB RAM, GeForce RTX 5070 12 GB, the Series S profile at half render scale (`scripts\play-nvidia.ps1`). | | | |---|---| | Prologue, indoors | about 20-22 fps on average, 24-31 fps in lighter places | | Device losses | none in the measured runs | | Menus, loading screens, subtitles | shown (they were black on Series S before) | | First time a place is seen | slow for a moment while its shaders are made | On the same card the fork's own settings skipped thousands of draws a frame (the picture jumped and rarely updated), and the Series X profile at full scale ran at about 6 fps. What is known to be wrong: - The picture is softer than Series X: half render scale, upscaled by the title's own upscaler. - Rooms with little direct light can be dark: ray walks end at the root while the title's structure builder is off (`LEONIDA_BVH_MISS`). - Everything listed in the 7900 XTX fork's README still applies (flicker of far plants outdoors, textures appearing late while the title streams, a stutter on the first run with a new driver or build). ## How to run it You need Windows 10/11 x64, a CPU with AVX2, a Direct3D 12 GPU with shader model 6.6 and mesh shaders, Rust (the toolchain is pinned), the MSVC build tools, and your own dump of the title. ```powershell git clone https://github.com/trustno1-coder/VIctory-NVIDIA cd VIctory-NVIDIA copy leonida.example.toml leonida.toml # then set your paths, outside this folder scripts\play-nvidia.ps1 -Exe ``` The first start builds the layer by itself (`scripts\build-nvidia.ps1`: the `diag` profile with `diagnostics`). **On Windows 10, run `Get-D3D12.cmd` once.** Windows 10's own Direct3D 12 stops at shader model 6.5 and refuses every translated pipeline. `Get-D3D12.cmd` downloads Microsoft's newer runtime (the D3D12 Agility SDK 1.614.1, about 22 MB, from nuget.org, checked against its SHA-256 and Microsoft's signature) into `target\diag\D3D12\`, and `leonida.exe` asks Windows for it (`apps\leonida\src\agility.rs`: it exports `D3D12SDKVersion`, set to the version of the `D3D12Core.dll` there, and `D3D12SDKPath`). Windows 11 needs nothing: where no such folder is there, the exe asks for Windows' own runtime. `scripts\play-nvidia.ps1` stops with this hint on Windows 10 without the folder. **For DLSS and DLSS frame generation, run `Get-NVIDIA-DLSS.cmd` once** (double click it, or `Get-NVIDIA-DLSS.cmd -NoStreamline` for DLSS alone). It downloads the few NVIDIA files they need, about 70 MB, from NVIDIA's own GitHub ([NVIDIA/DLSS](https://github.com/NVIDIA/DLSS), [NVIDIA-RTX/Streamline](https://github.com/NVIDIA-RTX/Streamline)) into `nvidia-sdk\` (git-ignored), and the next start builds the layer again with DLSS in it (about a minute). Those files are NVIDIA's, under NVIDIA's licences, which are saved beside them; this repository does not carry them and may not. A build with DLSS links NVIDIA's loader library: it is for your own use, not for passing on. Without that step the game runs all the same: its 720p picture is stretched to the screen instead of going through DLSS (softer), and there is no DLSS frame generation. Nothing is downloaded unless you run that file. `scripts\play-nvidia.ps1` starts a copy of the build named `leonida_sm.exe`, so NVIDIA Smooth Motion applies every time once it is turned on for that exe in the NVIDIA App. `-NoSmoothMotion` runs `leonida.exe` itself; `-SeriesX` uses the Series X profile (sharper, much slower; DLSS there with `-Dlss`); `-Quality` gives fewer stretched bodies, slower; `-RayTracing` turns the title's real ray tracing on. The fork's own `scripts\play.ps1` is still there for AMD cards. ### Keyboard and mouse The game itself only knows an Xbox controller, so the keyboard and mouse press that controller's buttons for you, laid out as in Grand Theft Auto V on PC. Click in the game's window once to give it the mouse (that click is not a shot); Esc pauses and frees the mouse again. | | on foot | in a vehicle | |---|---|---| | W A S D | move | W accelerate, S brake and reverse, A D steer | | mouse | look around | look around | | left mouse button | shoot | shoot from the vehicle | | right mouse button | aim | (nothing yet) | | Space | jump, climb | handbrake | | Left Shift | run | lean forward on a bike (also Num 8) | | Left Ctrl | crouch | lean back on a bike (also Num 5) | | F | get into a vehicle | get out | | E | interact | horn | | Q | take cover | radio | | R | reload, melee | (the same button) | | X, H | | duck, headlights | | Tab | weapon wheel (hold) | weapon wheel | | C | look behind | look behind | | M | map | map | | Esc or P | pause | pause | | arrow keys | phone (up) and its menus; down, left and right are the HUD, the radio and the partner menu | the same | | Enter, Backspace | accept, back (phone and menus) | the same | | Z | HUD and objective | the same | A key you were holding when you got in or out counts again once you have let it go and pressed it again: W held while climbing in does not drive off by itself, and a held mouse button does not start to fire. The runtime reads from the game whether you are in a vehicle. Where it cannot (another version of the game), the keys stay the on-foot ones and **Caps Lock** is the switch: press it once you sit in a vehicle for the driving keys, and again, or F to get out, for the on-foot keys. Without it a vehicle still drives the old way: left mouse button accelerates, right mouse button brakes. Should the runtime get it wrong, `-More @{LEONIDA_PLAYER_VEHICLE_AT='off'}` stops it reading and leaves the switch to Caps Lock. Not bound, because it is not known yet which controller button does it in this game: V (camera), G (grenade), the number keys and the mouse wheel (weapons), aiming from a vehicle. A controller keeps working beside the keyboard at all times. `LEONIDA_KBM=classic` (with `-More @{LEONIDA_KBM='classic'}`) brings back the keys of before; the details, the mouse settings and the other switches are in [docs/gameinput.md](../docs/gameinput.md). ### Picking a resolution There is one script per console and resolution in `scripts\`. Each runs `play-nvidia.ps1` and takes the same `-Exe` path. Fixed presets pass `-Resolution`. The dynamic preset passes `-Lowest`. ```powershell scripts\play-S-720p.ps1 -Exe scripts\play-X-1080p.ps1 -Exe -Quality ``` The resolution is the height the 3D world is drawn at. The title's own upscaler then stretches it to the console's output, and menus, the HUD and subtitles stay sharp either way. Series S outputs 1920x1080. The Series X presets up to 1440p output 2560x1440 by default, and the 2160p preset outputs 3840x2160. The render scale is the world height divided by that preset's output height. | Script | Console | World drawn at | Render scale | Tested on the RTX 5070 | |---|---|---|---|---| | `play-S-1080p.ps1` | Series S | 1920x1080 | 1.0 | not yet; it crashed at start until the loader gave Series S larger budgets (below), and runs since on an RTX 3060 (11-22 fps in the world) | | `play-S-720p.ps1` | Series S | 1280x720 | 0.667 | not yet | | `play-S-540p.ps1` | Series S | 960x540 | 0.5 | yes: the default, about 18-22 fps | | `play-S-480p.ps1` | Series S | 853x480 | 0.444 | not yet | | `play-X-2160p.ps1` | Series X | 3840x2160 | 1.0 | yes, about 6 fps | | `play-X-1440p.ps1` | Series X | 2560x1440 | 1.0 | not yet | | `play-X-1080-1440p.ps1` | Series X | 1920x1080 to 2560x1440, picked by the title's own dynamic resolution (`-Lowest 1080`) | 0.75 to 1.0 | not yet (on an RTX 4060 Ti about 13% shorter frames than 1440p: 57.0 and 59.6 ms against 66.0 and 67.9) | | `play-X-1080p.ps1` | Series X | 1920x1080 | 0.75 | about 7 fps in the Series X baseline | | `play-X-720p.ps1` | Series X | 1280x720 | 0.5 | not yet | | `play-X-540p.ps1` | Series X | 960x540 | 0.375 | not yet | | `play-X-480p.ps1` | Series X | 853x480 | 0.3333 | not yet | What to expect: - **Lower is faster, up to a point.** On this machine the frame time is mostly the CPU preparing the GPU's work (about 33 ms a frame on Series S), not the GPU drawing pixels. Going below 540p saves GPU time, but the frame rate stops rising once the CPU is the limit. - **Series S is much faster than Series X at the same resolution.** The console profile changes far more than resolution: the title picks the smaller console's level of detail, effects and memory budgets. `play-S-540p` and `play-X-540p` draw the same number of pixels, but the Series X one does more work for each frame. - **Lower is softer and smears more.** The title's temporal upscaler rebuilds detail from earlier frames. At low resolutions and low frame rates, fast camera moves (driving, turning quickly) leave visible trails. - **Series S above 720p (render scale above 2/3) needs larger budgets.** The title sizes two of its memory budgets per console, for Series S' own 720p: its render-target pool (1277 MiB, 2199 on the other consoles) and a heap of 64 KiB pages (297 MiB, 710 on the others). At 1080p the first allocation that does not fit stops the title at its own breakpoint as soon as it starts, on a 12 GB card too: it is not video memory. Whenever Series S can render above its own 2/3 by more than a thousandth, so that 2/3 itself (0.6667) keeps the console's budgets (a held scale above it with `-Resolution`, or the title's own dynamic resolution without a held scale, that is its own upscaler as `-Lowest` uses it or a lowest scale from F1, since that one rises up to 1.0 on Series S whatever the lowest), the loader gives both the other consoles' sizes, both or neither (`leonida-loader/src/hooks.rs`, `SERIES_S_LARGER`), and 1080p runs (RTX 3060, 2026-12-01: five minutes into the world, 1920x1080 rendered, 11-22 fps). - Series S cannot go above 1080p: its output is 1080p, and the script says so and stops if asked for more. - **16 GB PCs: turned on for you, best with resizable BAR enabled.** On the tested 16 GB PC with an RTX 3060, shared GPU memory approached its limit about a minute into the world (`0x8007000E`, then a driver fault). The 3072 MiB cap from [PR #6](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/6) let eligible title memory windows use CPU-mapped VRAM while the card had room. The launcher sets it by itself on PCs with under 48 GB of RAM (Windows lets the card share half the RAM), unless the card has under 6 GB, and leaves it off otherwise. It only takes effect where the card has GPU upload heaps (resizable BAR, and a Windows and driver that offer it): without them the runtime logs once that the cap does nothing. Pass a cap in MiB to `play-nvidia.ps1` or any resolution wrapper to choose for yourself: `-WindowsBarMB 0` disables it, and `-More @{LEONIDA_WINDOWS_BAR_MB='...'}` takes precedence. ### More than one card, and other cards On a PC with two cards, `-Adapter` picks one by part of its name or its index (`-Adapter 5060`, `-Adapter '#1'`); it sets `LEONIDA_ADAPTER`, and the log says which card the game is on. Without it the game uses Windows' default card, the one the main display is on. Measured on the same PC (Ryzen 7 9800X3D), same build and settings (`play-S-540p`, the default), one run each in the prison prologue: | Card | Slot it sits in | fps | Preparing a frame (CPU) | On the GPU | |---|---|---|---|---| | RTX 5070 12 GB | PCIe 5.0 x16, drives the display | 19.3 | 34 ms | 4.6 ms | | RTX 5060 Ti 16 GB | PCIe 4.0 x4, no display attached | 14.9 | 50 ms | 5.4 ms | The GPU work itself is close; the gap is in preparing frames, mostly copies of title memory to and from the card. This layer moves tens of MB a frame, so the link to the card matters: the 5060 Ti here has about an eighth of the 5070's bandwidth, and its finished frames are also copied to the 5070 to be shown. In a full-speed slot with the display on it, a 5060 Ti should land closer to the 5070. Neither run lost the device; both refused the same 7 programs. `-Resolution` works on `play-nvidia.ps1` itself too (`-Resolution 720 -SeriesX`), and `-More @{LEONIDA_RENDER_SCALE='0.6'}` still sets any scale from 0.2 to 1.0. Before the first run, ahead of time (both can be stopped and go on later): ```powershell target\diag\leonida.exe shaders # every shader translated, minutes target\diag\leonida.exe warm --used # pipelines earlier runs drew with, for a new driver or build ``` Commands, debugging switches and upstream's own description: [docs/README-fxceless.md](docs/README-fxceless.md). Every `VICTORY_...` switch is described in a comment where it is read. ## What is different here This fork's own changes are listed at the top of this README. Everything the 7900 XTX fork added is kept: translation of list calls on threads of ours, submissions prepared and joined on a thread of ours, the write relay, fills done on the card, textures on their own copy queue, texture read-back (boats float), and frame record and replay. Its [docs/findings.md](docs/findings.md) has the reasons and the measurements. ## Credits This is a tree of other people's work with more on top. The history is kept, and commits taken from elsewhere name the commit and its author. - **[avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX)**: the fork this one started from, and everything in it. - **[VIctory](https://github.com/Marvisak/VIctory)** by Marvisak and its contributors: the loader, the runtime services, the Direct3D 12 back end and the shader recompiler. - **[fxceless/victory-fork](https://github.com/fxceless/victory-fork)**: the fork the 7900 XTX one started from, the people whose pull requests it carries, pull request 1189 (Tissma95) for the Series S interface plane, 927 (tippythetaidum) for the face network and 1216 (GamingRipperDoc) for the marked constant buffer slots. - **[DexNom/VIctory](https://github.com/DexNom/VIctory)**: ray tracing fixes, cube gradients, sparse textures. - **[Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD)**: the ambient light idea, pipeline workers, and work by romainhedouin. - **[FQY55kai/ZJOU-VICTORY](https://github.com/FQY55kai/ZJOU-VICTORY)**. - **[myokex/victory-amd](https://github.com/myokex/victory-amd)**: the guard over every view of a page (with Spexivus, joroyt and tightfall), and Joshua Odom's reads into title memory. - **Geckomacabre** and **cxy0072019-sketch**: the texture read-back. - **[ReZOnGithub/VIctory-lap](https://github.com/ReZOnGithub/VIctory-lap)** (GPL-3.0-or-later): a list's fronts found once at its close and joined lean (0ced255, 91ca3fd, 9ea4cac), a submission's own bytes copied beside its recording (003e55a), and what the submitting thread waits for translated first (ac97e48); the views of tables read in place left as brought up to date while the list's epoch stands (1d52e85, `LEONIDA_ENTRY_ONCE`, on), and, off unless asked for, the per-thread caches of views and placed textures' answers (242d0c6) and a list keeping its dynamic slots' resources once (1641cb6). - **[crossducking/RAZDA4A-XEN](https://github.com/crossducking/RAZDA4A-XEN)** (GPL-3.0): tables made afresh known by what they hold (its wave 15 notes; written anew here, `LEONIDA_CONTENT_TABLES`, off). - **[XCL](https://github.com/xcl-dev/xcl)** (GPL-2.0-only) was read for how the same title behaves under another layer; no code of it is here. - This fork's changes were made with [Claude Code](https://claude.com/claude-code). ## License GPL-3.0-or-later, as VIctory. See [LICENSE](LICENSE); the one file that is not covered is named in [docs/asset-policy.md](docs/asset-policy.md).