GPU: shader cache keyed by LOOPS_WAVE and LDS_FIRST_INIT; F8/F7 let texture copies go by hand #1437

Merged
TolkoDev merged 2 commits from upstream-pr/1437 into main 2026-11-29 00:24:47 +00:00
TolkoDev commented 2026-11-28 19:51:45 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by TolkoDev on 2026-11-28T19:51:45Z.


Two independent changes, one commit each. Either can be taken alone.

1. Shader cache key

What was wrong. VICTORY_LOOPS_WAVE (emit/mod.rs) and VICTORY_LDS_FIRST_INIT (emit/lower.rs) change the translated code, but neither is in the cache key. A run with either one set can be served translations cached with it unset, and the other way round.

The change. Both names are added to the key's list of switches (+2 lines). Shaders are translated once more after this.

2. F8 / F7 let texture copies go by hand

Why. With the card full there is no way to ask, while playing, for idle host texture copies to be let go.

The change.

  • F8 forces one look of the idle sweep and of slot eviction: copies held by their texture alone go after 3 s idle, copies shown by table-read slots after 10 s.
  • F7 does the same after 1 s and 3 s, also for copies that just came back. It also drops idle texture staging buffers, trims spare scratch chunks and empties the process working set. Expect a long hitch.
  • Neither needs VICTORY_SLOT_EVICT. Each press logs what it let go. Without a press nothing is let go that was not before.
  • F7 rather than F9, which the diagnostics capture uses.

Limits. This does not fix black textures: slot eviction mostly cannot take textures that shaders pick by index.

Tested

Windows 10, on main at 923e38c. The checks do not all pass here, with or without this change.

  • victory-gpu tests, one process per test: 481 pass, 43 ignored, 67 abort the test process and 2 fail. The same 69 have the same outcomes on untouched main. cargo test --workspace stops at this package, so the packages after it were not reached.
  • CI's cargo clippy ... -D warnings fails on two findings in victory-shader/src/emit/lower.rs that main has too. For victory-gpu, with those two lints and deprecated allowed, the findings are those of main; none is in a changed line.
  • cargo xtask policy fails on the size of lower.rs, which is not changed here.
  • Two changed lines were rewrapped to rustfmt.toml after these runs; only cargo check -p victory-gpu was run again.

Not measured. How much memory a press frees, and any frame rate change. An earlier form of change 2 was built on v2026.11.28.01; this port to current main has not been run in the game.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5543983967 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1437). Originally posted by [TolkoDev](https://github.com/TolkoDev) on 2026-11-28T19:51:45Z. --- Two independent changes, one commit each. Either can be taken alone. ## 1. Shader cache key **What was wrong.** `VICTORY_LOOPS_WAVE` (`emit/mod.rs`) and `VICTORY_LDS_FIRST_INIT` (`emit/lower.rs`) change the translated code, but neither is in the cache key. A run with either one set can be served translations cached with it unset, and the other way round. **The change.** Both names are added to the key's list of switches (+2 lines). Shaders are translated once more after this. ## 2. F8 / F7 let texture copies go by hand **Why.** With the card full there is no way to ask, while playing, for idle host texture copies to be let go. **The change.** - **F8** forces one look of the idle sweep and of slot eviction: copies held by their texture alone go after 3 s idle, copies shown by table-read slots after 10 s. - **F7** does the same after 1 s and 3 s, also for copies that just came back. It also drops idle texture staging buffers, trims spare scratch chunks and empties the process working set. Expect a long hitch. - Neither needs `VICTORY_SLOT_EVICT`. Each press logs what it let go. Without a press nothing is let go that was not before. - F7 rather than F9, which the diagnostics capture uses. **Limits.** This does not fix black textures: slot eviction mostly cannot take textures that shaders pick by index. ## Tested Windows 10, on `main` at 923e38c. The checks do not all pass here, with or without this change. - `victory-gpu` tests, one process per test: 481 pass, 43 ignored, 67 abort the test process and 2 fail. The same 69 have the same outcomes on untouched `main`. `cargo test --workspace` stops at this package, so the packages after it were not reached. - CI's `cargo clippy ... -D warnings` fails on two findings in `victory-shader/src/emit/lower.rs` that `main` has too. For `victory-gpu`, with those two lints and `deprecated` allowed, the findings are those of `main`; none is in a changed line. - `cargo xtask policy` fails on the size of `lower.rs`, which is not changed here. - Two changed lines were rewrapped to `rustfmt.toml` after these runs; only `cargo check -p victory-gpu` was run again. **Not measured.** How much memory a press frees, and any frame rate change. An earlier form of change 2 was built on v2026.11.28.01; this port to current `main` has not been run in the game.
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
trustno1-coder/VIctory-NVIDIA!1437
No description provided.