upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/pe_loader.cpp
diff options
context:
space:
mode:
authorKam471 <115741199+Kam471@users.noreply.github.com>2026-11-21 18:05:29 +0000
committerKam471 <115741199+Kam471@users.noreply.github.com>2026-11-21 18:26:19 +0000
commit9015a62748565bd2af0622a66f7f55b2a3700f49 (patch)
treeda68093239ca845fba43d5c27d053232e0fd5ed3 /runtime/src/pe_loader.cpp
parent793b06f12765571ed5e126d1d8944cec6a4dc805 (diff)
Runtime: Xbox-ABI device proxy (slots 9/10/62/76)
- Wrap the PC ID3D12Device in a copied-vtable proxy: per-slot thunks swap `this` to the PC device, with IUnknown refcounting/QueryInterface, per-slot hit counters and XS_TRACE=1 first-call logging. - Override Xbox slot 62 to the PC CreateComputePipelineState (PC slot 62 is CreateStateObject) and Xbox slot 76 to CreateCommittedResource (PC slot 27). The 56-byte description prefix is copied and its 0x101/0x1 layout word replaced by ROW_MAJOR for buffers and UNKNOWN for textures. - Slot 14 wraps the created descriptor heap. On the measured PC runtime the heap getters take the hidden return pointer in RDX, while the Xbox ABI expects the 8-byte handle in RAX; heap slots 9/10 convert between them. Device slots 9/10 stay CreateCommandAllocator/CreateGraphicsPipelineState, because the measured handle getters are ID3D12DescriptorHeap methods. - Heap slot 7 GetDevice returns the device proxy, not the raw PC device. The heap holds a device-proxy reference, so GetDevice cannot dangle; the device proxy does not reference heap proxies, so there is no cycle. - Add device_proxy_test (WARP, no game executable): shim-created proxy, QI/refcount, slot 14 heap, heap GetDevice/refcount, raw RAX handles vs the PC hidden-pointer result, slot 9/16/30/43 forwarding, slot 76 buffer and texture, slot 62 compute PSO, and counter checks. Register it with ctest. - Wire both CMake and scripts/build_runtime.ps1. Verified against Windows SDK 10.0.26100 d3d12.h (slot counts through ID3D12Device14; no Device15/16 exists there) and a live WARP device. Still unknown: PresentX, queue/fence/command-list extensions, Xbox vtable order beyond the measured slots, and struct returns other than the heap handles. Clean-room: implemented from the measured ABI-facts spec; no americas-recomp or AnyPS5 source was read or copied.
Diffstat (limited to 'runtime/src/pe_loader.cpp')
0 files changed, 0 insertions, 0 deletions