GPU: Evict succeeds, as the console's memory is never evicted #1565

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

@⁠LouisRiverstone on GitHub · 2026-11-24 19:12 UTC · original
LouisRiverstone:gpu/device-evict → main · +9 −0 · 1 files · 1 commits · open

ID3D12Device::Evict (slot 35, 0x118) was one of the device slots that log "method not implemented" and return E_NOTIMPL. Title memory is never evicted here, so the slot now returns S_OK through object::ignore, as the debug-only slots do.

New test evict_succeeds_without_doing_anything calls it through the device table.

No title has been seen calling it in the logs in the issues; this is the PC device method in its PC slot, so a title that does call it gets what the console's unified memory gives it rather than a logged failure. If that is not wanted, close this.

Verify: cargo test -p victory-gpu evict (Windows). I type-checked it with clippy for x86_64-pc-windows-msvc, but could not run it locally.

🤖 Generated with Claude Code

**@⁠LouisRiverstone** on GitHub · 2026-11-24 19:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/1565) `LouisRiverstone:gpu/device-evict` → `main` · +9 −0 · 1 files · 1 commits · open `ID3D12Device::Evict` (slot 35, 0x118) was one of the device slots that log "method not implemented" and return `E_NOTIMPL`. Title memory is never evicted here, so the slot now returns `S_OK` through `object::ignore`, as the debug-only slots do. New test `evict_succeeds_without_doing_anything` calls it through the device table. No title has been seen calling it in the logs in the issues; this is the PC device method in its PC slot, so a title that does call it gets what the console's unified memory gives it rather than a logged failure. If that is not wanted, close this. **Verify:** `cargo test -p victory-gpu evict` (Windows). I type-checked it with clippy for `x86_64-pc-windows-msvc`, but could not run it locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:36:39 +00:00
Author
Owner

@⁠pfhandler on GitHub · 2026-11-24 20:50 UTC · original

Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB):

  • VICTORY_NO_HOST_PAD=1 — a connected host pad (e.g. DualShock appearing as XInput pad 0) keeps the keyboard stand-in pad from being enumerated. Hiding the host pad lets VICTORY_KEYS drive the title again.
  • VICTORY_MODE=1920x1080 — the DXGI output mode list is fixed at the console's 3840x2160. Reporting 1920x1080 instead keeps the title's render targets and VRAM use down on smaller hosts (Series S profile + 1080p settled around 3.5 GB VRAM here).

Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above.

diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs
index c7f7c45..2535b68 100644
--- a/crates/victory-gpu/src/dxgi.rs
+++ b/crates/victory-gpu/src/dxgi.rs
@@ -219,6 +219,19 @@ struct Mode {
 }
 const _: () = assert!(size_of::<Mode>() == 32);
 
+/// The console's fixed output mode, overridable for hosts smaller than the
+/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead.
+fn mode_size() -> (u32, u32) {
+    const DEFAULT: (u32, u32) = (3840, 2160);
+    let Some(text) = std::env::var_os("VICTORY_MODE") else {
+        return DEFAULT;
+    };
+    let text = text.to_string_lossy();
+    text.split_once('x')
+        .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?)))
+        .unwrap_or(DEFAULT)
+}
+
 /// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks
 /// for a 120 Hz one to allow 120 Hz frame intervals).
 /// shortcut: fixed mode, not the host display's; report the host's rates if
@@ -242,9 +255,10 @@ extern "system" fn modes(
         return MORE_DATA;
     }
     *count = 1;
