docs(d3d12_command_objects): 0x48/0x50 are heap handle getters on heap objects (D3D12-HEAP-HANDLE-SLOTS) #1045
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1045"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by robot00f on 2026-11-24T17:12:41Z.
Closes nothing (docs only). Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7138270960
Item:
D3D12-HEAP-HANDLE-SLOTS.What
docs/d3d12_command_objects.mdgets a new §2.1a: a byte offset is not a method, and0x48/0x50are ambiguous by offset alone.0x148759D00)0x48isCreateCommandAllocator;0x50is unused.ID3D12DescriptorHeapthe same offsets areGetCPUDescriptorHandleForHeapStart(0x48) andGetGPUDescriptorHandleForHeapStart(0x50), because the interface inherits eightIUnknown/ID3D12Object/ID3D12DeviceChildslots and starts its own methods at0x40(d3d12.h:5768/5775/5782).The section states the rule (resolve the receiver, not the offset), gives the two signature shapes, and gives the counts below. §3.2's FSR note now points at it.
Why
Several pages summarise call sites as "the 29 calls at
0x48" or "device slot 9", and a reader can carry that offset to a heap object and land two methods early/late. The pair also collides withID3D12CommandQueue(0x48CopyTileMappings,0x50ExecuteCommandLists), so a replacement runtime that keys on the offset alone will wire the wrong method.Measurements (no game data, nothing executed)
+0x48/+0x50call site: 2 device sites at0x48, none at0x50. Both are in0x142478440(0x142478B2Dedx=0,0x142478C3Bedx=2) and pass&IID_ID3D12CommandAllocator(0x1461E0658). The other four+0x48sites there are twoClosecalls on the new list and two no-argument getter calls on globals.0x141CF3280calls device0x70(CreateDescriptorHeap,&IID_ID3D12DescriptorHeapat0x1461E0628), then the returned heap at0x141CF3358(0x48) and0x141CF3392(0x50) with onlythis, caches the CPU handle, asserts it against the expected base, and subtracts it from the GPU handle to store the base delta.0x141C744F0(0x141C74559) uses the0x48return as a descriptor base and strides it by the device0x78increment.0x70and0x48; 81 call0x70and0x50. In 19 of the 99, a+0x48/+0x50receiver traces to theCreateDescriptorHeapreturn — 47 sites, 14 of them passing onlythis.0x14080C3E0(inner boolean pair),0x14049E200(CRetValout pointer),0x140087040(dispatch thunk forwardingrdx/r8),0x141993B30(heap register reloaded from a factory global).Tested
python -I scripts/check_no_game_data.py docs/d3d12_command_objects.md→ exit 0python -m compileall -q make_game.py tools tests→ exit 0Docs only, no code paths changed.
GPUs tested: n/a
AI-assisted: yes (OpenCode)
Imported from ubiquitarianism/leonida. Originally posted by morodirule on 2026-11-24T17:14:01Z.
Independent check of the ABI half (public headers only, MinGW w32api d3d12.h — no game files): ID3D12DescriptorHeap vtable order is GetDesc, GetCPUDescriptorHandleForHeapStart, GetGPUDescriptorHandleForHeapStart after 8 inherited slots (IUnknown 3 + Object 4 + DeviceChild 1), i.e. 0x40/0x48/0x50 as the new §2.1a table says; ID3D12Device order is GetNodeCount, CreateCommandQueue, CreateCommandAllocator, ... i.e. CreateCommandAllocator at 0x48, also as stated. The "no call site in the image" measurement half I cannot independently re-derive from headers — leaving that to the recorded trace. Not claiming; review evidence.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:48:09Z.
Native Windows 11 Verification (
6994562bda)Diff-audited
docs/d3d12_command_objects.md(+78/-1) and verified merged ontoorigin/main(a9e247cd69) on Windows 11 (10.0.26200, Python3.12.10with-I).Results
tests/test_docs_*.pysuites (0PR-introduced issues acrossadjacent_fenced_blocks,design_rows,encoding,links,list_items,pr_template,python_deps,repeated_lines,repo_paths,table_ids,table_rows),tests/test_text_write_line_endings.py(3/3), andscripts/check_no_game_data.pypass (rc=0).rc=0) ontoorigin/main(a9e247cd69) and alongside#1056.docs/d3d12_command_objects.md:157):line 157), the device factory shape is written as(rcx = device, edx = type, rdx = &IID, r8 = &out), which listsedxandrdx(RDX) twice; in the Windows x64 ABI forCreateCommandAllocator, the four register parameters are(rcx = device, edx = type, r8 = &IID, r9 = &out).AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:41:42Z.
Merged at head
6994562. Docs-only, reviewed on this head by zmasi (PASS); no test applies. AI-assisted: yes.