Play: RAY TRACING runs on the card's ray tracing cores where it has DXR 1.1 (roaming 28 fps / 31 frames over 50 ms vs 14 / 485 in shaders) #4694

Open
github-bot wants to merge 1 commit from github-bot/gh-4693 into main AGit
Owner

@⁠KruIN689 on GitHub · 2026-12-01 02:05 UTC · original
KruIN689:up/rt-switch-hw → main · +114 −2 · 5 files · 1 commits · open

Fixes #

What it changes

  • Before: the F1 menu's RAY TRACING (VICTORY_BVH_BUILDER=1) always ran the console's structure walk in shaders. On a card with ray tracing cores that is much the slower way since #3706.
  • Now: RAY TRACING sets VICTORY_HW_RT=1 when the game's card runs DXR 1.1. Hardware RT already turns the title's builder off when both are set.
    • VICTORY_HW_RT given either way wins.
    • VICTORY_RT_HARDWARE=0 keeps the walk in shaders.
    • A card without DXR 1.1 keeps the walk in shaders.
  • Where: at victory run's start (play::prefer_hardware_rt_env), the one place both launchers go through (victory play, and scripts\play-nvidia.ps1's victory run), before anything reads VICTORY_HW_RT.
  • The card question: asked by a hidden victory hardware-rt in a process of its own, as victory shader-model is, because a process keeps the first D3D12 runtime it loads. It is asked only when RAY TRACING is on and the switch is unset, so nobody else pays for it.
  • F1 help text updated for both items.

Files: apps/victory/src/{play,run,main}.rs, crates/victory-gpu/src/streamline.rs (card_hardware_rt), crates/victory-gpu/src/host/menu.rs (help text).

