Skip to content

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

Open
Sr-0w wants to merge 2 commits into
ThatRecompDev:mainfrom
Sr-0w:loader/committed-console-size
Open

Sr-0w wants to merge 2 commits into
ThatRecompDev:mainfrom
Sr-0w:loader/committed-console-size

Conversation

@Sr-0w

@Sr-0w Sr-0w commented Nov 25, 2026

Copy link
Copy Markdown

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.ai/code/session_01SKtJsfjasPuTLtS3mEXFru

Sr-0w and others added 2 commits November 25, 2026 06:34
…emory

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKtJsfjasPuTLtS3mEXFru
…on info

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKtJsfjasPuTLtS3mEXFru
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.

1 participant