GPU: port texture streaming and indirect draw improvements #9

Open
Lkxex wants to merge 9 commits from upstream-pr/9 into main
Lkxex commented 2026-11-25 17:15:43 +00:00 (Migrated from github.com)

Imported from DexNom/VIctory. Originally posted by Lkxex on 2026-11-25T17:15:43Z.


Ports DirectStorage staging, bounded texture queue sorting, shader signature deduplication and opt-in GPU detiling in the parallel prelude. DexNom's sparse and partial-mip upload paths are preserved.

Windows cargo check passed. In-game FPS was not measured.

<!-- greyfinch-sync:DexNom/VIctory:issue:5495840415 --> Imported from [DexNom/VIctory](https://github.com/DexNom/VIctory/pull/9). Originally posted by [Lkxex](https://github.com/Lkxex) on 2026-11-25T17:15:43Z. --- Ports DirectStorage staging, bounded texture queue sorting, shader signature deduplication and opt-in GPU detiling in the parallel prelude. DexNom's sparse and partial-mip upload paths are preserved. Windows cargo check passed. In-game FPS was not measured.
molodayamama commented 2026-11-25 18:53:55 +00:00 (Migrated from github.com)

Imported from DexNom/VIctory. Originally posted by molodayamama on 2026-11-25T18:53:55Z.


Tested on NVIDIA GeForce RTX 4060 8 GB / AMD Ryzen 5 5600 / Windows 10 22H2 (19045.5794) / Rust 1.98.1 (x86_64-pc-windows-msvc), since the PR description noted only cargo check was run so far:

Checks on unmodified PR (c8c53af)

  • cargo test --locked -p xtask: 4 passed, 0 failed (asset policy: 194 files ok)
  • cargo clippy --workspace --all-targets --locked -- -D warnings: 0 warnings
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: 0 warnings
  • cargo test --locked -p victory-formats --lib: 27 passed, 0 failed
  • cargo test --locked -p victory-hle --lib dstorage: 18 passed, 0 failed

Hardware D3D12 tests on RTX 4060

(Run with Agility SDK 1.614.1 via #12 for Windows 10 SM 6.6 support; no game files):

  • cargo test --locked -p victory-gpu --lib: 176 passed, 0 failed (including texture::gpu_detile::tests::gpu_detiling_matches_the_cpu_texture_upload)
  • VICTORY_GPU_DETILE=1 resource::tests::title_texture_upload_runs_gpu_detile_from_the_prelude -- --ignored --exact: passed (0.27s)
  • VICTORY_GPU_DETILE=1 cargo test --release --locked -p victory-gpu --lib texture::gpu_detile::tests::bench_gpu_detiling_texture_uploads -- --ignored --exact --nocapture:
Texture Path Fill Recorded Done
2048x2048 DXGI_FORMAT(28) (RGBA8) CPU 4.1957 ms 4.3689 ms 8.3933 ms
2048x2048 DXGI_FORMAT(28) (RGBA8) GPU 1.7233 ms 1.8929 ms 6.5508 ms
4096x4096 DXGI_FORMAT(98) (BC7) CPU 3.5763 ms 3.7034 ms 8.2078 ms
4096x4096 DXGI_FORMAT(98) (BC7) GPU 1.7945 ms 1.9964 ms 6.3055 ms

Merge note

Against current main (2e01ab4), git merge-tree reports a content conflict in crates/victory-gpu/src/descriptor/host.rs, so this branch will need a rebase before merging.

<!-- greyfinch-sync:DexNom/VIctory:comment:7171552263 --> Imported from [DexNom/VIctory](https://github.com/DexNom/VIctory/pull/9#issuecomment-7171552263). Originally posted by [molodayamama](https://github.com/molodayamama) on 2026-11-25T18:53:55Z. --- Tested on **NVIDIA GeForce RTX 4060 8 GB** / AMD Ryzen 5 5600 / Windows 10 22H2 (`19045.5794`) / Rust `1.98.1` (`x86_64-pc-windows-msvc`), since the PR description noted only `cargo check` was run so far: ### Checks on unmodified PR (`c8c53af`) - `cargo test --locked -p xtask`: **4 passed, 0 failed** (`asset policy: 194 files ok`) - `cargo clippy --workspace --all-targets --locked -- -D warnings`: **0 warnings** - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: **0 warnings** - `cargo test --locked -p victory-formats --lib`: **27 passed, 0 failed** - `cargo test --locked -p victory-hle --lib dstorage`: **18 passed, 0 failed** ### Hardware D3D12 tests on RTX 4060 (Run with Agility SDK `1.614.1` via #12 for Windows 10 SM 6.6 support; no game files): - `cargo test --locked -p victory-gpu --lib`: **176 passed, 0 failed** (including `texture::gpu_detile::tests::gpu_detiling_matches_the_cpu_texture_upload`) - `VICTORY_GPU_DETILE=1` `resource::tests::title_texture_upload_runs_gpu_detile_from_the_prelude -- --ignored --exact`: **passed** (`0.27s`) - `VICTORY_GPU_DETILE=1` `cargo test --release --locked -p victory-gpu --lib texture::gpu_detile::tests::bench_gpu_detiling_texture_uploads -- --ignored --exact --nocapture`: | Texture | Path | Fill | Recorded | Done | | --- | --- | ---: | ---: | ---: | | `2048x2048` `DXGI_FORMAT(28)` (RGBA8) | CPU | 4.1957 ms | 4.3689 ms | 8.3933 ms | | `2048x2048` `DXGI_FORMAT(28)` (RGBA8) | GPU | **1.7233 ms** | **1.8929 ms** | **6.5508 ms** | | `4096x4096` `DXGI_FORMAT(98)` (BC7) | CPU | 3.5763 ms | 3.7034 ms | 8.2078 ms | | `4096x4096` `DXGI_FORMAT(98)` (BC7) | GPU | **1.7945 ms** | **1.9964 ms** | **6.3055 ms** | ### Merge note Against current `main` (`2e01ab4`), `git merge-tree` reports a content conflict in `crates/victory-gpu/src/descriptor/host.rs`, so this branch will need a rebase before merging.
andrewDoing commented 2026-11-26 23:15:34 +00:00 (Migrated from github.com)

Imported from DexNom/VIctory. Originally posted by andrewDoing on 2026-11-26T23:15:34Z.


I reproduced incorrect texels in the opt-in GPU detiler for supported SW_64KB_R_X at 83e78b9 on a physical RTX 5070. A single 513×513 RGBA8 mip (large enough to pass the upload gate) diverged from the CPU detile starting on row 16. Five standard-swizzle/format controls matched the CPU reference.

The shader at texture/gpu_detile.rs:24 adds row and column offsets, whereas render_xor_offset combines overlapping in-tile bits with XOR. A scratch control adding the 64 KiB block components and XORing their low 16 bits for this mode made all six native readbacks pass. Alternatively, excluding SW_64KB_R_X in GpuDetile::new would retain the CPU path until it is supported. The control is not a complete production patch; no gameplay was tested.

Verification was AI-assisted with GPT-6.2 Astra.

<!-- greyfinch-sync:DexNom/VIctory:comment:7205389671 --> Imported from [DexNom/VIctory](https://github.com/DexNom/VIctory/pull/9#issuecomment-7205389671). Originally posted by [andrewDoing](https://github.com/andrewDoing) on 2026-11-26T23:15:34Z. --- I reproduced incorrect texels in the opt-in GPU detiler for supported `SW_64KB_R_X` at `83e78b9` on a physical RTX 5070. A single 513×513 RGBA8 mip (large enough to pass the upload gate) diverged from the CPU detile starting on row 16. Five standard-swizzle/format controls matched the CPU reference. The shader at `texture/gpu_detile.rs:24` adds row and column offsets, whereas `render_xor_offset` combines overlapping in-tile bits with XOR. A scratch control adding the 64 KiB block components and XORing their low 16 bits for this mode made all six native readbacks pass. Alternatively, excluding `SW_64KB_R_X` in `GpuDetile::new` would retain the CPU path until it is supported. The control is not a complete production patch; no gameplay was tested. Verification was AI-assisted with GPT-6.2 Astra.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/9:upstream-pr/9'
git switch 'upstream-pr/9'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/9'
git switch 'upstream-pr/9'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/9'
git switch 'upstream-pr/9'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/9'
git switch 'main'
git merge --squash 'upstream-pr/9'
git switch 'main'
git merge --ff-only 'upstream-pr/9'
git switch 'main'
git merge 'upstream-pr/9'
git push origin 'main'
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
DexNom/VIctory!9
No description provided.