How it was tested

  • GPU and profile: RTX 5080 16 GB (driver 621.40), Ryzen 9 9950X3D, Series X, native 1440p, DLSS and FG off, ray tracing on. Auto-driven roaming (walk and drive), 2+2 alternating runs in one session, one build, 6 min each, stats over the last 4 min.
  • Before (VICTORY_BVH_BUILDER=1, walk in shaders): 16.3 / 12.1 fps, 375 / 595 frames over 50 ms per 1,000, 196 / 499 over 100 ms, mean p99 231 / 269 ms, card 99–100 % busy.
  • After (VICTORY_HW_RT=1): 28.3 / 27.7 fps, 29 / 34 frames over 50 ms per 1,000, 2 / 2 over 100 ms, mean p99 50 / 50 ms, card 87–92 % busy.
  • With this change: launched with only VICTORY_BVH_BUILDER=1 through scripts\play-nvidia.ps1. The log shows HLE XboxBvhBuilder constructed (hardware DXR 1.1) and the title's structure builder off. Over 2 min: 27.3 fps, 24 frames over 50 ms per 1,000, no errors. victory hardware-rt prints dxr 1.1 there.
  • Long session: on the same PC a 20-minute roam with hardware RT held 26–29 fps without drift (posted on #3706).
  • Wave sizes: not applicable.
  • cargo test for the crates it touches: yes. The new ray_tracing_takes_the_cards_cores_where_it_has_them covers on, a card without DXR 1.1, the switch given, VICTORY_RT_HARDWARE=0, and RT off (the card is not asked there).
  • Clippy: cargo clippy -p victory-gpu on main f5c3d243 stops at #4635's new font.rs / menu.rs lints (too many arguments, a manual is_multiple_of, collapsible ifs). Those are not from this change; on our fork, where they are absent, both clippys are clean.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3706 (hardware RT itself), #4338 and #4339 (its stability; tested in their comments). No PR makes RAY TRACING pick hardware RT.

Not tested: cards without DXR 1.1 (covered by the unit test only), AMD cards, and a cold first start, where the RT shaders are translated again.

AI use: Claude Code (Claude Opus 5.5) measured, wrote, tested and described this. Posted with the account owner's approval. Label: [pr-performance].

**@⁠KruIN689** on GitHub · 2026-12-01 02:05 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4693) `KruIN689:up/rt-switch-hw` → `main` · +114 −2 · 5 files · 1 commits · open Fixes # ## What it changes - **Before:** the F1 menu's **RAY TRACING** (`VICTORY_BVH_BUILDER=1`) always ran the console's structure walk in shaders. On a card with ray tracing cores that is much the slower way since #3706. - **Now:** RAY TRACING sets `VICTORY_HW_RT=1` when the game's card runs DXR 1.1. Hardware RT already turns the title's builder off when both are set. - `VICTORY_HW_RT` given either way wins. - `VICTORY_RT_HARDWARE=0` keeps the walk in shaders. - A card without DXR 1.1 keeps the walk in shaders. - **Where:** at `victory run`'s start (`play::prefer_hardware_rt_env`), the one place both launchers go through (`victory play`, and `scripts\play-nvidia.ps1`'s `victory run`), before anything reads `VICTORY_HW_RT`. - **The card question:** asked by a hidden `victory hardware-rt` in a process of its own, as `victory shader-model` is, because a process keeps the first D3D12 runtime it loads. It is asked only when RAY TRACING is on and the switch is unset, so nobody else pays for it. - **F1 help text** updated for both items. Files: `apps/victory/src/{play,run,main}.rs`, `crates/victory-gpu/src/streamline.rs` (`card_hardware_rt`), `crates/victory-gpu/src/host/menu.rs` (help text). ## How it was tested - **GPU and profile:** RTX 5080 16 GB (driver 621.40), Ryzen 9 9950X3D, Series X, native 1440p, DLSS and FG off, ray tracing on. Auto-driven roaming (walk and drive), 2+2 alternating runs in one session, one build, 6 min each, stats over the last 4 min. - **Before** (`VICTORY_BVH_BUILDER=1`, walk in shaders): 16.3 / 12.1 fps, 375 / 595 frames over 50 ms per 1,000, 196 / 499 over 100 ms, mean p99 231 / 269 ms, card 99–100 % busy. - **After** (`VICTORY_HW_RT=1`): 28.3 / 27.7 fps, 29 / 34 frames over 50 ms per 1,000, 2 / 2 over 100 ms, mean p99 50 / 50 ms, card 87–92 % busy. - **With this change:** launched with only `VICTORY_BVH_BUILDER=1` through `scripts\play-nvidia.ps1`. The log shows `HLE XboxBvhBuilder constructed (hardware DXR 1.1)` and `the title's structure builder off`. Over 2 min: 27.3 fps, 24 frames over 50 ms per 1,000, no errors. `victory hardware-rt` prints `dxr 1.1` there. - **Long session:** on the same PC a 20-minute roam with hardware RT held 26–29 fps without drift (posted on #3706). - **Wave sizes:** not applicable. - **`cargo test` for the crates it touches:** yes. The new `ray_tracing_takes_the_cards_cores_where_it_has_them` covers on, a card without DXR 1.1, the switch given, `VICTORY_RT_HARDWARE=0`, and RT off (the card is not asked there). - **Clippy:** `cargo clippy -p victory-gpu` on main f5c3d243 stops at #4635's new `font.rs` / `menu.rs` lints (too many arguments, a manual `is_multiple_of`, collapsible `if`s). Those are not from this change; on our fork, where they are absent, both clippys are clean. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3706 (hardware RT itself), #4338 and #4339 (its stability; tested in their comments). No PR makes RAY TRACING pick hardware RT. **Not tested:** cards without DXR 1.1 (covered by the unit test only), AMD cards, and a cold first start, where the RT shaders are translated again. AI use: Claude Code (Claude Opus 5.5) measured, wrote, tested and described this. Posted with the account owner's approval. Label: [pr-performance].
The F1 menu's RAY TRACING (VICTORY_BVH_BUILDER=1) sets VICTORY_HW_RT=1 when the game's
card runs DXR 1.1 and VICTORY_HW_RT was not given (VICTORY_RT_HARDWARE=0 keeps the walk
in shaders); hardware RT already turns the title's builder off when both are set. Decided
at victory run's start, the one place victory play and scripts\play-nvidia.ps1 both go
through, before anything reads VICTORY_HW_RT. The card is asked by a hidden
`victory hardware-rt` in a process of its own, as `victory shader-model` is, and only
when RAY TRACING is on and the switch is unset.

RTX 5080, native 1440p, roaming, 2+2 runs in one session: the walk in shaders 16.3 / 12.1
fps and 375 / 595 frames over 50 ms per 1,000 (card 99-100 % busy); the cores 28.3 / 27.7
fps and 29 / 34.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 02:08:54 +00:00
Author
Owner

@⁠frametrace on GitHub · 2026-12-01 05:26 UTC · original

Related: with hardware RT as the default, the copy back that 9a427c14 turns on costs most of the gap to RT off on a 5090 (#4756).

**@⁠frametrace** on GitHub · 2026-12-01 05:26 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4693#issuecomment-7301767050) Related: with hardware RT as the default, the copy back that 9a427c14 turns on costs most of the gap to RT off on a 5090 (#4756).
This pull request has changes conflicting with the target branch.
  • apps/victory/src/play.rs
  • crates/victory-gpu/src/host/menu.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4693'
git switch 'github-bot/gh-4693'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4693'
git switch 'github-bot/gh-4693'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4693'
git switch 'main'
git merge --squash 'github-bot/gh-4693'
git switch 'main'
git merge --ff-only 'github-bot/gh-4693'
git switch 'main'
git merge 'github-bot/gh-4693'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4694
No description provided.