Loader: committed and target textures take their XG console size #20

Manually merged
github merged 2 commits from gh-pr/20/head into gh-pr/20/base 2026-11-27 03:14:02 +00:00
Owner

@⁠Sr-0w on GitHub · 2026-11-25 05:36 UTC · original
Sr-0w:loader/committed-console-size → main · +114 −10 · 4 files · 2 commits · merged 2026-11-25 08:06 UTC

What changed

GetResourceAllocationInfo1 (slot 108), and the committed path, answer XG's console size for two more kinds of texture, as they already do for console-layout and streamed textures:

  1. Committed textures take their console size from the title's memory (TryCommittedTextureSize). 0x14247ad10 creates two 3840x2160 RGBA8 targets from a 64 MiB region and breaks unless they fill all but 2 MiB of it. An RDNA3 desktop driver asks 0x2010000 bytes for each, which overruns the region.
  2. Single-sample render, depth and UAV textures without a layout (ConsoleAllocationSizes.IsConsoleSized). The game places them in its 2.2 GiB graphics heap at the size slot 108 answers (0x140abfad0), while the shim backs them with desktop textures of their own. The desktop size therefore only takes heap.

Why

On an RX 7800 XT the driver adds its compression metadata: 0x1330000 bytes for a 2560x1440 D16S8 depth target, where XG gives 0xb40000. Over the boot, the 15,383 target queries totalled 21,786 MB desktop against 21,353 MB XG. The heap (allocator object 0x1471c2808, used bytes at +0x58) held 2050 MB of 2199 MB after boot. About 3 minutes in, a 46 MiB request failed into the allocator's fatal path (int3 at 0x142219650).

Buffers, multisampled textures and queries that mix kinds keep the desktop answer.

How I checked

  • dotnet test: Loader 208 passed (18 skipped), Architecture 30 passed. ConsoleAllocationSizesTests gains the 2560x1440 depth target (0xb40000), and a render target now gets the same size as its committed form. A 4x MSAA target still keeps the desktop answer.
  • In game on the RX 7800 XT, driver 32.0.32029.2010: the heap took the 104 MB story-load allocation at 172 s (2050 → 2154 MB) where it failed before. The run went on through the opening cards and credits for 15 minutes, 16,046 presents, no fault.
  • docs/d3d12x-shim.md (Allocation info) describes both cases.

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-25 05:36 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/20) `Sr-0w:loader/committed-console-size` → `main` · +114 −10 · 4 files · 2 commits · merged 2026-11-25 08:06 UTC ## What changed `GetResourceAllocationInfo1` (slot 108), and the committed path, answer XG's console size for two more kinds of texture, as they already do for console-layout and streamed textures: 1. **Committed textures** take their console size from the title's memory (`TryCommittedTextureSize`). 0x14247ad10 creates two 3840x2160 RGBA8 targets from a 64 MiB region and breaks unless they fill all but 2 MiB of it. An RDNA3 desktop driver asks 0x2010000 bytes for each, which overruns the region. 2. **Single-sample render, depth and UAV textures without a layout** (`ConsoleAllocationSizes.IsConsoleSized`). The game places them in its 2.2 GiB graphics heap at the size slot 108 answers (0x140abfad0), while the shim backs them with desktop textures of their own. The desktop size therefore only takes heap. ## Why On an RX 7800 XT the driver adds its compression metadata: 0x1330000 bytes for a 2560x1440 D16S8 depth target, where XG gives 0xb40000. Over the boot, the 15,383 target queries totalled 21,786 MB desktop against 21,353 MB XG. The heap (allocator object 0x1471c2808, used bytes at +0x58) held 2050 MB of 2199 MB after boot. About 3 minutes in, a 46 MiB request failed into the allocator's fatal path (int3 at 0x142219650). Buffers, multisampled textures and queries that mix kinds keep the desktop answer. ## How I checked - `dotnet test`: Loader 208 passed (18 skipped), Architecture 30 passed. `ConsoleAllocationSizesTests` gains the 2560x1440 depth target (0xb40000), and a render target now gets the same size as its committed form. A 4x MSAA target still keeps the desktop answer. - In game on the RX 7800 XT, driver 32.0.32029.2010: the heap took the 104 MB story-load allocation at 172 s (2050 → 2154 MB) where it failed before. The run went on through the opening cards and credits for 15 minutes, 16,046 presents, no fault. - `docs/d3d12x-shim.md` (Allocation info) describes both cases. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The game hands its two 3840x2160 render targets a 64 MiB region through its XMemAlloc hook and breaks at 0x1456a2afd when they overrun it. The shim sized that allocation with the desktop driver's answer, which an RDNA3 card pads to 0x2010000 bytes per target. Textures now take their XG console size (0x1fe0000 for those targets); buffers keep the desktop size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SKtJsfjasPuTLtS3mEXFru
Slot 108 now answers XG's size for single-sample render targets, depth targets and UAV textures without a layout, as for console-layout textures. The game places them in its 2.2 GiB graphics heap at that size (0x140abfad0) while the shim backs them with desktop textures of their own, so the desktop size only took heap: an RX 7800 XT adds its compression metadata (0x1330000 bytes for a 2560x1440 D16S8 depth target where XG gives 0xb40000). With the desktop sizes the heap held 2050 MB of 2199 MB after boot and the story load stopped on a 46 MiB request in the allocator's fatal path (0x142219650).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SKtJsfjasPuTLtS3mEXFru
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:14:01 +00:00
github manually merged commit a5e1f25bdc into gh-pr/20/base 2026-11-27 03:14:02 +00:00
Author
Owner

@⁠ThatRecompDev on GitHub · 2026-11-25 08:08 UTC · original

merged, thanks for digging into this, the 7800 XT numbers make it really clear. checked that nothing on our side writes into those allocations, render/depth targets get their own desktop textures, so the smaller XG size can't get overrun

**@⁠ThatRecompDev** on GitHub · 2026-11-25 08:08 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/20#issuecomment-7156649820) merged, thanks for digging into this, the 7800 XT numbers make it really clear. checked that nothing on our side writes into those allocations, render/depth targets get their own desktop textures, so the smaller XG size can't get overrun
This discussion has been locked. Commenting is limited to contributors.
No description provided.