GPU: MakeResident succeeds, as the console's memory is always resident #1563

Open
LouisRiverstone wants to merge 1 commit from upstream-pr/1564 into main
LouisRiverstone commented 2026-11-24 19:12:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LouisRiverstone on 2026-11-24T19:12:45Z.


ID3D12Device::MakeResident (slot 34, 0x110) was one of the device slots that log "method not implemented" and return E_NOTIMPL. Title memory here is always resident, so there is nothing to make resident: the slot now returns S_OK through object::ignore, as the debug-only slots do.

New test make_resident_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 make_resident (Windows). I type-checked it with clippy for x86_64-pc-windows-msvc, but could not run it locally.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6589432282 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1564). Originally posted by [LouisRiverstone](https://github.com/LouisRiverstone) on 2026-11-24T19:12:45Z. --- `ID3D12Device::MakeResident` (slot 34, 0x110) was one of the device slots that log "method not implemented" and return `E_NOTIMPL`. Title memory here is always resident, so there is nothing to make resident: the slot now returns `S_OK` through `object::ignore`, as the debug-only slots do. New test `make_resident_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 make_resident` (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)
DenRakEiw commented 2026-11-24 20:02:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T19:30:39Z.

Review: APPROVED


Verified locally merged onto origin/main (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu — 51 passed, 0 failed (1 ignored) on both RTX 5090 hardware and VICTORY_D3D12_WARP=1 (including make_resident_succeeds_without_doing_anything)
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok

Clean MakeResident no-op returning S_OK with unit test coverage. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6045959119 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1564#pullrequestreview-6045959119). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T19:30:39Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu` — 51 passed, 0 failed (1 ignored) on both RTX 5090 hardware and `VICTORY_D3D12_WARP=1` (including `make_resident_succeeds_without_doing_anything`) - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok Clean `MakeResident` no-op returning `S_OK` with unit test coverage. Looks good. AI-assisted (Gemini 4 Neon).
pfhandler commented 2026-11-24 21:03:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pfhandler on 2026-11-24T20:50:50Z.


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;
             }
<!-- greyfinch-sync:Marvisak/VIctory:comment:7144135429 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1564#issuecomment-7144135429). Originally posted by [pfhandler](https://github.com/pfhandler) on 2026-11-24T20:50:50Z. --- 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; } ```
Marvisak commented 2026-11-25 04:06:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:17:04Z.


Automated triage for the maintainers.

Needs work. Slot 34 (0x110) is MakeResident 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. #1565 and #1566 make the same kind of change for slots 35 and 40, and could be one pull request.

CI: no check runs reported for this head.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7151768783 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1564#issuecomment-7151768783). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T03:17:04Z. --- <!-- victory-triage v1 head=2c91c3d5f46a9454393056cb4ecf719206e4b523 verdict=needs-work at=2026-11-25T03:17:30Z --> Automated triage for the maintainers. **Needs work.** Slot 34 (0x110) is `MakeResident` 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. #1565 and #1566 make the same kind of change for slots 35 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 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/1564:upstream-pr/1564'
git switch 'upstream-pr/1564'

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/1564'
git switch 'upstream-pr/1564'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1564'
git switch 'upstream-pr/1564'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1564'
git switch 'main'
git merge --squash 'upstream-pr/1564'
git switch 'main'
git merge --ff-only 'upstream-pr/1564'
git switch 'main'
git merge 'upstream-pr/1564'
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
Marvisak/VIctory!1563
No description provided.