GTA VI: all local work to reach the lit world, on current main (draft) #1963

Closed
antocorvo3000 wants to merge 37 commits from upstream-pr/1965 into main
antocorvo3000 commented 2026-11-25 01:50:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by antocorvo3000 on 2026-11-25T01:50:18Z.


Updated: the branch is now on top of current main (940d32f). This is the build that reaches the lit world of Grand Theft Auto VI 1.0.2.1 on an RX 6800 XT (Series X mode): exteriors and interiors lit, ~1.1-1.2 fps, about 5,000 draws/frame. Textures are still missing in places and some geometry is broken (hair as spikes); that is the next work. Opened as a draft so you can take what is useful; #1962 is the focused heap-usage change.

Findings on current main

  • Prologue cutscene crash with view marks. With cd94d35 and 940d32f the title crashes in the prologue cutscene (int_prolo_int_prolo_int, a title read of address -1, reproduced twice on plain 940d32f with only the run conveniences below). Without those two commits the same scene runs 19 minutes. Here view marks are behind VICTORY_VIEW_MARKS=1 (off) and 940d32f is reverted; the shader cache key includes the setting.
  • White game window (timing dependent). The presenter attached the swap chain to the first visible top-level window; if the title presented before showing its window, frames went to our own window and the title's stayed white. Now the swap chain goes to the title's stand-in window even before it is shown (VICTORY_PRESENT_STAND_IN, default on), with a window test that reproduces it.
  • Descriptor tables serialized the recording threads. Each table entry waited on the heap's made mutex, which waited on the VIEWS mutex: 167 us per table in the world (~2.3 s of thread time per frame). Lock-free fast path for unchanged slots, RwLock for VIEWS and buffer copy lookups (VICTORY_MIRROR_FAST, default on).

What is in it (beyond the earlier description)

  • Heap usage feedback, including descriptors loaded dynamically from tables (VICTORY_HEAP_TABLE_MARKS).
  • Translator: the 20 shaders that did not translate in the world now translate and validate (lane-mask joins, selects on untracked masks, SCC from lane-mask SOP ops, descriptor dimensions, f64 sums in whole-wave sections, unreachable phi predecessors, nested descriptor phis), each class behind a switch.
  • CopyTextureRegion to placed footprints, v_permlanex16_b32, v_cvt_f32_f64.
  • Diagnostics: per-pipeline GPU profile (VICTORY_GPU_PROFILE=1), per-stage CPU profile (VICTORY_CPU_PROFILE=1), capture on demand (capture-now in the capture folder).
  • Experimental, off by default and not ready: VRAM copies of title memory (VICTORY_VRAM_COPIES=1, with async it removed the device at the start screens) and overlapping CPU preparation with GPU completion (VICTORY_ASYNC_SUBMIT=1, reaches the world but the lighting disappears).
  • Local conveniences, probably not for main: VICTORY_TITLE_DIR, VICTORY_AUTO_A, in-memory patches of the 1.0.2.1 executable. The patches that switch off lighting passes (4, 5, 7-9) are off by default; patch 6 (world render resolution mode) is on: without it the title takes a render path where the light and tile lists are bound as 1x1 placeholders and the exposure sits at its minimum (black world).

Testing

