GPU: improve texture uploads and specialize single-record indirect draws #150

Open
github-bot wants to merge 5 commits from github-bot/gh-150 into main AGit
Owner

@⁠Lkxex on GitHub · 2026-11-25 17:14 UTC · original
Lkxex:port/nov25-belo → main · +729 −37 · 5 files · 5 commits · open

This ports DirectStorage staging, shader signature deduplication, and opt-in texture detiling and indirect draw improvements. GPU detiling runs in the existing upload prelude. The console texture-format change is covered separately by PR 7.

Validation: Windows cargo check passed on the port. In-game behavior and FPS have not been measured.

**@⁠Lkxex** on GitHub · 2026-11-25 17:14 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/150) `Lkxex:port/nov25-belo` → `main` · +729 −37 · 5 files · 5 commits · open This ports DirectStorage staging, shader signature deduplication, and opt-in texture detiling and indirect draw improvements. GPU detiling runs in the existing upload prelude. The console texture-format change is covered separately by PR 7. Validation: Windows cargo check passed on the port. In-game behavior and FPS have not been measured.
Port-of: 166f783

Source contribution: 886
Port-of: bda5b05
Source contribution: 882
Use the upload prelude already shared by initial copies and refreshes. Retire the GPU scratch and upload allocations together.

Port-of: f26366d
Source contribution: GPU-detile
Use the one-lane shader for opt-in independent records while retaining the existing clamp for batches.

Port-of: e377a5c
Source contribution: 1016
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:36:42 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-25 17:54 UTC · original

Retested PR head with Qwen stopped and 21.8 GiB free VRAM on the RTX 3090: the same unhandled 0x80000003 at victory-image+0x1ce6e13 recurred. This makes VRAM pressure from the local model an unlikely cause of the startup failure.

**@⁠KernelSmoker** on GitHub · 2026-11-25 17:54 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/150#issuecomment-7170173139) Retested PR head with Qwen stopped and 21.8 GiB free VRAM on the RTX 3090: the same unhandled `0x80000003` at `victory-image+0x1ce6e13` recurred. This makes VRAM pressure from the local model an unlikely cause of the startup failure.
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-25 17:47 UTC · original · edited 2026-11-25 17:57 UTC

I tried an in-game launch of PR head c30bbee and its exact base a59f3e5 on Bazzite Linux 45, NVIDIA RTX 3090 (host driver 620.73.04), GE-Proton 10-34 / Wine 10.0, vkd3d-proton 3.0.0. Rust 1.98.1 diagnostics builds succeeded for both commits. I used VICTORY_COPY_MEMORY=1, VICTORY_SPARSE=0, and VICTORY_HAIR=1; the package's appdata0.rpf was found and opened.

Both commits stop at the same startup point, before frame 1: unhandled 0x80000003 at victory-image-b99f876b74d4a77f.dll+0x1ce6e13 during System Init. I repeated PR head with VICTORY_CRASH_BREAKPOINTS=1; the same exception and offset recurred. The crash log records the same stack on both commits.

So I could not measure in-game behavior/FPS for this change. The startup failure also reproduces on the PR's base, so this run does not indicate a regression from this PR. No game files or crash dumps are attached.

Correction to the test setup: the executable and appdata0.rpf were staged together, while the other archives and title DLLs were in a separate configured game_dir. run.rs mounts G: from the executable's parent. The launches therefore used an incomplete G: layout. These runs cannot establish startup or rendering behavior with the full package.

Retested with the title executable placed beside the complete package, using the Wine binary from GE-Proton 10-34 and native vkd3d-proton/DXGI overrides. Both binaries passed the earlier startup point. The base logged frame 4096 and the PR logged at least frame 512. These are presentation counters. I did not verify an interactive world or measure gameplay FPS.

**@⁠KernelSmoker** on GitHub · 2026-11-25 17:47 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/150#issuecomment-7170002288) · edited 2026-11-25 17:57 UTC I tried an in-game launch of PR head `c30bbee` and its exact base `a59f3e5` on Bazzite Linux 45, NVIDIA RTX 3090 (host driver 620.73.04), GE-Proton 10-34 / Wine 10.0, vkd3d-proton 3.0.0. Rust 1.98.1 diagnostics builds succeeded for both commits. I used `VICTORY_COPY_MEMORY=1`, `VICTORY_SPARSE=0`, and `VICTORY_HAIR=1`; the package's `appdata0.rpf` was found and opened. Both commits stop at the same startup point, before frame 1: unhandled `0x80000003` at `victory-image-b99f876b74d4a77f.dll+0x1ce6e13` during System Init. I repeated PR head with `VICTORY_CRASH_BREAKPOINTS=1`; the same exception and offset recurred. The crash log records the same stack on both commits. So I could not measure in-game behavior/FPS for this change. The startup failure also reproduces on the PR's base, so this run does not indicate a regression from this PR. No game files or crash dumps are attached. Correction to the test setup: the executable and appdata0.rpf were staged together, while the other archives and title DLLs were in a separate configured game_dir. run.rs mounts G: from the executable's parent. The launches therefore used an incomplete G: layout. These runs cannot establish startup or rendering behavior with the full package. Retested with the title executable placed beside the complete package, using the Wine binary from GE-Proton 10-34 and native vkd3d-proton/DXGI overrides. Both binaries passed the earlier startup point. The base logged frame 4096 and the PR logged at least frame 512. These are presentation counters. I did not verify an interactive world or measure gameplay FPS.
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-25 18:32 UTC · original

