[PR #971] [CLOSED] d3d12_xs: GetResourceAllocationInfo answers streamed textures with their console size (RT-ALLOC-INFO-CONSOLE) #1008

Closed
opened 2026-11-26 20:19:47 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/971
Author: @DadaCap
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: alloc-info-console


📝 Commits (4)

  • 77f44fb xg_xs: lay out console textures and serve the texture computer (RT-XG-TEXTURE-COMPUTER)
  • a84d387 Merge commit 'refs/boot/pr461n' into alloc-info-console
  • 9f89522 d3d12_xs: GetResourceAllocationInfo answers streamed textures with their console size (RT-ALLOC-INFO-CONSOLE)
  • c7c882a Merge main into alloc-info-console: streamed-texture sizes for console-form calls, as main's render-target sizes

📊 Changes

7 files changed (+1527 additions, -93 deletions)

View changed files

📝 docs/runtime_imports.md (+13 -7)
➕ runtime/shims/console_texture_size.h (+13 -0)
📝 runtime/shims/d3d12_xs_device.cpp (+31 -0)
📝 runtime/shims/xg_xs.cpp (+464 -38)
➕ runtime/src/console_texture_layout.h (+610 -0)
📝 runtime/test/xg_xs_test.cpp (+356 -48)
📝 runtime/test/xs_proxy_mock_test.cpp (+40 -0)

📄 Description

Depends on: #461

Claim: RT-ALLOC-INFO-CONSOLE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136979744). Only the last commit is this pull request; the rest is #461.

The retail title sizes its streamed textures with device slot 25, GetResourceAllocationInfo, with layout 0, and computes offsets and lengths inside its texture archives from the answers. The runtime forwarded the call, so it answered with the PC GPU's sizes and the title asked DirectStorage for a part of a compressed chunk. It asserts on that: the int3 at game_scarlett_master.exe+0x4ffd879 (1.0.2.1) right after the start screen, also seen on an RTX 5070 (https://github.com/ubiquitarianism/leonida/issues/14, DesertGamer).

Two of the textures it asserted on: 128x4 R16G16B16A16_UNORM, answered 2 pages of 4 KiB where the archive's chunk is 4; 128x128 BC1 with 6 mips, answered 4 where the chunk is 3. #461's layout gives 4 and 3 in the 4 KiB mode XGSuggestSwizzleMode picks for both.

Slot 25 now answers from #461's layout when every description is a texture with a swizzle mode (0x100 | mode) or layout 0, and not a render or depth target. Anything else keeps the PC answer for the whole list. It goes through a pointer, so the proxy does not link the xg_xs shim.

Not covered: slot 108 (GetResourceAllocationInfo2, #219), which needs the same two lines once it lands; arrays, 3D and targets are not measured on the title.

Tested

  • xs_proxy_mock_test: exit 0 (new: one and two textures, the alignment between them, and five lists that keep the PC answer). xg_xs_test: 0 failures (new: the sizes above). Windows 11, MSVC.
  • Retail package, in my prototype stack (not on this branch alone; RTX 5080, driver 621.24, Windows 11): with the rule for slots 25 and 108 the assert is gone and in a 240 s run no DirectStorage request failed; without it 24 and more did.
  • No game data.

AI-assisted (Claude Code, Opus 5.5).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/971 **Author:** [@DadaCap](https://github.com/DadaCap) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `alloc-info-console` --- ### 📝 Commits (4) - [`77f44fb`](https://github.com/ubiquitarianism/leonida/commit/77f44fbe3bd477727a1f5ab6d20c6dd5f40e25e8) xg_xs: lay out console textures and serve the texture computer (RT-XG-TEXTURE-COMPUTER) - [`a84d387`](https://github.com/ubiquitarianism/leonida/commit/a84d387f848942777cac2534d8b3f70a1e05050a) Merge commit 'refs/boot/pr461n' into alloc-info-console - [`9f89522`](https://github.com/ubiquitarianism/leonida/commit/9f8952249f5a236d5b0917222b7a19bdd35ce1c2) d3d12_xs: GetResourceAllocationInfo answers streamed textures with their console size (RT-ALLOC-INFO-CONSOLE) - [`c7c882a`](https://github.com/ubiquitarianism/leonida/commit/c7c882a36cb3a837ed1bf9feea091aaac600910e) Merge main into alloc-info-console: streamed-texture sizes for console-form calls, as main's render-target sizes ### 📊 Changes **7 files changed** (+1527 additions, -93 deletions) <details> <summary>View changed files</summary> 📝 `docs/runtime_imports.md` (+13 -7) ➕ `runtime/shims/console_texture_size.h` (+13 -0) 📝 `runtime/shims/d3d12_xs_device.cpp` (+31 -0) 📝 `runtime/shims/xg_xs.cpp` (+464 -38) ➕ `runtime/src/console_texture_layout.h` (+610 -0) 📝 `runtime/test/xg_xs_test.cpp` (+356 -48) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+40 -0) </details> ### 📄 Description Depends on: #461 Claim: RT-ALLOC-INFO-CONSOLE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136979744). Only the last commit is this pull request; the rest is #461. The retail title sizes its streamed textures with device slot 25, `GetResourceAllocationInfo`, with layout 0, and computes offsets and lengths inside its texture archives from the answers. The runtime forwarded the call, so it answered with the PC GPU's sizes and the title asked DirectStorage for a part of a compressed chunk. It asserts on that: the int3 at `game_scarlett_master.exe+0x4ffd879` (1.0.2.1) right after the start screen, also seen on an RTX 5070 (https://github.com/ubiquitarianism/leonida/issues/14, DesertGamer). Two of the textures it asserted on: 128x4 R16G16B16A16_UNORM, answered 2 pages of 4 KiB where the archive's chunk is 4; 128x128 BC1 with 6 mips, answered 4 where the chunk is 3. #461's layout gives 4 and 3 in the 4 KiB mode `XGSuggestSwizzleMode` picks for both. Slot 25 now answers from #461's layout when every description is a texture with a swizzle mode (`0x100 | mode`) or layout 0, and not a render or depth target. Anything else keeps the PC answer for the whole list. It goes through a pointer, so the proxy does not link the xg_xs shim. Not covered: slot 108 (`GetResourceAllocationInfo2`, #219), which needs the same two lines once it lands; arrays, 3D and targets are not measured on the title. ### Tested - `xs_proxy_mock_test`: exit 0 (new: one and two textures, the alignment between them, and five lists that keep the PC answer). `xg_xs_test`: 0 failures (new: the sizes above). Windows 11, MSVC. - Retail package, in my prototype stack (not on this branch alone; RTX 5080, driver 621.24, Windows 11): with the rule for slots 25 and 108 the assert is gone and in a 240 s run no DirectStorage request failed; without it 24 and more did. - No game data. AI-assisted (Claude Code, Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:47 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1008
No description provided.