# VIctory fork for AMD Radeon (work in progress) This is a fork of [VIctory](https://github.com/Marvisak/VIctory) by Marvisak and its contributors. It follows upstream `main` up to `8e79c80` (2026-11-24), carries a number of upstream pull requests, and adds fixes found while running the game's world on one AMD card. **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. ## State of this fork (2026-11-25) **Not playable yet: 3 to 5 frames per second.** Tested on one machine only: Windows 11, AMD Radeon RX 9070 XT 16 GB, Ryzen 7 9800X3D, 64 GB RAM, Series X profile. Nothing here has been run on an NVIDIA or Intel card. | What | State on that machine | |------|-----------------------| | Boot, menus | work, 30 fps (as upstream) | | The world | renders lit, with textures, people, vehicles, vegetation, water and sky | | Saves | load and store | | Frame rate in the world | 3 to 5 fps (4.4 to 4.9 standing still in a heavy scene, about 3 while driving) | | Light in shadow | a constant: the game's ray-traced indirect light does not run, so shaded places are flat and rather dark | | Distant trees | drawn | | Vehicles in motion | whole (they lost and stretched parts until the copies of title memory saw writes through every view of a page) | | In-game phone | **broken**: with the phone out the world is unlit (black) and the phone is an empty outline | | Memory | about 22 GB of RAM and more video memory than a 16 GB card has | A driver timeout (Windows resets the display driver, every monitor goes black for a moment) happened once in the session this was written in. Expect it. ### What this fork changes over upstream Picture: - The world's indirect diffuse light is replaced by a constant while the ray passes do not run. What the game's resolve pass left instead was bright magenta on leaves, cloth and paper, and blocks of colours indoors (`VICTORY_AMBIENT=`, 0.6 by default; `off` keeps the game's output). - In pixel shaders every read of another pixel of the same 2x2 quad goes through quad reads, helper pixels included. Wave reads return 0 from helper pixels on AMD, which showed as lines along every triangle on car paint, glass and skin. Upstream does this after discards only. - A helper pixel's `v_readfirstlane` reads its own value (upstream `0601955`). - Twice the dynamic descriptor slots, so the tables of heavy frames fit. - Depth and stencil twins for depth textures written by compute, screen passes with pipeline workers of their own, textures told apart by the mips their memory really holds, and other fixes listed in the history. Speed: - The clamps of a run of indirect draws are recorded in a list before the list that draws, and run one after another (`VICTORY_HOIST_CLAMPS`, 7 by default, 0 for each before its draw): 225 to about 80 ms of GPU time per frame in a scene of 9,000 draws. - Shader cache entries of another build can be reused (`VICTORY_SHADER_BUILD_OF=`, diagnostics). Memory the title shows at several addresses: - Every view of a guarded physical page is guarded with it, so a write of the title's through another address is seen (the idea of victory-fork #115 and victory-amd, written anew here); blocks the kernel is about to write stay writable for two seconds. Before this, parts of moving vehicles were left behind; the distant trees' quads that crossed the screen have not come back since either (cause not proven). AMD: - Shaders that crash or never leave the AMD driver's compiler cost only their pipeline, not the run. - Buffer element counts come from the host's own table, not a size query the driver's compiler crashes on. Diagnostics (diagnostics builds): `VICTORY_SHADER_PATCH` changes one word of a shader's machine code before translation, `VICTORY_SHADER_SWAP` replaces shader containers by files, `VICTORY_ALWAYS_COPY=1` refreshes every copy of title memory each frame, `VICTORY_GPU_TIMING=1` logs GPU time per pipeline. Each is described in a comment where it is read. ### How it is run here A diagnostics build (`cargo build --profile diag -p victory --features diagnostics`), with: ``` VICTORY_PRESENT_TARGET=1x1:1 VICTORY_HAIR=1 victory run --execute --console series-x ``` The first launch after a build translates every shader and builds about 2,500 pipelines; the loading screen can stay frozen, with sound, for minutes. ### Known problems - With the in-game phone out the world is unlit (see the table). - The per-draw descriptor slots are few for the heaviest places: when they run out, some draws of a frame are dropped. - Memory: the process commits about 33 GB after a quarter of an hour's drive (the title's own 7 GB, 8 GB of textures on the card, copies of its buffers, and the system's backing of video memory). - No ray-traced light; the constant that stands in for it is the same everywhere. - Some compute programs do not translate (ray-tracing structure builders, wind volumes, a few others) and their passes are dropped. - `crates/victory-shader/src/emit/lower.rs` is larger than the size limit of `cargo xtask policy`; it is source code, not an asset. - Many changes are specific to this title and this GPU, and some are marked `shortcut:` in the code where they approximate what the console does. ### Credits - **[VIctory](https://github.com/Marvisak/VIctory)** by Marvisak and its contributors is the base of everything here. Licensed GPL-3.0-or-later; so is this fork. Upstream's history and the authors of the pull requests carried here are kept in the commit history. - [fxceless/victory-fork](https://github.com/fxceless/victory-fork) and [myokex/victory-amd](https://github.com/myokex/victory-amd) were read for comparison; no code of theirs is in this fork. - [XCL](https://github.com/ivall/xcl) by ivall: its README was read; no code of it is here. - This fork's changes were developed with [Claude Code](https://claude.com/claude-code) and Gemini (Antigravity). Everything below this line is upstream VIctory's own README, unchanged; its status section describes upstream, not this fork. --- # VIctory Runs Grand Theft Auto VI (Xbox Series X|S) natively on Windows, from files the user supplies. The title's x86-64 code runs unchanged inside our process; VIctory supplies the platform underneath it and converts the title's data, ahead of time where it can and on first use where it must (shaders). See [docs/architecture.md](docs/architecture.md). ## Status (2026-11-23) **Not playable yet.** The title boots, runs its menus at its own 30 fps and loads the world, where rendering fails. | Stage | State | |-------|-------| | Boot, first-boot screens (accessibility, language, settings, legal) | works, 30 fps | | Intro video with sound | works | | Start screen, profile and saves | works | | Loading into the world (about 50 s) | works | | The world (first mission's intro) | reached and runs with indirect draws; its title card renders, the scene after it is still dark; 0.5-1.8 s per frame | Tested on one machine: Windows 11, AMD RX 6700 XT. > **Warning.** Entering the world on a real GPU can currently hang it, and > Windows then resets the display driver (every monitor goes black for a > moment). To look further, use a diagnostics build with > `VICTORY_D3D12_WARP=1`, which renders on the software adapter. What each part does today and what it still needs: | Subsystem | Today | Needs | |-----------|-------|-------| | Loader | Runs the title's executable and its DLLs in our process; crash reports name the faulting code and are kept in `crashes.log` | – | | Runtime services | One signed-in offline user, licences, packages, saves that survive a kill at any step, text entry dialog | Speech is silent; the dialog and relaunch are untested live | | Network | Offline by design: the title cannot reach the network | – | | Files and streaming | Archives and streamed data read, zlib and BCPack decoded in parallel | Loading is limited by writes into title memory | | Input | XInput pads, keyboard, keyboard stand-in pad | Trigger rumble | | Audio | Menu, video and loading sound; XMA voices and Opus streams decode | Reverb is silent; Opus results unverified against the title | | GPU: menus | Draws, compute and presentation on host D3D12; only changed title memory is copied | Frame pacing drifts on one screen in release builds | | GPU: world | Mesh pipelines, shader-written buffers, descriptor lifetimes, indirect execution (arguments clamped), pipelines made by worker threads and kept on disk, depth bounds on supporting adapters (synthetic tests); occlusion, pipeline statistics and timestamp queries run on the host GPU | Most of the scene is still missing (untranslated shaders drop draws); frames take seconds; HDR and scaling are missing; console-only query types get stand-in results | | Shaders | Console GPU code recompiled to DXIL at first use, cached on disk. Menus: all. World: mesh 8,191 of 8,506, vertex/pixel 10,617 of 12,346, compute 1,643 of 2,539 | Merged geometry stages, the ray-tracing builder's shaders; some compute programs need a GPU with 64-lane waves | | Textures | Console tiled layouts and detiling for the modes the title uses | Render-target metadata planes | | Series S mode | Runs through the menus to the loading screen | The world, as above | In an offline scan of `shaders.rpf`, SM 6.6 texture atomics recovered 520 shader translations. Specializing proven branch outcomes recovered another 108 by keeping descriptor words off paths that consume buffer data. Microsoft's DXIL validator accepted all 628 shaders. Game rendering with these shader changes still needs a Windows D3D12 run. ## Getting started Requirements: Windows 10/11 x64, a CPU with AVX2, a Direct3D 12 GPU with shader model 6.6 (and mesh shaders for the world), Rust (pinned in `rust-toolchain.toml`). The title also needs several GiB of available Windows commit at startup. Check **Committed** under **Task Manager → Performance → Memory**. If `crashes.log` reports Windows error 1455, close other applications or increase the Windows paging file size, then retry. ```powershell cargo xtask install-hooks # asset-policy check on every commit copy victory.example.toml victory.toml # then set your paths (outside the repo) cargo test --workspace # needs no game data cargo run -p victory -- config # check your paths ``` Run the title: ```powershell cargo build --release -p victory target\release\victory.exe run \ --execute ``` The window caption shows the framerate. Saves, settings and `crashes.log` are kept under the data folder (default `%LOCALAPPDATA%\victory\data`), derived data under the cache folder. Input: XInput pads. A DualSense or DualSense Edge (USB or Bluetooth) is read over HID as well and plays as the first pad when no XInput pad answers. With no pad connected the keyboard is a pad while the title's window has focus: | Keys | Pad | |------|-----| | W A S D / I J K L | left / right stick | | arrows | D-pad | | Enter, O | A, B | | Backspace, X, Y | B, X, Y | | Q / E, Z / C | shoulders, triggers | | F / H | stick clicks | | Esc, Tab | Menu, View | ## Commands ``` victory inspect [--imports] [--exports] victory census [paths...] [--missing] [--strict] victory lib-exports [--list] victory shader-info [paths...] [--verbose] [--disasm] victory translate [paths...] [--validate] [--pipelines] [--list] [--jobs N] victory run [--execute] [--unimplemented trap|zero] [--strict] [--console series-x|series-s] [-- ] victory config ``` Logging: `VICTORY_LOG=victory_loader=trace,info` (a release build logs info and above). ## Debugging A release build has no debugging aids. Build them in with ```powershell cargo build --profile diag -p victory --features diagnostics # target\diag\victory.exe ``` | Variable | Effect | |----------|--------| | `VICTORY_LOG=<target>=debug,...` | debug and trace output | | `VICTORY_STACKS=20,60` | every thread's stack at those seconds | | `VICTORY_WATCH=<rva>,...` | logs a title u32 when it changes | | `VICTORY_KEYS=30:Enter,35:X` | presses keys at those seconds, focus or not | | `VICTORY_CRASH_BREAKPOINTS=1` | appends first-chance breakpoints to `crashes.log`, including ones a handler may recover from | | `VICTORY_CRASH_SAVE=<rva>:<len>,...` | saves title memory to the cache folder on a crash | | `VICTORY_CAPTURE=<dir>` | saves presented frames (powers of two, or `VICTORY_CAPTURE_FRAMES=<list>`) | | `VICTORY_DUMP_TARGETS=1` | with the two above, saves every render target of those frames | | `VICTORY_D3D12_DEBUG=1` | host debug layer | | `VICTORY_D3D12_GBV=1` | with the above, GPU-based validation (bad descriptor use reported, not faulted; slow) | | `VICTORY_D3D12_DRED=1` | on a GPU failure, the allocation hit and the commands in flight | | `VICTORY_SKIP_PIPELINES=<hash>,...` | omit draws and dispatches, including indirect ones, whose pipeline contains a listed 16-digit shader hash | | `VICTORY_GPU_TIMING=1` | with the above, each list of a submission run and timed on its own; slow lists logged with their slowest commands | | `VICTORY_D3D12_WARP=1` | host device on the software adapter (slow; cannot reset the driver) | | `VICTORY_SHADER_LOOP_LIMIT=<n>` | translated shader loops stop after `n` iterations per lane instead of 2^20 (own shader cache entries); if a lower `n` makes world frames much faster, loops hitting the limit are what makes them slow | | `VICTORY_AUDIO_CAPTURE=<file.wav>` | records what the title plays (our process only) | | `VICTORY_XMA_DUMP=<dir>` | saves the first 32 XMA voices' context and input | Every build appends unhandled exceptions, panics, and host GPU failures to `crashes.log` in the title's data folder. For a startup breakpoint (`0x80000003`), run the diagnostics build with `VICTORY_CRASH_BREAKPOINTS=1`. Keep the console output along with the new `crashes.log` entries. A host DLL refusal includes the caller stack in the console output. The refusal is expected for DLLs outside the host policy, including `rpcrt4.dll`. On Series 1.0.2.1, a missing `appdata0.rpf` reproduced the breakpoint at `+0x2237178` before the first window. Restore the archive from the same package beside the title executable. `run --execute` checks that it can read the RPF9 header before starting this build. To compare hardware and software rendering, repeat with `VICTORY_D3D12_WARP=1` and check the console for `host device on the software adapter (WARP)` to confirm the WARP device was created. Compare the exception's module and offset, stack frames, and preceding messages across the two runs. ## License GPL-3.0-or-later. See [LICENSE](LICENSE).