+    let (width, height) = mode_size();
     let mode = Mode {
-        width: 3840,
-        height: 2160,
+        width,
+        height,
         refresh: [60, 1],
         format: 0,
         scanlines: 1, // progressive
diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs
index a411bd0..da8d66c 100644
--- a/crates/victory-hle/src/modules/gameinput.rs
+++ b/crates/victory-hle/src/modules/gameinput.rs
@@ -1134,6 +1134,11 @@ mod host {
 
     impl Source for Host {
         fn pad(&mut self, slot: usize) -> Option<PadState> {
+            // The keyboard stand-in pad only exists while no host pad is
+            // connected; this hides a host pad the title mis-handles.
+            if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() {
+                return None;
+            }
             if self.empty_until[slot].is_some_and(|until| Instant::now() < until) {
                 return None;
             }
**@⁠pfhandler** on GitHub · 2026-11-24 20:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/1565#issuecomment-7144133268) Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB): - `VICTORY_NO_HOST_PAD=1` — a connected host pad (e.g. DualShock appearing as XInput pad 0) keeps the keyboard stand-in pad from being enumerated. Hiding the host pad lets `VICTORY_KEYS` drive the title again. - `VICTORY_MODE=1920x1080` — the DXGI output mode list is fixed at the console's 3840x2160. Reporting 1920x1080 instead keeps the title's render targets and VRAM use down on smaller hosts (Series S profile + 1080p settled around 3.5 GB VRAM here). Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above. ```diff diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs index c7f7c45..2535b68 100644 --- a/crates/victory-gpu/src/dxgi.rs +++ b/crates/victory-gpu/src/dxgi.rs @@ -219,6 +219,19 @@ struct Mode { } const _: () = assert!(size_of::<Mode>() == 32); +/// The console's fixed output mode, overridable for hosts smaller than the +/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead. +fn mode_size() -> (u32, u32) { + const DEFAULT: (u32, u32) = (3840, 2160); + let Some(text) = std::env::var_os("VICTORY_MODE") else { + return DEFAULT; + }; + let text = text.to_string_lossy(); + text.split_once('x') + .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?))) + .unwrap_or(DEFAULT) +} + /// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks /// for a 120 Hz one to allow 120 Hz frame intervals). /// shortcut: fixed mode, not the host display's; report the host's rates if @@ -242,9 +255,10 @@ extern "system" fn modes( return MORE_DATA; } *count = 1; + let (width, height) = mode_size(); let mode = Mode { - width: 3840, - height: 2160, + width, + height, refresh: [60, 1], format: 0, scanlines: 1, // progressive diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs index a411bd0..da8d66c 100644 --- a/crates/victory-hle/src/modules/gameinput.rs +++ b/crates/victory-hle/src/modules/gameinput.rs @@ -1134,6 +1134,11 @@ mod host { impl Source for Host { fn pad(&mut self, slot: usize) -> Option<PadState> { + // The keyboard stand-in pad only exists while no host pad is + // connected; this hides a host pad the title mis-handles. + if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() { + return None; + } if self.empty_until[slot].is_some_and(|until| Instant::now() < until) { return None; } ```
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 03:17 UTC · original

Automated triage for the maintainers.

Needs work. Slot 35 (0x118) is Evict in the device table in crates/victory-gpu/src/device.rs, and object::ignore returning S_OK is a reasonable answer for it. But this changes a runtime return value with no evidence that the title ever calls it: the description says no log shows a call. Today the slot logs "method not implemented", which is the signal the project relies on to find methods worth writing. Please add evidence that the title reaches this slot (a log line from a run, or the call site in the title's code); with that, this would be a merge candidate. #1564 and #1566 make the same kind of change for slots 34 and 40, and could be one pull request.

CI: no check runs reported for this head.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 03:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/1565#issuecomment-7151771207) <!-- victory-triage v1 head=75d00a545b400d595669d024f6ec30ece68c930c verdict=needs-work at=2026-11-25T03:18:10Z --> Automated triage for the maintainers. **Needs work.** Slot 35 (0x118) is `Evict` in the device table in `crates/victory-gpu/src/device.rs`, and `object::ignore` returning `S_OK` is a reasonable answer for it. But this changes a runtime return value with no evidence that the title ever calls it: the description says no log shows a call. Today the slot logs "method not implemented", which is the signal the project relies on to find methods worth writing. Please add evidence that the title reaches this slot (a log line from a run, or the call site in the title's code); with that, this would be a merge candidate. #1564 and #1566 make the same kind of change for slots 34 and 40, and could be one pull request. CI: no check runs reported for this head. --- _Generated by [Claude Code](https://claude.ai/code)_
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/1565/head:github-bot/gh-1565'
git switch 'github-bot/gh-1565'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1565'
git switch 'github-bot/gh-1565'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1565'
git switch 'github-bot/gh-1565'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1565'
git switch 'main'
git merge --squash 'github-bot/gh-1565'
git switch 'main'
git merge --ff-only 'github-bot/gh-1565'
git switch 'main'
git merge 'github-bot/gh-1565'
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/Marvisak--VIctory!1565
No description provided.