Repository navigation
Conversation
…nslate CPU handles
…ttedResource3 with Xbox descriptors, RT-5 stop 15) Slot 127 is past the PC device vtable and was refused with E_NOTIMPL. It has the argument list of ID3D12Device10::CreateCommittedResource3; the proxy now calls the PC device's with the Xbox layout word and flag bits cleaned as slot 76 does. Measured in ProjectLeonida#6982.
…nment, refuses null heap properties; tests pin heap flags, session and reference counts Review of ProjectLeonida#7052: dispatch and release through the ID3D12Device10 interface pointer (not the base device's vtable); keep every PC-valid resource flag bit, 0x400 included; null heap properties return E_POINTER; the test now passes non-zero heap flags and a protected session, checks the single release returns 0 for texture and buffer, and covers a distinct Device10 pointer.
…(XMem allocation hooks for descriptor heaps)
…le's XMem hook (retail boot chain stop 17) The console D3D runtime allocates a committed resource's memory with XMemAlloc, so a title's __XMemAllocationHooks__ see it. Around its first full-screen render targets the title installs a hook that bump-allocates allocations with page-size field 2 from a fixed arena and then asserts that little of the arena is left unused; with no call reaching the hook, nothing is counted and the assert fires. After the PC device creates the resource, slot 127 calls the installed hook (the one ProjectLeonida#7021 bridges for descriptor heaps) with the PC allocation size and the D3D allocator ID, page-size field 2, and attaches the memory to the resource as private data, so it goes back through the hook's free when the resource dies. The PC resource is not backed by it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Retail Linux integration result on RX 9070 XT / Mesa RADV 26.3.1 / Wine 11.22. With #7052, #7078 and #7110, both 3840×2160 RGBA8 render targets were created. The host and tiled sizes agreed at 33,423,360 bytes per target. The last three traced calls created the SRV, RTV and UAV for the second target. The title then stopped. With this PR’s slot 127 hook and #5680’s catalogue loader added, the same title reached Xbox slot 62 (CreateComputePipelineState) and loaded 26,584 translated shader entries from my local work folder. After that the trace shows four more committed resources, command lists, a descriptor heap and two more SRVs. It still ends during System Init, frame 0. The integration also contains #7075’s independent resource and #7066’s null view, so this measures startup progression only. A separate synthetic test on Wine / lavapipe created two render targets. Each allocation hook was called once for 65,536 bytes, and the matching free ran on the last Release of each resource. No game data or shader artifacts are attached. |
|
@NiiRoZz measured on the AMD Windows driver: RX 6900 XT (gfx1030), AMD 26.11.2, Windows 11, MSVC,
Suggestion: hand the hook the console tile size for render targets, not the PC size. AI-assisted (Claude Code). |
|
Independent native Windows 11 / MSVC 19.44.35230.0 / AMD Radeon RX 6700 XT (
AI-assisted (Gemini, Antigravity). |
|
Tested Base: main
On this GPU slot 25 already answers with the tile size, so the lease is 33,423,360 B per target, as @controldebils expected for NVIDIA and RADV. The AMD overrun does not show here. Exit codes, module offsets and slot numbers only. AI-assisted (Claude Code). |
|
A note from reviewing #7240, which leases the same slot-127 render targets: at On AMD's Windows driver that size is larger than the console's. @controldebils measured 33,619,968 B (513 × 64 KiB) for a 3840 × 2160 I read the code; I haven't run this PR on AMD hardware. AI-assisted. No game files. |
|
Tested Retail Xbox Series 1.0.2.1 package + executable (sizes match
Outcomes only; no game data. |
|
Tested Base:
Not checked: a second run, and the stops after the pipelines (that needs the translated corpus). No game data: only sizes, slot numbers and counts. AI-assisted (Claude Code). |
…xed#7235's block, layout argument)
…th; drop ProjectLeonida#7235's second attach)
|
Retail boot test (RT-5): own 1.0.2.1 copy, Windows 11, i9-12900KF, RTX 3070 (NVIDIA 617.42), MSVC 2022 RelWithDebInfo, Result: clears stop 17 on NVIDIA. The lease logs Merge notes: conflicts only in AI-assisted test run. |
|
Windows 11, i7-10700F, RX 580 (driver 31.0.21924.61), MSVC 14.44 integration validation: all eight device/mock variants pass after combining this with the startup stack, including #7052 and #7110. The combined mock keeps the explicit allocation_size override only for the accounting test; all other allocation-info tests retain #7110's description-based mock response. Normal retail startup now logs successful slot-127 resource allocation through the title hook, passes the earlier accounting assertion, and reaches CreateRootSignature and the first CreateComputePipelineState. This GPU reports maxPushConstantsSize=128, so the current 144-byte pipeline contract is the next stop; testing #2402 next. No assertion skipping or debugger parameter rewriting; no game bytes, addresses or logs included. |
…xed#7235's block, layout argument)
…th; drop ProjectLeonida#7235's second attach)
…ource's memory through the title's XMem hook (retail boot chain stop 17) Squashed from ItsNotRexed#7235 by NiiRoZz, head f5dae9f (security scan PASS). Contains ItsNotRexed#7021 and ItsNotRexed#7052. registry.cpp stays on the SRWLOCK form adopted for ItsNotRexed#7021 here (this PR's copy of ItsNotRexed#7021 re-adds the function-local statics). The mock's slot 25 stays on ItsNotRexed#7078's description-based mock_allocation_info; this PR's mock_call case 25 (a fixed allocation_size) is dropped. Union of slot lists, check lists and the slot-18 null description as before.
… memory the title's XMem hook gives (slots 27, 53, 76, 127) Squashed from ItsNotRexed#7411 by garuspl, head 9335d6b (security scan PASS). Taken as its own commit 9335d6b on top of ItsNotRexed#7235 and the newer ItsNotRexed#7218 already here: the branch merges an older ItsNotRexed#7218 head, whose slot-133 code and Vulkan-device import would undo ItsNotRexed#7218's review fixes. The proxy file's reorder keeps slot 26 and the route_xbox_device_slot helper ahead of the committed-resource code, places ItsNotRexed#7218's current slot-133 handler where this PR's copy was (g_placed_at_va declared once, above), and keeps the slot 25/26/48/56/70/133 entries in the slot names, device_slot_overridden, the header and the mock test's check list.
…get size (from ItsNotRexed#7240) Wave 2 port of the sizing half of ItsNotRexed#7240 (by jacksonslab) onto ItsNotRexed#7235/ItsNotRexed#7411's xmem_size: a listed 2D render target asks the title's XMem hook for its whole console tiles (console_render_target_size, slot 25's answer), not the PC GetResourceAllocationInfo size. On AMD (RDNA2, RADV too) the PC answers 33,619,968 B for each 3840x2160 RGBA8 target, so the two stop-17 targets overran the title's 64 MiB arena; the console size is 33,423,360 B (reviewers of ItsNotRexed#7235). ItsNotRexed#7240's own lease is not taken: it would ask the hook a second time for every slot 76/127 resource that ItsNotRexed#7411 already allocates through it.
…ress of a completed value that stays live (retail executable, past the PC fence chain) Squashed from ItsNotRexed#7290 by TreXito, head 04fdf37 (security scan PASS). Conflicts in xs_proxy_mock_test only: the Mock struct keeps ItsNotRexed#7235's allocation_size/private_data next to this PR's fence fields; the fence switch replaces the fixed GetCompletedValue line, with the resource SetPrivateDataInterface and heap 9/10 cases kept after it; the check list takes the union.
…t expectations) ItsNotRexed#7759 carries ItsNotRexed#7201's slot 86/101/108 handlers; its squash added them a second time next to ItsNotRexed#7201's copy (the 101/108 bodies are identical, and ItsNotRexed#7759's slot 86 keeps the PSO stream for slot 55), so ItsNotRexed#7201's copy is removed. xs_proxy_mock_test: the check_xbox_slots summary line merged for ItsNotRexed#7163 had its \n written as a line break; ItsNotRexed#7235's slot-127 hook check now expects no PC slot 25 call for a listed render target (the console-size port from ItsNotRexed#7240 sizes it, same 33,423,360 B); ItsNotRexed#7821's check_view_heap_cap releases the heaps it makes, since its CreateDescriptorHeap mock case is now ItsNotRexed#7021's, which makes a heap proxy holding the device. d3d12_vulkan_device_test: the meta-command checks run on the device behind the Xbox proxy, as ItsNotRexed#7125 does for CreateReservedResource2: proxy slot 61 is the title's CreateSamplerX (ItsNotRexed#7115).
…e resource of a slot 70 view of that address Device slot 70 makes a shader-resource view from a description and a console address, with no resource object. It asked only the device behind the proxy for a buffer at that address, and that device knows the buffer by the title's address only when it could put the buffer on the title's own pages. When it could not (the import is refused, or the device is a PC one), the slot 133 buffer has an address of its own, nothing was found, and the title's descriptor got the null view. The proxy now remembers every buffer a slot 133 call made by the range the title placed it at, whichever way it was made (the placed-at-VA handler, PC CreateCommittedResource3 or CreateCommittedResource), and slot 70 asks there first, then the device's provider. An entry holds no reference. An object attached to the resource as private data removes the entry when the resource dies, and a device proxy's entries go with it. The newest buffer over an address answers, so a range the title places again is the new buffer's. xs_proxy_mock_test: check_slot70_placed_buffer covers both creation paths and the handler path, the element range, the cut at the buffer's end, the addresses around two buffers, a texture, the provider fallback and its order, a range placed twice, a released buffer and a released device. The check of the placed-at-VA handler in check_levels hands out a mock resource instead of a made-up pointer, since the proxy now asks the object for ID3D12Resource. Depends on: ItsNotRexed#7066 (slot 70), ItsNotRexed#7218 or ItsNotRexed#7075 (slot 133), ItsNotRexed#6953 (the table reaches slot 133), and ItsNotRexed#7235 for the mock's SetPrivateDataInterface. (cherry picked from commit 7387445) Signed-off-by: local <local@localhost>
Claimed in #7231 (comment)
Depends on: #7021 (the
__XMemAllocationHooks__bridge) and #7052 (device slot 127). This branch is #7021's head with #7052 merged in; only the last commit,f5dae9ff2, is this PR. #7021 currently conflicts with main, so the diff against main also shows both of them until they land.What
After the PC device creates a committed resource for Xbox device slot 127, the proxy calls the title's installed XMem allocation hook for that resource's allocation size (from the PC
GetResourceAllocationInfo). It passes the D3D allocator ID and page-size field 2 (kXmemCommittedResourceAttributes). The memory is attached to the resource withSetPrivateDataInterface, so it goes back through the hook's free when the resource dies. The PC resource is not backed by that memory; it only keeps the title's accounting the same as on the console. With no hook installed, if the hook refuses, or if the PC call fails, slot 127 behaves as before.Why
Stop 17 of the retail boot chain (#6982): a fatal assert right after the title's first full-screen render targets. Measured locally at the title's call sites, it isn't a size check against our answers:
XMemAlloc, so the hook sees the targets. Through our proxy nothing reaches it: the arena stays untouched and the assert fires, whatever sizes slot 25 answers.R8G8B8A8_UNORMrender targets with UAV. On this machine, the PC answers 33,423,360 B for each, already whole 64 KiB tiles, so d3d12_xs: GetResourceAllocationInfo answers console tile sizes for 2D render targets (slot 25 return-buffer form; sizes #7240 leases at stop 17) #7078's padding doesn't change them. With this change both reach the hook and the check passes.Limits: the object type of a resource allocation is not measured, so it is 0. Only slot 127 does this; the other committed-resource paths (slots 27, 53, 76) can follow once a title is seen counting them.
Tested
Windows 11, MSVC 2022 (14.44, RelWithDebInfo, Ninja), RTX 5090:
xs_proxy_mock_test: PASS. The new check calls slot 127 with a hook installed and checks the following: one allocation of the PC size with the committed-resource attributes; the memory held while the resource lives and freed once, with the same attributes, on the lastRelease; a refusing hook (resource created, nothing freed); a PC failure (hook not asked); and no hook (unchanged).device_proxy_test: OK (0 failures).python -I scripts/check_no_game_data.py: OK.LEONIDA_D3D12=vulkan, locally merged with the boot-path PRs, including d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles #7021, d3d12_xs: Xbox device slot 70 is handled by the proxy (a null SRV for now, its raw words logged), not the PC CreatePlacedResource1 (retail boot chain stop 14) #7066, d3d12_xs: Xbox device slot 127 creates a committed resource through the PC CreateCommittedResource3 (retail boot chain stop 15) #7052, d3d12_xs: device slot 25 cleans the Xbox layout word and flag bits on a copy before the PC GetResourceAllocationInfo (retail boot chain stop 16) #7110 and d3d12_xs: GetResourceAllocationInfo answers console tile sizes for 2D render targets (slot 25 return-buffer form; sizes #7240 leases at stop 17) #7078): before, the stop 17 assert at 1,640 D3D12 calls. After, the hook allocates both targets and the boot goes on to the first root signature and compute pipeline.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code