Console API conformance: runtime, GPU, DirectStorage, XG, XMem and audio calls the title makes #1510

Merged
capibawa merged 70 commits from upstream-pr/1510 into main 2026-11-29 08:16:56 +00:00
capibawa commented 2026-11-28 21:03:11 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by capibawa on 2026-11-28T21:03:11Z.


What

70 commits that answer the console calls the title makes, but which still failed, crashed or returned placeholders. Each commit is one fix and explains itself in its message.

What players notice

  • In-game screenshots: XAppCaptureTakeScreenshot now saves the next presented frame as a PNG under the title's data folder (screenshots/photo-<secs>-<n>.png) and fills in its result. main still refuses screenshots as if capture were unavailable.
  • FidelityFX and DLSS:
    • The FidelityFX path is patched in only at the sizes the title's FSR4 supports. At other sizes the title divided by zero at its first upscaling: DLSS frame generation on its own, VICTORY_FSR_PATH on Series X, or a Series S scene other than 720p/1080p without DLSS.
    • When DLSS refuses an upscaling, a plain bilinear upscaling runs in its place. Before, nothing ran and the picture froze or showed a stale frame.
    • An upscale description chained behind another one is found, so DLSS takes it.
  • Skipped Bink movies (VICTORY_SKIP_BINK): a skipped movie is paused, so its soundtrack no longer plays on. A title copying a skipped movie's frame no longer gets undecoded garbage. A movie whose layout isn't the known one is left alone instead of being written to.
  • Dynamic resolution: a present that shows only part of its texture (for example 1280x720 of a 1920x1080 texture) shows that part in its place on the screen, not the whole texture.
  • GPU ordering:
    • A wait that reaches into the next frame (async compute waiting on the next frame's graphics) is kept across one present, not broken every frame with its work run out of order.
    • A blocking fence wait now waits until the value is reached instead of failing, which a title could take as a lost device.
  • Audio:
    • XAudio2 voices playing XMA2, which the host's XAudio2 refuses, are decoded, so titles using XAudio2 with XMA2 banks are no longer silent or failing audio setup.
    • The click at the seam between chained XMA contexts is gone.
  • System pages offline: the message dialog and error dialog appear as host dialogs with the title's buttons. Achievements, invites, the player picker and similar pages close at once as they would offline, instead of failing.
  • Saves: XGameSaveFiles gets a folder of its own beside the container saves.
  • Other:
    • The title sees its own command line, not victory play ….
    • Its memory figures match the console's budget instead of the PC's RAM.
    • A dual-stack socket bound to all interfaces hears IPv4 loopback, so local tools can reach it.

All changes

  • Runtime (XGameRuntime): the method tables are padded to the last slot the title's runtime stubs call. The error, activation and pending-invite areas are served. XUser, XGameUI, XPackage, XNetworking, XStore and XGameSave answer as an offline console. QueryApiImpl refuses a null out pointer. Struct layout tests cover what titles share with us.
  • GPU device, lists and queues:
    • Feature queries past the first five; format support is the host device's.
    • Both queue tables reach their last slot, and every GPU method table checks its length at compile time.
    • SuspendX, ResumeX and GetClockCalibration.
    • ID3D12Device9 and ID3D12Device10 answer as the device.
    • Event-less fence waits block until the value is reached.
    • Each plane's source rectangle is shown in its place on the screen.
    • UAV clears, logging for the depth order, shading rate and sample mask the host does not apply, and loading of the compute pipelines the console serialized, which is opt-in (VICTORY_DESERIALIZE_COMPUTE=1): loaded by default, they left the scene grey (see Tests).
  • DirectStorage: the whole queue interface and its options, file handles, the older factory ids, and per-queue error events with the full error record.
  • XG: size, alignment, mip offsets, 64 KiB layouts, buffer and depth-stencil layouts, GetTexelCoordinate and GetSwizzlePatternInfo.
  • XMem: graphics memory types get title graphics memory, XMEM_2MB_ALIGN, the longer working-set statistics, the title's figures in GlobalMemoryStatusEx, and the heap, hysteresis, option and write-watch exports.
  • Audio: XMA2 source voices in XAudio2, XMA contexts chained through their overlap buffer, the xapu rate converter, ApuHeapGetState, and the convolution ramp.
  • Kernel, files, media, net:
    • The title's command line, in the ANSI code page too.
    • Title DLL lookups through GetProcAddress and GetModuleHandleEx.
    • Path translation in Media Foundation.
    • The rest of the path-taking file API.
    • XCurl served offline, and a dual-stack bind hears IPv4 loopback.
  • Bink and FidelityFX: skipped movies pause and stay out of title memory. The FidelityFX patch applies only at sizes the title's FSR4 takes, and a plain upscaling is used where DLSS takes none.

Rebased onto main

main had independently fixed some of the same things, so those overlaps were merged feature by feature rather than hunk by hunk. Each affected commit says what it kept from each side.

  • XOR swizzle addressing: this branch's version is dropped. Both implementations give identical addresses for every element of 3,150 layouts (both consoles, every mode, element size, 2D, array and 3D, every mip), so main's stays.
  • DirectStorage: this branch's queue replaces the one on main. main's QueryInterface, padded tables, off-the-frame worker placement and fence-signal thread are kept. The signal thread also fixes this branch signalling fences under the scheduler's lock.
  • Blocking fence wait: this branch's version replaces main's. It forces held work after 250 ms instead of 2 s, wakes the behind line when that is on, and keeps the VICTORY_FENCE_WAIT_MS limit.
  • XStore and XGameSave: main's blocking save calls and store catalog, licence and add-on calls are kept. This branch adds only the calls main lacks.
  • Presenting: main's shadow lift and movie flag are combined with this branch's per-plane placement. The lift is the composer's last root constant.

This also covers the queue and device table parts of #1409: the 38-slot queue tables, SuspendX/ResumeX, and ID3D12Device9/10.

Tests

  • cargo test --workspace: every suite passes except xtask's repository_passes_policy. That fails on main too: crates/victory-shader/src/emit/lower.rs is over the 640 KiB limit, and this branch does not touch it.
  • cargo clippy --workspace --all-targets (with and without --all-features): no warnings from this branch's code. main still has 12 warning sites, which -D warnings in CI will report.
  • In the game, on this rebased branch: RTX 5070 Ti (driver 617.42), Windows 11 26300, Series X profile, 1440p, DLSS quality.
    • Before the last commit: the scene was grey behind the interface and subtitles. 350 compute shaders did not translate, and 400 to 1,000 draws a frame were dropped. A bisect against main (which shows the scene) found the commit that loads the console's cached compute pipelines. Many of the title's own compute passes came in as console code the translator does not take.
    • After: with that loading opt-in, the scene shows, as on main.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5544548349 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1510). Originally posted by [capibawa](https://github.com/capibawa) on 2026-11-28T21:03:11Z. --- ## What 70 commits that answer the console calls the title makes, but which still failed, crashed or returned placeholders. Each commit is one fix and explains itself in its message. ### What players notice - **In-game screenshots:** `XAppCaptureTakeScreenshot` now saves the next presented frame as a PNG under the title's data folder (`screenshots/photo-<secs>-<n>.png`) and fills in its result. `main` still refuses screenshots as if capture were unavailable. - **FidelityFX and DLSS:** - The FidelityFX path is patched in only at the sizes the title's FSR4 supports. At other sizes the title divided by zero at its first upscaling: DLSS frame generation on its own, `VICTORY_FSR_PATH` on Series X, or a Series S scene other than 720p/1080p without DLSS. - When DLSS refuses an upscaling, a plain bilinear upscaling runs in its place. Before, nothing ran and the picture froze or showed a stale frame. - An upscale description chained behind another one is found, so DLSS takes it. - **Skipped Bink movies (`VICTORY_SKIP_BINK`):** a skipped movie is paused, so its soundtrack no longer plays on. A title copying a skipped movie's frame no longer gets undecoded garbage. A movie whose layout isn't the known one is left alone instead of being written to. - **Dynamic resolution:** a present that shows only part of its texture (for example 1280x720 of a 1920x1080 texture) shows that part in its place on the screen, not the whole texture. - **GPU ordering:** - A wait that reaches into the next frame (async compute waiting on the next frame's graphics) is kept across one present, not broken every frame with its work run out of order. - A blocking fence wait now waits until the value is reached instead of failing, which a title could take as a lost device. - **Audio:** - XAudio2 voices playing XMA2, which the host's XAudio2 refuses, are decoded, so titles using XAudio2 with XMA2 banks are no longer silent or failing audio setup. - The click at the seam between chained XMA contexts is gone. - **System pages offline:** the message dialog and error dialog appear as host dialogs with the title's buttons. Achievements, invites, the player picker and similar pages close at once as they would offline, instead of failing. - **Saves:** `XGameSaveFiles` gets a folder of its own beside the container saves. - **Other:** - The title sees its own command line, not `victory play …`. - Its memory figures match the console's budget instead of the PC's RAM. - A dual-stack socket bound to all interfaces hears IPv4 loopback, so local tools can reach it. ### All changes - **Runtime (XGameRuntime):** the method tables are padded to the last slot the title's runtime stubs call. The error, activation and pending-invite areas are served. XUser, XGameUI, XPackage, XNetworking, XStore and XGameSave answer as an offline console. `QueryApiImpl` refuses a null out pointer. Struct layout tests cover what titles share with us. - **GPU device, lists and queues:** - Feature queries past the first five; format support is the host device's. - Both queue tables reach their last slot, and every GPU method table checks its length at compile time. - `SuspendX`, `ResumeX` and `GetClockCalibration`. - `ID3D12Device9` and `ID3D12Device10` answer as the device. - Event-less fence waits block until the value is reached. - Each plane's source rectangle is shown in its place on the screen. - UAV clears, logging for the depth order, shading rate and sample mask the host does not apply, and loading of the compute pipelines the console serialized, which is opt-in (`VICTORY_DESERIALIZE_COMPUTE=1`): loaded by default, they left the scene grey (see Tests). - **DirectStorage:** the whole queue interface and its options, file handles, the older factory ids, and per-queue error events with the full error record. - **XG:** size, alignment, mip offsets, 64 KiB layouts, buffer and depth-stencil layouts, `GetTexelCoordinate` and `GetSwizzlePatternInfo`. - **XMem:** graphics memory types get title graphics memory, `XMEM_2MB_ALIGN`, the longer working-set statistics, the title's figures in `GlobalMemoryStatusEx`, and the heap, hysteresis, option and write-watch exports. - **Audio:** XMA2 source voices in XAudio2, XMA contexts chained through their overlap buffer, the xapu rate converter, `ApuHeapGetState`, and the convolution ramp. - **Kernel, files, media, net:** - The title's command line, in the ANSI code page too. - Title DLL lookups through `GetProcAddress` and `GetModuleHandleEx`. - Path translation in Media Foundation. - The rest of the path-taking file API. - XCurl served offline, and a dual-stack bind hears IPv4 loopback. - **Bink and FidelityFX:** skipped movies pause and stay out of title memory. The FidelityFX patch applies only at sizes the title's FSR4 takes, and a plain upscaling is used where DLSS takes none. ## Rebased onto main `main` had independently fixed some of the same things, so those overlaps were merged feature by feature rather than hunk by hunk. Each affected commit says what it kept from each side. - **XOR swizzle addressing:** this branch's version is dropped. Both implementations give identical addresses for every element of 3,150 layouts (both consoles, every mode, element size, 2D, array and 3D, every mip), so `main`'s stays. - **DirectStorage:** this branch's queue replaces the one on `main`. `main`'s QueryInterface, padded tables, off-the-frame worker placement and fence-signal thread are kept. The signal thread also fixes this branch signalling fences under the scheduler's lock. - **Blocking fence wait:** this branch's version replaces `main`'s. It forces held work after 250 ms instead of 2 s, wakes the behind line when that is on, and keeps the `VICTORY_FENCE_WAIT_MS` limit. - **XStore and XGameSave:** `main`'s blocking save calls and store catalog, licence and add-on calls are kept. This branch adds only the calls `main` lacks. - **Presenting:** `main`'s shadow lift and movie flag are combined with this branch's per-plane placement. The lift is the composer's last root constant. This also covers the queue and device table parts of #1409: the 38-slot queue tables, `SuspendX`/`ResumeX`, and `ID3D12Device9`/`10`. ## Tests - `cargo test --workspace`: every suite passes except `xtask`'s `repository_passes_policy`. That fails on `main` too: `crates/victory-shader/src/emit/lower.rs` is over the 640 KiB limit, and this branch does not touch it. - `cargo clippy --workspace --all-targets` (with and without `--all-features`): no warnings from this branch's code. `main` still has 12 warning sites, which `-D warnings` in CI will report. - In the game, on this rebased branch: RTX 5070 Ti (driver 617.42), Windows 11 26300, Series X profile, 1440p, DLSS quality. - **Before the last commit:** the scene was grey behind the interface and subtitles. 350 compute shaders did not translate, and 400 to 1,000 draws a frame were dropped. A bisect against `main` (which shows the scene) found the commit that loads the console's cached compute pipelines. Many of the title's own compute passes came in as console code the translator does not take. - **After:** with that loading opt-in, the scene shows, as on `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
trustno1-coder/VIctory-NVIDIA!1510
No description provided.