Skip to content

GPU: load the DirectX 12 Agility SDK, and map the console's packed 16… - #968

Closed
bailu12300 wants to merge 1 commit into
Marvisak:mainfrom
bailu12300:win10-agility-sdk-and-packed-formats
Closed

bailu12300 wants to merge 1 commit into
Marvisak:mainfrom
bailu12300:win10-agility-sdk-and-packed-formats

Conversation

@bailu12300

Copy link
Copy Markdown

…-bit colour targets

  • Export D3D12SDKVersion/D3D12SDKPath and link them into the binary's export table (build.rs), so the D3D12 runtime loads D3D12Core.dll from ./D3D12/ instead of the in-box copy. Windows 10's 19041 runtime refuses the title's 0xC01 root signatures (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED | ALLOW_INPUT_ASSEMBLER), which cost every pipeline: drawn=0, no pipeline ever created, and a 0xC0000005 fault about 5 s in. With Agility 1.614 the same host builds the full pipeline set and holds 30 fps through the account picker, the startup art and the legal notice.

  • pc_format: map 86 (B5G5R5A1_UNORM) and 115 (B4G4R4A4_UNORM) to R8G8B8A8_UNORM. Both are render targets on the console but take no unordered access (86) and no render target at all (115) on the host, so the title's UI composition targets failed to create ("no host texture error 0x80070057", format: 86 and 115) and the whole UI layer drew nothing. Their 8-bit RGBA stand-in is a superset of both in range, so a target that only carries colour through the pipeline loses nothing but the packing.

Verified on Windows 10 Pro 19045, RTX 5060 8 GB, title 1.0.2.1: no host texture count 0, menus at 30 fps, and the prologue title card renders.

…-bit colour targets

- Export D3D12SDKVersion/D3D12SDKPath and link them into the binary's export
  table (build.rs), so the D3D12 runtime loads D3D12Core.dll from ./D3D12/
  instead of the in-box copy. Windows 10's 19041 runtime refuses the title's
  0xC01 root signatures (CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED |
  SAMPLER_HEAP_DIRECTLY_INDEXED | ALLOW_INPUT_ASSEMBLER), which cost every
  pipeline: drawn=0, no pipeline ever created, and a 0xC0000005 fault about
  5 s in. With Agility 1.614 the same host builds the full pipeline set and
  holds 30 fps through the account picker, the startup art and the legal
  notice.

- pc_format: map 86 (B5G5R5A1_UNORM) and 115 (B4G4R4A4_UNORM) to
  R8G8B8A8_UNORM. Both are render targets on the console but take no
  unordered access (86) and no render target at all (115) on the host, so
  the title's UI composition targets failed to create ("no host texture
  error 0x80070057", format: 86 and 115) and the whole UI layer drew
  nothing. Their 8-bit RGBA stand-in is a superset of both in range, so a
  target that only carries colour through the pipeline loses nothing but
  the packing.

Verified on Windows 10 Pro 19045, RTX 5060 8 GB, title 1.0.2.1:
no host texture count 0, menus at 30 fps, and the prologue title card renders.
@Zipettte

Copy link
Copy Markdown

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 3411406: cargo test -p victory -p victory-gpu passes, 51 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

@giusepperainone

Copy link
Copy Markdown
Contributor

Test report on a second NVIDIA card and Windows 11 (no Agility folder present).

Setup: Windows 11 Pro 26200, RTX 4060 Ti (driver 32.0.16.1088), Rust 1.98.1, diagnostics build of ffe310e vs ffe310e + this PR (3411406, fast-forward). The same automated run on both: start, sit on the account screen for 70 s with fixed captured frames, close the window.

Host support, queried with CheckFeatureSupport / CreateCommittedResource on this GPU:

format render target typed UAV
86 B5G5R5A1_UNORM yes no (RT+UAV and UAV-only creation fail with E_INVALIDARG)
115 B4G4R4A4_UNORM no no (created fine without flags)

WARP takes both formats with every use, so these failures are hardware-specific.

Packed 16-bit textures the title creates up to the account screen (logged locally in host_texture): three, all render targets, none title-written:

format flags size
86 1 (RT) 1024×4096
86 5 (RT+UAV) 2560×1440
115 1 (RT) 2560×1440

Results:

ffe310e + this PR
no host texture 2 (the 86 RT+UAV and the 115 RT) 0
frame rate 30 fps 30 fps
captured frames 1-1800 pixel-identical to ffe310e
device creation without a D3D12\ folder beside the exe fine (falls back to the in-box runtime)

The identical frames are expected on this screen; the targets matter later (#797).

One concern: pc_format maps 86 and 115 to R8G8B8A8_UNORM for every texture, not only for the uses the host refuses. A sampled (title-written) 86/115 texture would then get a 4-byte-per-texel host copy, while Staging::detile writes the console's 2-byte texels into the host footprint pitch (texture.rs, staging / detile), so its contents would come out wrong. None appeared on these screens, so this run can't show it either way, but the substitution may be safer only where the host refuses the format for the requested flags (e.g. checked once with D3D12_FEATURE_FORMAT_SUPPORT), leaving sampled textures and hosts that support the formats (WARP, and possibly AMD) on the native format.

@giusepperainone

Copy link
Copy Markdown
Contributor

Follow-up to my test report above: with this PR on the same machine (RTX 4060 Ti, Windows 11), the prologue cutscene is still black (audio and credits only), matching the #89 results on RTX 3060 / 4070 SUPER in #797. So these two targets are not what keeps it black; my earlier note that they "matter later (#797)" was wrong on that point. The no host texture failures are still gone (0 vs 2).

@Marvisak

Copy link
Copy Markdown
Owner

Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #463. Two unrelated changes in one PR: an unconditional Agility SDK export through a new build.rs and a static mut (same goal as #463, which only opts in when the DLL is there), and a blanket mapping of console formats 86 and 115 to RGBA8 in victory-gpu, which changes texel size for every use and is done conditionally by #89/#581.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants