GPU: VICTORY_* switches set to 0 are off (#610) #615

Merged
KoLolX3 merged 1 commit from upstream-pr/615 into main 2026-11-25 00:08:54 +00:00
KoLolX3 commented 2026-11-24 05:39:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KoLolX3 on 2026-11-24T05:39:58Z.


Fixes #610.

VICTORY_D3D12_WARP=0 still selected the software adapter because the switch was read as "the variable exists" (var_os(..).is_some()). The issue proposes a one-line predicate for that one variable. The same pattern is used by five more switches that the README documents as =1, so =0 turned each of them on:

Switch Read in
VICTORY_D3D12_DEBUG victory-gpu/src/host.rs
VICTORY_D3D12_GBV host.rs
VICTORY_D3D12_DRED host.rs
VICTORY_D3D12_WARP host.rs (the issue)
VICTORY_GPU_TIMING host.rs
VICTORY_DUMP_TARGETS victory-gpu/src/capture.rs

Change: a small victory-gpu/src/switch.rs with a pure value_is_on(Option<&OsStr>) (set and not 0) and switch::on(name), used by all six reads, plus one sentence in the README above its switch table. Any value other than 0 keeps the meaning it had, so nothing that worked before changes. It lives in victory-gpu because that crate does not depend on victory-core and all six reads are in it. This supersedes a patch for the WARP variable alone and will conflict textually with #208 in host.rs's adapter selection, which is easy to resolve (the predicate becomes switch::on(..)).

The diagnosis and the predicate are from the report in #610.

Tested on Linux (Ryzen 7 5700, rustc 1.98.1, the repo's pinned toolchain). victory-gpu does not build on Linux on main itself, so the unit tests were run in a scratch tree with #523 merged underneath this change:

  • 4 new tests (unset_is_off, zero_is_off, one_is_on, other_values_keep_their_old_meaning): pass. Negative control: with the old is_some() logic zero_is_off fails.
  • Full workspace in that tree, cargo test --workspace: 166 passed, 0 failed, 13 ignored.
  • On this branch alone: cargo xwin check --workspace --target x86_64-pc-windows-msvc ok, and cargo xwin check -p victory-gpu --features diagnostics ok (the switches are diagnostics-gated, so both configurations were compiled, with no new warnings).
  • rustfmt: 168 unformatted hunks, the same as main (this change adds none).

Not run: the six call sites themselves under a real D3D12 device (no Windows host here); they are plain boolean substitutions covered by the type-check. No game data is in this PR.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6575444419 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/615). Originally posted by [KoLolX3](https://github.com/KoLolX3) on 2026-11-24T05:39:58Z. --- Fixes #610. `VICTORY_D3D12_WARP=0` still selected the software adapter because the switch was read as "the variable exists" (`var_os(..).is_some()`). The issue proposes a one-line predicate for that one variable. The same pattern is used by **five more switches** that the README documents as `=1`, so `=0` turned each of them *on*: | Switch | Read in | |---|---| | `VICTORY_D3D12_DEBUG` | `victory-gpu/src/host.rs` | | `VICTORY_D3D12_GBV` | `host.rs` | | `VICTORY_D3D12_DRED` | `host.rs` | | `VICTORY_D3D12_WARP` | `host.rs` (the issue) | | `VICTORY_GPU_TIMING` | `host.rs` | | `VICTORY_DUMP_TARGETS` | `victory-gpu/src/capture.rs` | **Change:** a small `victory-gpu/src/switch.rs` with a pure `value_is_on(Option<&OsStr>)` (set and not `0`) and `switch::on(name)`, used by all six reads, plus one sentence in the README above its switch table. Any value other than `0` keeps the meaning it had, so nothing that worked before changes. It lives in `victory-gpu` because that crate does not depend on `victory-core` and all six reads are in it. This supersedes a patch for the WARP variable alone and will conflict textually with #208 in `host.rs`'s adapter selection, which is easy to resolve (the predicate becomes `switch::on(..)`). The diagnosis and the predicate are from the report in #610. **Tested** on Linux (Ryzen 7 5700, rustc 1.98.1, the repo's pinned toolchain). `victory-gpu` does not build on Linux on `main` itself, so the unit tests were run in a scratch tree with #523 merged underneath this change: - 4 new tests (`unset_is_off`, `zero_is_off`, `one_is_on`, `other_values_keep_their_old_meaning`): pass. Negative control: with the old `is_some()` logic `zero_is_off` fails. - Full workspace in that tree, `cargo test --workspace`: 166 passed, 0 failed, 13 ignored. - On this branch alone: `cargo xwin check --workspace --target x86_64-pc-windows-msvc` ok, and `cargo xwin check -p victory-gpu --features diagnostics` ok (the switches are diagnostics-gated, so both configurations were compiled, with no new warnings). - rustfmt: 168 unformatted hunks, the same as `main` (this change adds none). **Not run:** the six call sites themselves under a real D3D12 device (no Windows host here); they are plain boolean substitutions covered by the type-check. No game data is in this PR.
LAKSHYA-cmd-tech commented 2026-11-24 06:53:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T05:43:51Z.

Review: APPROVED


Tested and verified on Windows 11 x64 (D3D12 WARP + Hardware).

  • Tested all 4 switch unit tests (\unset_is_off, \zero_is_off, \one_is_on, \other_values_keep_their_old_meaning) on Windows.
  • Confirmed setting switches like \VICTORY_D3D12_WARP=0\ or \VICTORY_D3D12_DEBUG=0\ now correctly evaluates to false, matching user expectations and README documentation.
  • \cargo test -p victory-gpu: 47 passed, 0 failed.
  • \cargo clippy -p victory-gpu --lib -- -D warnings: 0 warnings.
  • \cargo xtask policy: 152 files clean.
<!-- greyfinch-sync:Marvisak/VIctory:review:6034278586 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/615#pullrequestreview-6034278586). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T05:43:51Z. **Review:** APPROVED --- Tested and verified on Windows 11 x64 (D3D12 WARP + Hardware). - Tested all 4 switch unit tests (\unset_is_off\, \zero_is_off\, \one_is_on\, \other_values_keep_their_old_meaning\) on Windows. - Confirmed setting switches like \VICTORY_D3D12_WARP=0\ or \VICTORY_D3D12_DEBUG=0\ now correctly evaluates to false, matching user expectations and README documentation. - \cargo test -p victory-gpu\: 47 passed, 0 failed. - \cargo clippy -p victory-gpu --lib -- -D warnings\: 0 warnings. - \cargo xtask policy\: 152 files clean.
fuzeofficlal commented 2026-11-24 06:56:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-24T05:53:26Z.


Verified #610 on Windows with the diagnostics feature. Each setting ran in a fresh process through the normal host() initialization. I resolved the live D3D12 device LUID through DXGI and checked the adapter's software flag.

VICTORY_D3D12_WARP Base d2a4bae PR a4974e4
Unset RTX 5090 RTX 5090
0 Microsoft Basic Render Driver (WARP) RTX 5090
1 Microsoft Basic Render Driver (WARP) Microsoft Basic Render Driver (WARP)

This verifies the WARP selection path without loading a title.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123370834 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/615#issuecomment-7123370834). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-24T05:53:26Z. --- Verified #610 on Windows with the `diagnostics` feature. Each setting ran in a fresh process through the normal `host()` initialization. I resolved the live D3D12 device LUID through DXGI and checked the adapter's software flag. | `VICTORY_D3D12_WARP` | Base `d2a4bae` | PR `a4974e4` | | --- | --- | --- | | Unset | RTX 5090 | RTX 5090 | | `0` | Microsoft Basic Render Driver (WARP) | RTX 5090 | | `1` | Microsoft Basic Render Driver (WARP) | Microsoft Basic Render Driver (WARP) | This verifies the WARP selection path without loading a title.
Exorion1er commented 2026-11-24 10:03:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Exorion1er on 2026-11-24T09:33:28Z.


#695 fixes the same issue (#610) for VICTORY_D3D12_WARP only. Its branch also carries a workspace-wide cargo fmt commit (37 files) and an unrelated speech commit, so it conflicts with main and with much else. This PR fixes =0 for all six switches and merges cleanly. One thing to know: it also makes =0 mean off for the other five switches, which is wider than #610 asked for (probably what everyone wants, but it's a behaviour change).

Checked by reading both diffs. AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7127578090 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/615#issuecomment-7127578090). Originally posted by [Exorion1er](https://github.com/Exorion1er) on 2026-11-24T09:33:28Z. --- #695 fixes the same issue (#610) for `VICTORY_D3D12_WARP` only. Its branch also carries a workspace-wide `cargo fmt` commit (37 files) and an unrelated speech commit, so it conflicts with `main` and with much else. This PR fixes `=0` for all six switches and merges cleanly. One thing to know: it also makes `=0` mean off for the other five switches, which is wider than #610 asked for (probably what everyone wants, but it's a behaviour change). Checked by reading both diffs. AI-assisted (Claude Code).
mercuryVM commented 2026-11-24 12:04:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T11:20:39Z.

Review: APPROVED


Tested a4974e4 on Windows 11, RTX 5070, MSVC: cargo test -p victory-gpu -- --test-threads=1 47 passed, including the four switch tests. With --features diagnostics, 49 passed. Clippy's 1 warning is the existing one in host.rs.

  • One switch::on predicate for all six switches is better than fixing VICTORY_D3D12_WARP alone. It keeps every documented =1 usage working and only changes 0.
  • Overlap: #695 fixes the same VICTORY_D3D12_WARP=0 case with its own warp_selected_at. Whichever lands second should call switch::on instead of keeping two predicates.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6038284250 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/615#pullrequestreview-6038284250). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T11:20:39Z. **Review:** APPROVED --- Tested a4974e4 on Windows 11, RTX 5070, MSVC: `cargo test -p victory-gpu -- --test-threads=1` 47 passed, including the four `switch` tests. With `--features diagnostics`, 49 passed. Clippy's 1 warning is the existing one in host.rs. - One `switch::on` predicate for all six switches is better than fixing `VICTORY_D3D12_WARP` alone. It keeps every documented `=1` usage working and only changes `0`. - Overlap: #695 fixes the same `VICTORY_D3D12_WARP=0` case with its own `warp_selected_at`. Whichever lands second should call `switch::on` instead of keeping two predicates. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 01:04:28 +00:00
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!615
No description provided.