[PR #1117] [MERGED] docs(d3d12_xs_surface): slot 108 is an allocation-info query, not a GUID query (D3D12-SLOT108-QUERY) #1151

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1117
Author: @robot00f
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @Andretuta

Base: main ← Head: docs/b3


📝 Commits (2)

  • b6d6b70 docs(d3d12_xs_surface): measured arity of device extension slots (D3D12-EXTENSION-SLOT-ARITY)
  • b9ad785 docs(d3d12_xs_surface): what device slot 108 is asked for (D3D12-SLOT108-QUERY)

📊 Changes

1 file changed (+122 additions, -3 deletions)

View changed files

📝 docs/d3d12_xs_surface.md (+122 -3)

📄 Description

Claimed in the coordination issue as: D3D12-SLOT108-QUERY (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140237065)

Depends on: #1038 (this patch lives inside the §5.2 table and slot-108 bullet that PR adds; it is stacked on that commit and will show it until #1038 lands).

What and why

§5.2 records slot 108's two device sites (0x140ABFDA9, 0x140ABFE07) and cross-references docs/d3d12_vulkan.md §3.1's GetResourceAllocationInfo2 route. This patch adds the full callee measurement of 0x140ABFAE0-0x140ABFE6C (reached through the thunk at 0x140ABFAD0):

  • The 5th argument ([rsp+0x20]) is a 56-byte D3D12_RESOURCE_DESC; the callee reads Dimension (+0), Alignment (+8), Width (+0x10), Height (+0x18), DepthOrArraySize (+0x1C), Format (+0x20), Layout (+0x2C) and Flags (+0x30), and writes back the 4-texel-aligned extent for block-compressed formats (0x140ABFB2B-0x140ABFB40).
  • Dimension 4 (3D) with Layout 0 gets the console word 0x105 written into Layout (0x140ABFD4B).
  • Under 0x80008 bits it sets Alignment = 0x1000, calls slot 108, and if the returned alignment is not 0x1000 clears Alignment to 0 and calls again (0x140ABFDBF-0x140ABFE07) — the 4 KiB D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT retry (docs/d3d12_vulkan.md §4.2).
  • The 16-byte return is {SizeInBytes, Alignment} (rcx is the hidden return buffer, this is in rdx), the 6th argument ([rsp+0x28]) is a 24-byte D3D12_RESOURCE_ALLOCATION_INFO1 scratch buffer, and the code int3s unless the high dword of SizeInBytes is 0 (0x140ABFE15).

That matches ID3D12Device4::GetResourceAllocationInfo1's 56-byte desc shape (docs/d3d12_vulkan.md §3.1 expands the 56-byte desc, normalises 0x105 and Xbox flags, and routes to PC slot 68 ID3D12Device8::GetResourceAllocationInfo2). Measured: shape, offsets, 0x1000/0x105, retry, assert. Open: exact console wire method name (GetResourceAllocationInfo1 vs GetResourceAllocationInfoX / 2).

Tested

  • Static disassembly of the function, both call sites and the return use (nothing executed).
  • python -I scripts/check_no_game_data.py docs/d3d12_xs_surface.md -> exit 0; tests/test_d3d12_xs_surface.py, tests/test_docs_table_rows.py, tests/test_docs_links.py -> OK.

GPUs tested: n/a

AI-assisted: yes (Antigravity, Gemini 4 Carbon)

Checklist

  • Based on current main and merges cleanly; stacked on #1038, declared.
  • One topic.
  • No game data, keys or decryption (CONTRIBUTING.md).
  • A new translator rule is in the contract table of docs/design.md. (No translator change.)

🔄 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/1117 **Author:** [@robot00f](https://github.com/robot00f) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@Andretuta](https://github.com/Andretuta) **Base:** `main` ← **Head:** `docs/b3` --- ### 📝 Commits (2) - [`b6d6b70`](https://github.com/ubiquitarianism/leonida/commit/b6d6b702025c542f170f8061ccc8d79cf833f468) docs(d3d12_xs_surface): measured arity of device extension slots (D3D12-EXTENSION-SLOT-ARITY) - [`b9ad785`](https://github.com/ubiquitarianism/leonida/commit/b9ad785e5f6b39a15447c4a87648dffb1c264309) docs(d3d12_xs_surface): what device slot 108 is asked for (D3D12-SLOT108-QUERY) ### 📊 Changes **1 file changed** (+122 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_xs_surface.md` (+122 -3) </details> ### 📄 Description Claimed in the coordination issue as: D3D12-SLOT108-QUERY (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140237065) Depends on: #1038 (this patch lives inside the §5.2 table and slot-108 bullet that PR adds; it is stacked on that commit and will show it until #1038 lands). ### What and why §5.2 records slot 108's two device sites (`0x140ABFDA9`, `0x140ABFE07`) and cross-references `docs/d3d12_vulkan.md` §3.1's `GetResourceAllocationInfo2` route. This patch adds the full callee measurement of `0x140ABFAE0`-`0x140ABFE6C` (reached through the thunk at `0x140ABFAD0`): - The 5th argument (`[rsp+0x20]`) is a 56-byte `D3D12_RESOURCE_DESC`; the callee reads `Dimension` (`+0`), `Alignment` (`+8`), `Width` (`+0x10`), `Height` (`+0x18`), `DepthOrArraySize` (`+0x1C`), `Format` (`+0x20`), `Layout` (`+0x2C`) and `Flags` (`+0x30`), and writes back the 4-texel-aligned extent for block-compressed formats (`0x140ABFB2B`-`0x140ABFB40`). - Dimension 4 (3D) with `Layout` 0 gets the console word `0x105` written into `Layout` (`0x140ABFD4B`). - Under `0x80008` bits it sets `Alignment = 0x1000`, calls slot 108, and if the returned alignment is not `0x1000` clears `Alignment` to 0 and calls again (`0x140ABFDBF`-`0x140ABFE07`) — the 4 KiB `D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT` retry (`docs/d3d12_vulkan.md` §4.2). - The 16-byte return is `{SizeInBytes, Alignment}` (`rcx` is the hidden return buffer, `this` is in `rdx`), the 6th argument (`[rsp+0x28]`) is a 24-byte `D3D12_RESOURCE_ALLOCATION_INFO1` scratch buffer, and the code `int3`s unless the high dword of `SizeInBytes` is 0 (`0x140ABFE15`). That matches `ID3D12Device4::GetResourceAllocationInfo1`'s 56-byte desc shape (`docs/d3d12_vulkan.md` §3.1 expands the 56-byte desc, normalises `0x105` and Xbox flags, and routes to PC slot 68 `ID3D12Device8::GetResourceAllocationInfo2`). Measured: shape, offsets, `0x1000`/`0x105`, retry, assert. Open: exact console wire method name (`GetResourceAllocationInfo1` vs `GetResourceAllocationInfoX` / `2`). ### Tested - Static disassembly of the function, both call sites and the return use (nothing executed). - `python -I scripts/check_no_game_data.py docs/d3d12_xs_surface.md` -> exit 0; `tests/test_d3d12_xs_surface.py`, `tests/test_docs_table_rows.py`, `tests/test_docs_links.py` -> OK. GPUs tested: n/a AI-assisted: yes (Antigravity, Gemini 4 Carbon) ### Checklist - [x] Based on current `main` and merges cleanly; stacked on #1038, declared. - [x] One topic. - [x] No game data, keys or decryption (CONTRIBUTING.md). - [ ] A new translator rule is in the contract table of `docs/design.md`. (No translator change.) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:15 +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#1151
No description provided.