Compile check note on PR head c30bbee (cargo check --workspace --all-targets --locked --offline --target x86_64-pc-windows-gnu, Rust 1.98.1): victory-gpu test compilation fails with one typo in crates/victory-gpu/src/texture/gpu_detile.rs:

error[E0599]: no method named `read_back_buffer` found for reference `&host::Host` in the current scope
   --> crates/victory-gpu/src/texture/gpu_detile.rs:331:25
    |
331 |         let back = host.read_back_buffer(total).unwrap();
    |                         ^^^^^^^^^^^^^^^^
help: there is a method `readback_buffer` with a similar name

The non-test library and victory binary compile fine; this affects --all-targets / cargo test -p victory-gpu.

**@⁠KernelSmoker** on GitHub · 2026-11-25 18:32 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/150#issuecomment-7171044859) Compile check note on PR head `c30bbee` (`cargo check --workspace --all-targets --locked --offline --target x86_64-pc-windows-gnu`, Rust 1.98.1): `victory-gpu` test compilation fails with one typo in `crates/victory-gpu/src/texture/gpu_detile.rs`: ``` error[E0599]: no method named `read_back_buffer` found for reference `&host::Host` in the current scope --> crates/victory-gpu/src/texture/gpu_detile.rs:331:25 | 331 | let back = host.read_back_buffer(total).unwrap(); | ^^^^^^^^^^^^^^^^ help: there is a method `readback_buffer` with a similar name ``` The non-test library and `victory` binary compile fine; this affects `--all-targets` / `cargo test -p victory-gpu`.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-25 18:57 UTC · original

Following up on KernelSmoker's compile note above (read_back_buffer), with the test results once that line is fixed. RX 7900 XT, Windows 11 build 26300, Rust 1.98.1 (MSVC), head c30bbee, separate target dir; the game was not run.

With the line changed locally to let (back, _) = host.readback_buffer(total).unwrap(); (the method returns (ID3D12Resource, *const u8)):

  • gpu_detiling_matches_the_cpu_texture_upload passes on this card, and so do the existing texture:: and indirect:: tests.
  • The victory-hle dstorage tests pass, including the two new ones, and so does the new translate test in apps/victory.

The single-record clamp is behind VICTORY_INDIRECT_SINGLE=1, and the bound() tests use 64 to 5000 records, so no test in the suite reaches make_single. I added a local test that clamps one record with both the 64-lane and the 1-lane shader. The output records and the budget were identical in four cases: a draw, an indexed draw with clamped instances, a dispatch above 65,535 groups, and records past the budget.

indirect.rs conflicts with #120, which works on the same per-record clamp cost by batching clamps into 64-lane dispatches.

On dropping !crate::host::late(): on current main (000ffdd), execute_inner drains the previous in-flight submission before run_deferred. So fill should not overwrite the upload buffer while an earlier prelude still reads it. I checked this only by reading the code.

Not tested: FPS, the ignored benchmark, the detile path through a real submission with VICTORY_GPU_DETILE=1, NVIDIA.

**@⁠adrianmjim** on GitHub · 2026-11-25 18:57 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/150#issuecomment-7171624542) Following up on KernelSmoker's compile note above (`read_back_buffer`), with the test results once that line is fixed. RX 7900 XT, Windows 11 build 26300, Rust 1.98.1 (MSVC), head `c30bbee`, separate target dir; the game was not run. With the line changed locally to `let (back, _) = host.readback_buffer(total).unwrap();` (the method returns `(ID3D12Resource, *const u8)`): - `gpu_detiling_matches_the_cpu_texture_upload` passes on this card, and so do the existing `texture::` and `indirect::` tests. - The `victory-hle` `dstorage` tests pass, including the two new ones, and so does the new `translate` test in `apps/victory`. The single-record clamp is behind `VICTORY_INDIRECT_SINGLE=1`, and the `bound()` tests use 64 to 5000 records, so no test in the suite reaches `make_single`. I added a local test that clamps one record with both the 64-lane and the 1-lane shader. The output records and the budget were identical in four cases: a draw, an indexed draw with clamped instances, a dispatch above 65,535 groups, and records past the budget. `indirect.rs` conflicts with #120, which works on the same per-record clamp cost by batching clamps into 64-lane dispatches. On dropping `!crate::host::late()`: on current main (`000ffdd`), `execute_inner` drains the previous in-flight submission before `run_deferred`. So `fill` should not overwrite the upload buffer while an earlier prelude still reads it. I checked this only by reading the code. Not tested: FPS, the ignored benchmark, the detile path through a real submission with `VICTORY_GPU_DETILE=1`, NVIDIA.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/150/head:github-bot/gh-150'
git switch 'github-bot/gh-150'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-150'
git switch 'github-bot/gh-150'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-150'
git switch 'github-bot/gh-150'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-150'
git switch 'main'
git merge --squash 'github-bot/gh-150'
git switch 'main'
git merge --ff-only 'github-bot/gh-150'
git switch 'main'
git merge 'github-bot/gh-150'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.