mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:55:52 +01:00
[PR #432] [CLOSED] d3d12_xs: fence slot 12 returns the address of a live completed value, again; the retail boot reaches its frame loop (RT-FENCE12) #484
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#484
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/432
Author: @Mumogg
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:fence-slot12-completed-value📝 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
24 files changed (+2760 additions, -129 deletions)
View changed files
📝
docs/d3d12_command_objects.md(+6 -0)📝
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(+55 -0)📝
runtime/shims/d3d12_xs_device.cpp(+1075 -54)📝
runtime/shims/d3d12_xs_device.h(+56 -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(+114 -1)...and 4 more files
📄 Description
Claimed in #14 as
RT-FENCE12. Depends on: the stack up to #430 (their commits come first here; this pull request is the last commit).What and why
Fence slot 12 is one past
ID3D12Fence1. The retail title calls it as(value, descriptor, flags)and reads the return as a pointer to the fence's 64-bit completed value.mainrefuses the slot withE_NOTIMPL, and the title dereferences the error code.Commit
5ac4deaa2by TreXito (-x, authorship kept; an ancestor ofmainwhose content is not in the tree): each fence gets a mirror of its completed value that stays current without the title calling anything (a thread-pool wait on the real fence refreshes it; slot 12 and a CPUSignalrefresh it at once), and slot 12 returns the mirror's address. The descriptor's code pointer is not called: its contract is not known, and the commit says so.The conflicts were neighbours (the queue constants of #391 and #403, the allocator fields of #395, the tests' lists); both sides are kept.
Measured: the frame loop
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, #387 and #428 applied on top (they are not in this branch).Correction (I first posted this section with a wrong duration): the runs with this change do not last the 300 s I allowed them. The process ends after about 30 s, exit code 3. I had read the counts and not the exit line. The numbers below are two runs of about 30 s each.
--runCreatePipelineStateokExecuteCommandListsokDrawInstancedXboxPresentation::PresentXokFence::Slot12 unsupportedSo with this the retail title enters its frame loop on
mainhere and presents some 13,000 to 14,000 times, with one draw per present, before the process ends. That is far more presents than seconds: nothing paces the loop on this path.Why it ends, from run 2's startup trace: at 22.4 s a worker thread of the title hits its own
int3(the size check of #427 and #428, on a third description that I have not identified yet); at 28 to 29 s the title's crash reporting runs and the process exits. The frame loop is running the whole time in between. So the next thing on this path is that third description, not the loop.What else is still wrong, so nobody reads more into the table than it says:
primitive topology type not supported: 19: rectangle lists, whichmaindoes not draw (old PR 7448). The integration branch draws three times per present, this path once; that is very likely why.XboxID3D12CommandQueue::Slot31is refused twice.Tests under Wine:
xs_proxy_mock_testpasses with the commit'scheck_fence_completed_value;queue_proxy_testpasses on the Vulkan backend with its fence slot 12 case (the value follows a queue's signal without another call).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.