mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #416] [MERGED] d3d12_xs: the list proxy translates title-owned CPU descriptor handles (RT-LIST-HANDLES) #466
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#466
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/416
Author: @Mumogg
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:list-descriptor-handles📝 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 heapc8247cdd3d12_xs: a console indirect argument of type 105 is created as DISPATCH (slot 41)📊 Changes
23 files changed (+2376 additions, -123 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+31 -2)📝
runtime/CMakeLists.txt(+1 -0)📝
runtime/shims/d3d12_com.cpp(+10 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+5 -0)📝
runtime/shims/d3d12_xs.cpp(+17 -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(+930 -52)📝
runtime/shims/d3d12_xs_device.h(+54 -11)📝
runtime/shims/registry.cpp(+39 -0)📝
runtime/shims/shims.h(+13 -0)📝
runtime/shims/xbox_present.cpp(+3 -2)📝
runtime/shims/xbox_present.h(+2 -1)📝
runtime/src/command_list.h(+3 -0)📝
runtime/src/frame_pacer.h(+19 -6)📝
runtime/src/pe_loader.cpp(+7 -0)📝
runtime/test/allocator_proxy_test.cpp(+24 -7)📝
runtime/test/d3d12_mesh_test.cpp(+22 -0)📝
runtime/test/device_proxy_test.cpp(+76 -1)📝
runtime/test/frame_pacer_test.cpp(+19 -0)...and 3 more files
📄 Description
Claimed in #14 as
RT-LIST-HANDLES. Depends on: the stack up to #414 (their commits come first here; this pull request is the last commit). The code needs #375 (the title's descriptor range andtranslate_cpu_handle); the rest of the dependency is the measurement.What and why
Since #375 the device slots 17 to 24 translate a CPU descriptor handle in the title's own range (
__XMemAllocationHooks__) to the real heap's. The five command-list methods that take such handles did not. Console list slots 50 (OMSetRenderTargets), 51 (ClearDepthStencilView), 52 (ClearRenderTargetView), 53 and 54 (the twoClearUnorderedAccessView) reached the real list with the title's address, which is no descriptor there.On the retail boot that shows as soon as the title records its first frame: a
ClearRenderTargetViewwith a title-owned handle, and thenID3D12GraphicsCommandList::Close failed.They translate now, in copies: the caller's arrays are not written, and a handle outside the range is passed as it is. Slot 51 gets a typed thunk, because its depth is a
FLOATin XMM3, which the all-integer list thunk loses.Written by me as a port: this is
0aba6c361(LeonidaBringup), which sits on old PR 2490's list proxy and does not apply tomain's. The commit message credits it.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, #219, #328 and #387 applied on top for the boot runs (they are not in this branch).--runExecuteCommandLists okClose okID3D12GraphicsCommandList::Close: 1With it the trace of this path has no failed call at all, two more submissions go through, and in one of two runs the title's first
PresentXsucceeds (see #414 for the other run).Every run now ends on the same thing: an
int3of the title on a worker thread, whichtools/int3_cause.pyreads as a check that a word of one of the title's objects is zero. That is the next stop and I do not know its cause yet.xs_proxy_mock_testunder Wine passes, with the new cases on a device whose heap has a title-owned range: slots 52, 53 and 54 with a handle inside the range and one outside it; slot 50 with two render-target handles (one inside, one outside) and a depth handle, checking what the real list receives and that the caller's arrays are unchanged; slot 51 through its typed thunk. The mock's integer prototype cannot see slot 51's float, so that the depth survives is not tested here.Not built with MSVC and not run on Windows.
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.