cargo test --release --lib: victory-gpu 182, victory-shader 258 passed on this machine.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5483567194 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1965). Originally posted by [antocorvo3000](https://github.com/antocorvo3000) on 2026-11-25T01:50:18Z. --- Updated: the branch is now on top of current main (940d32f). This is the build that reaches the lit world of Grand Theft Auto VI 1.0.2.1 on an RX 6800 XT (Series X mode): exteriors and interiors lit, ~1.1-1.2 fps, about 5,000 draws/frame. Textures are still missing in places and some geometry is broken (hair as spikes); that is the next work. Opened as a draft so you can take what is useful; #1962 is the focused heap-usage change. ## Findings on current main - **Prologue cutscene crash with view marks.** With cd94d35 and 940d32f the title crashes in the prologue cutscene (`int_prolo_int_prolo_int`, a title read of address -1, reproduced twice on plain 940d32f with only the run conveniences below). Without those two commits the same scene runs 19 minutes. Here view marks are behind `VICTORY_VIEW_MARKS=1` (off) and 940d32f is reverted; the shader cache key includes the setting. - **White game window (timing dependent).** The presenter attached the swap chain to the first visible top-level window; if the title presented before showing its window, frames went to our own window and the title's stayed white. Now the swap chain goes to the title's stand-in window even before it is shown (`VICTORY_PRESENT_STAND_IN`, default on), with a window test that reproduces it. - **Descriptor tables serialized the recording threads.** Each table entry waited on the heap's `made` mutex, which waited on the `VIEWS` mutex: 167 us per table in the world (~2.3 s of thread time per frame). Lock-free fast path for unchanged slots, `RwLock` for `VIEWS` and buffer copy lookups (`VICTORY_MIRROR_FAST`, default on). ## What is in it (beyond the earlier description) - Heap usage feedback, including descriptors loaded dynamically from tables (`VICTORY_HEAP_TABLE_MARKS`). - Translator: the 20 shaders that did not translate in the world now translate and validate (lane-mask joins, selects on untracked masks, SCC from lane-mask SOP ops, descriptor dimensions, f64 sums in whole-wave sections, unreachable phi predecessors, nested descriptor phis), each class behind a switch. - `CopyTextureRegion` to placed footprints, `v_permlanex16_b32`, `v_cvt_f32_f64`. - Diagnostics: per-pipeline GPU profile (`VICTORY_GPU_PROFILE=1`), per-stage CPU profile (`VICTORY_CPU_PROFILE=1`), capture on demand (`capture-now` in the capture folder). - Experimental, **off by default and not ready**: VRAM copies of title memory (`VICTORY_VRAM_COPIES=1`, with async it removed the device at the start screens) and overlapping CPU preparation with GPU completion (`VICTORY_ASYNC_SUBMIT=1`, reaches the world but the lighting disappears). - Local conveniences, probably not for main: `VICTORY_TITLE_DIR`, `VICTORY_AUTO_A`, in-memory patches of the 1.0.2.1 executable. The patches that switch off lighting passes (4, 5, 7-9) are off by default; patch 6 (world render resolution mode) is on: without it the title takes a render path where the light and tile lists are bound as 1x1 placeholders and the exposure sits at its minimum (black world). ## Testing `cargo test --release --lib`: victory-gpu 182, victory-shader 258 passed on this machine.
antocorvo3000 commented 2026-11-25 02:06:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by antocorvo3000 on 2026-11-25T01:56:21Z.


More of the same work, for reference:

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150133711 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1965#issuecomment-7150133711). Originally posted by [antocorvo3000](https://github.com/antocorvo3000) on 2026-11-25T01:56:21Z. --- More of the same work, for reference: - the first approach (title memory mirror and many translator and runtime fixes): draft PR from branch `gta6-first-approach`; - a budget-based alternative for placed-texture heap slots, superseded by #1962: branch `gta6-placed-texture-budget` (https://github.com/antocorvo3000/VIctory/tree/gta6-placed-texture-budget).
Marvisak commented 2026-11-25 04:06:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:15:10Z.


Automated triage for the maintainers.

Needs rebase. This head now conflicts with main in crates/victory-gpu/src/bindless.rs, crates/victory-gpu/src/descriptor.rs, crates/victory-gpu/src/descriptor/host.rs, crates/victory-gpu/src/draw.rs, crates/victory-gpu/src/fence.rs and crates/victory-gpu/src/host.rs. It will be reviewed once rebased. The earlier needs-work verdict (title-code patching needing the maintainer's decision, the revert of 940d32f, local commits, splitting into separate PRs, failing CI) will be revisited after the rebase.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151737610 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1965#issuecomment-7151737610). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T03:15:10Z. --- <!-- victory-triage v1 head=2c16ed2deb6479ad27f43d2f6d28639b40f0c417 verdict=needs-rebase at=2026-11-25T16:17:10Z --> Automated triage for the maintainers. **Needs rebase.** This head now conflicts with `main` in `crates/victory-gpu/src/bindless.rs`, `crates/victory-gpu/src/descriptor.rs`, `crates/victory-gpu/src/descriptor/host.rs`, `crates/victory-gpu/src/draw.rs`, `crates/victory-gpu/src/fence.rs` and `crates/victory-gpu/src/host.rs`. It will be reviewed once rebased. The earlier needs-work verdict (title-code patching needing the maintainer's decision, the revert of `940d32f`, local commits, splitting into separate PRs, failing CI) will be revisited after the rebase. --- _Generated by [Claude Code](https://claude.ai/code)_
fiestorra commented 2026-11-25 06:02:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-25T05:09:05Z.


Independent check on NVIDIA: as it stands, this branch still removes the device at frame 64 here — and that is the AMD/NVIDIA difference, not a criticism of the work

I ran your branch as it is (rev = c68d6fb, based on 42363ab, no rebase) on this machine: session 1 (interactive desktop), RTX 4090, driver 32.0.16.2124, release, empty cache, 150 s:

device removed                          2
no host texture … 2560x1440 format 115  1
host texture made only as a fallback    0
dropping unordered access               0
host view heap capped at 1000000        1
frame=64 draws=96

So on an NVIDIA card it does not reach the world: it stops at the same frame 64 that main at that revision stops at.

Why yours works and mine does not, as far as I can tell from the numbers: B4G4R4A4_UNORM (DXGI format 115) can be a render target on the RX 6800 XT and cannot on this driver. That is the ALLOW_RENDER_TARGET call the D3D12 debug layer refuses here:

id=599  A texture with D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET must be created with
        a format that is, or can be cast to, a render-target format.
        D3D12_RESOURCE_DESC::Format is B4G4R4A4_UNORM.

On your card the same call is legal and the boot goes on to the world; here it removes the device. That is why the same tree gives two completely different reports.

The two fixes that make it survive on NVIDIA are already open against main and do not touch what you are working on:

  • #1630 — the texture description ladder: when the host will not make the description as asked, it tries what it can (host texture made only as a fallback) instead of failing the call;
  • #1832 — drops the unordered-access permission that format 115 cannot carry (dropping unordered access).

With those two on main today I measure no removal, 2,048 frames, 13,312 draws in 120 s, where main alone dies at frame 64. So the combination worth measuring is your branch rebased onto a main that has those two: if your work is what reaches the world on AMD, that is the first candidate to reach it on NVIDIA as well.

What stops that measurement right now: your branch conflicts with today's main in five files —

crates/victory-gpu/src/descriptor/host.rs
crates/victory-gpu/src/shader_cache.rs
crates/victory-gpu/src/shadow.rs
crates/victory-shader/src/emit/host.rs
crates/victory-shader/src/emit/shader.rs

which is also why GitHub reports it as not mergeable. I did not attempt the rebase: it is 3,262 lines across 28 files and the conflicts are in the page-marking and heap ground where guessing does more harm than good.

If it helps, I can measure the rebased tree the moment it exists — same scenario, numbers in a comment, on the card where the failure is reproducible.

No game data is involved: counts, warnings and a format name.

Written with an AI assistant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153496770 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1965#issuecomment-7153496770). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-25T05:09:05Z. --- **Independent check on NVIDIA: as it stands, this branch still removes the device at frame 64 here — and that is the AMD/NVIDIA difference, not a criticism of the work** I ran your branch as it is (`rev = c68d6fb`, based on `42363ab`, no rebase) on this machine: session 1 (interactive desktop), **RTX 4090, driver 32.0.16.2124**, release, empty cache, 150 s: ``` device removed 2 no host texture … 2560x1440 format 115 1 host texture made only as a fallback 0 dropping unordered access 0 host view heap capped at 1000000 1 frame=64 draws=96 ``` So on an NVIDIA card it does not reach the world: it stops at the same frame 64 that `main` at that revision stops at. **Why yours works and mine does not, as far as I can tell from the numbers**: `B4G4R4A4_UNORM` (DXGI format 115) **can be a render target on the RX 6800 XT and cannot on this driver**. That is the `ALLOW_RENDER_TARGET` call the D3D12 debug layer refuses here: ``` id=599 A texture with D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET must be created with a format that is, or can be cast to, a render-target format. D3D12_RESOURCE_DESC::Format is B4G4R4A4_UNORM. ``` On your card the same call is legal and the boot goes on to the world; here it removes the device. That is why the same tree gives two completely different reports. **The two fixes that make it survive on NVIDIA are already open against `main`** and do not touch what you are working on: - **#1630** — the texture description ladder: when the host will not make the description as asked, it tries what it can (`host texture made only as a fallback`) instead of failing the call; - **#1832** — drops the unordered-access permission that format 115 cannot carry (`dropping unordered access`). With those two on `main` today I measure **no removal, 2,048 frames, 13,312 draws in 120 s**, where `main` alone dies at frame 64. So the combination worth measuring is **your branch rebased onto a `main` that has those two**: if your work is what reaches the world on AMD, that is the first candidate to reach it on NVIDIA as well. **What stops that measurement right now**: your branch conflicts with today's `main` in five files — ``` crates/victory-gpu/src/descriptor/host.rs crates/victory-gpu/src/shader_cache.rs crates/victory-gpu/src/shadow.rs crates/victory-shader/src/emit/host.rs crates/victory-shader/src/emit/shader.rs ``` which is also why GitHub reports it as not mergeable. I did not attempt the rebase: it is 3,262 lines across 28 files and the conflicts are in the page-marking and heap ground where guessing does more harm than good. If it helps, I can measure the rebased tree the moment it exists — same scenario, numbers in a comment, on the card where the failure is reproducible. No game data is involved: counts, warnings and a format name. Written with an AI assistant.
upstream-sync changed title from [PR #1965] GTA VI: all local work to reach the lit world (draft, for reference) to [PR #1965] GTA VI: all local work to reach the lit world, on current main (draft) 2026-11-25 12:02:48 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory!1963
No description provided.