mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:40:52 +01:00
[PR #375] [MERGED] d3d12_xs: the title's XMem hooks, console render-target sizes and resource leases, again (RT-XMEM-LEASE) #425
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#425
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/375
Author: @Mumogg
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @aslan2142
Base:
main← Head:xmem-hooks-sizes-lease📝 Commits (10+)
522faa2d3d12_xs: honour XMemAllocationHooks for descriptor heaps and translate CPU handlesf59167ed3d12_xs: device slot 25 pads a render target to whole console tiles (RT-5 stop 17)6b75cbad3d12_xs: device slot 25 gives the PC device clean resource descriptions (RT-5 stop 16)8eaccded3d12_xs: console render target sizes follow each resource's alignment, slot 56 offsets, full mip chains, rounded-up mip extents, B5G5R5A1, saturating sumse090be9d3d12_xs: committed resources lease their size through the title's XMem hooks (RT-5 stop 17)24914e7d3d12: preserve PC descriptor validation in slot 254056d18ladder: kXboxTiledResourceLayout is inline const, not constexpr (clang-cl rejects 0x101 for the unfixed enum)c108c53d3d12_xs: the console render-target sizes of slots 25 and 56 are for console-form calls only0c5a146d3d12_xs: the hook-backed descriptor address is not applied to a console-extended heap94f2773Merge main into RT-XMEM-LEASE (#375)📊 Changes
11 files changed (+1453 additions, -42 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+27 -2)📝
runtime/shims/d3d12_xs.cpp(+11 -0)➕
runtime/shims/d3d12_xs_alloc_size.h(+156 -0)➕
runtime/shims/d3d12_xs_desc_clean.h(+38 -0)📝
runtime/shims/d3d12_xs_device.cpp(+503 -23)📝
runtime/shims/d3d12_xs_device.h(+16 -1)📝
runtime/shims/registry.cpp(+39 -0)📝
runtime/shims/shims.h(+13 -0)📝
runtime/src/pe_loader.cpp(+7 -0)📝
runtime/test/device_proxy_test.cpp(+71 -1)📝
runtime/test/xs_proxy_mock_test.cpp(+572 -15)📄 Description
Claimed in #14 as
RT-XMEM-LEASE. Depends on: #349, #350, #356, #362, #369 (their commits come first here; this pull request is the last five commits).What and why
After #369 the title stops on a budget check: it bump-allocates its first full-screen render targets out of a range it reserved, through its own
__XMemAllocationHooks__, and asserts that less than 2 MiB of that range is left. Onmainnothing goes through those hooks, so the whole range is left.tools/int3_cause.pyon the stop shows the comparison against0x1fffff.Clearing it takes three pieces that build on each other. All five commits are cherry-picked with
-xand keep their authors; all are ancestors ofmainwhose content is not in the tree.355201c51__XMemAllocationHooks__honoured for descriptor heaps; device slots 17 to 24 translate CPU handles in the title's own range (old PR 7021)889785539c7ca0f2d1359390833ae322dafcWhat I changed while resolving conflicts, so a reviewer knows where to look:
proxy_get_resource_allocation_info:c7ca0f2d1and359390833come from two branches of the original series; I resolved them as the original merge commit (aeb253754) did, including the mock's helper block.359390833removes. I used the later form from the same author's follow-up (d61755d4d): a render target's console tile size, else the PC size. The commit message says so.Left out on purpose, to keep this to what the stop needs:
b4d1ba179(PC descriptor validation in slot 25),4a8603436(a depth-stencil texture with unordered access) andbee47186f.One thing a maintainer should decide:
355201c51is the title-backed descriptor heap model.mainalso has the slot 14 console-heap handler in the Vulkan layer. They did not conflict textually and the boot below runs with both present, but they are two answers to the same question and I have not worked out how they should share slot 14.Measured
Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off, on
mainece4ba5b3, with #142 and #328 applied on top for the boot runs (they are not in this branch).--runint3on the 2 MiB budget checkint3after its device set-up returns false; the last new slot called is 41With this the log shows the first calls of device slot 16 (
CreateRootSignature) and slot 62 (the console's compute pipeline creation), and the shader library loads (28,215 translated shaders here). The next stop looks like device slot 41,CreateCommandSignature, forwarded as it is.xs_proxy_mock_testunder Wine passes with every case of the five commits: descriptor heap hooks, render-target sizes, cleaned descriptions, render-target layout and committed-resource leases.Not built with MSVC and not run on Windows.
device_proxy_testalso gets cases from355201c51; I cannot run it here (it stops atD3D12XboxCreateDevice returns a deviceunder Wine, onmaintoo).AI-assisted (Claude Code); built and run on the machine above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.