Skip to content

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

Closed
tedin7 wants to merge 6 commits into
ProjectLeonida:mainfrom
tedin7:fast-slot70

Conversation

@tedin7

@tedin7 tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in #6910 (comment)

@ItsNotRexed: an exe PR, as you asked.

What

Xbox device slot 70 no longer reaches the PC slot 70. The d3d12_xs device proxy now handles it itself: (texture words, view desc, destination handle), no return value. The destination gets the PC null shader-resource view (CreateShaderResourceView with no resource and a valid 2D description), and the call returns. A null destination is a no-op. It is checked before the PC-vtable length refusal, so it holds on a PC device with or without ID3D12Device8.

Why

Stop 14 of the retail boot chain (#6982, section 3.6): the title's SRV writer calls device slot 70 to make a view from raw descriptions and a GPU address, with no resource object. On the PC, slot 70 is ID3D12Device8::CreatePlacedResource1, so forwarding by number treats the destination handle as a resource description and writes through it.

Limit: the layout of the raw words is not measured (#6982 says the same), so nothing reads them and the view does not reach the GPU address yet. The first call logs the three argument words so a trace can show the layout. Writing a real T# needs that layout. No exe bytes, addresses or IIDs are used.

Merge notes: independent of #6953 (slot 70 is inside the existing 128-slot table). With #7021 the destination must go through its CPU-handle translation; that is one line in proxy_create_srv_from_raw_x, to do in whichever of the two lands second. The slot 71 forwarding check in --env-slots-invalid replaces slot 70, which was only an arbitrary forwarded slot there.

Tested

Cross-built with clang-cl and run under Wine on the pod (xs_proxy_mock_test):

  • Before the fix (test only): fails at the new check, device && xs::device_slot_overridden(70); the exe exits non-zero.
  • After the fix: xs_proxy_mock_test: PASS; with a level-9 device (slot 70 exists on the PC) and a level-0 device (it doesn't) the mock's slot 70 is never called, its slot 18 is called once with no resource, a description and the destination handle; a null destination writes nothing.
  • The variants --fail-virtualalloc, --fail-virtualprotect, --fail-veh, --env-slots, --env-slots-invalid all exit 0.
  • device_proxy_test builds; it skips under Wine (no WARP adapter).
    Not run: MSVC, a GPU, or the retail executable.

AI-assisted: yes (Claude Code)

…ead of reaching PC CreatePlacedResource1 (retail boot chain stop 14)
@tikD1337

Copy link
Copy Markdown
Contributor

Request changes: the slot interception is sound, but the unconditional null-SRV fallback needs a narrower safety contract and native test evidence.

The change correctly intercepts Xbox device slot 70 before generic PC forwarding and the PC interface-length check. This prevents the three-argument Xbox call from reaching the unrelated, longer ID3D12Device8::CreatePlacedResource1 signature. Handling the slot independently of the real device’s interface level is appropriate: the implementation calls CreateShaderResourceView, which is available on the base PC device.

The slot name, dispatch branch, and device_slot_overridden(70) agree. The helper preserves the three argument positions, avoids dereferencing either unmeasured input, records the hit, and skips descriptor creation for a zero destination. Returning zero from the generic thunk is consistent with accommodating a void Xbox method; it should not be interpreted as an HRESULT success guarantee.

Findings requiring attention:

  1. [P2] A fixed Texture2D null descriptor does not guarantee zero reads for every SRV access.
    At runtime/shims/d3d12_xs_device.cpp:1233, every nonzero destination receives an R8G8B8A8_UNORM TEXTURE2D descriptor, regardless of texture_words or view_desc. The descriptor is a reasonable null 2D texture view: it has an explicit format, default component mapping, and one mip. Microsoft supports creating null descriptors with a null resource and a valid description. CreateShaderResourceView documentation.

    However, Microsoft explicitly limits defined null-binding behavior to compatible shader accesses. A descriptor dimension mismatch can produce undefined behavior, including device reset. Since the input layout is unmeasured, this implementation has not established compatibility with buffer, array, cube, or other accesses. The comment that a shader reads this view as zeros therefore overstates the guarantee. Null-descriptor requirements.

    Please establish and document the compatible view type for the supported calls, or constrain this fallback to an explicit boot-investigation mode until that information is available. Merely changing the comment would leave the unconditional substitution in normal execution. The missing GPU-address/resource mapping also means this remains a stand-in rather than implementation of the requested SRV.

  2. [P2] The cited measurement is absent from the referenced document.
    Both the implementation and header cite docs/retail_boot_chain.md, stop 14, as evidence for the Xbox call shape. In the reviewed checkout, that document ends at stop 13 and still identifies it as the current stop. Please add the corresponding sanitized measurement, or identify the prerequisite documentation PR and dependency. Record what was actually observed—argument positions, destination-handle provenance, and evidence for the void return—separately from the hypothesized SRV semantics. No executable bytes or raw game-derived descriptor contents are needed.

Regression coverage: check_slot70() adds useful assertions for Device9 and base-device mocks: neither forwards slot 70; both call PC slot 18 with a null resource and the unchanged destination; a zero destination produces no additional write; and references balance. Moving the forwarding sentinel to slot 71 is consistent with slot 70 becoming overridden.

The mock currently checks only that the description pointer is nonzero. Please copy the description inside the slot-18 mock while the call is active and assert its format, dimension, component mapping, and mip fields. Inspecting the recorded pointer after the helper returns would access an expired stack object. Such coverage would validate descriptor construction, although shader compatibility still requires separate evidence.

Verification without game files: the supplied Windows 11 / CPython 3.13 report records these passes:

Check Reported result
git diff --check PASS
Python compileall PASS
check_no_game_data.py PASS
make_game.py --help PASS

The targeted-test list is empty. Its All passed: True result provides no evidence that xs_proxy_mock_test compiled or executed. Before merge, provide an MSVC build and run the xs_proxy_mock CTest family, including the environment-slot variants affected by the forwarding-sentinel change. No GPU or game files are required for those mock tests. The supplied checks establish neither native C++ correctness nor successful retail boot progression.

Project adherence: the diff introduces no game assets, encryption bypass, or online-service access. The synthetic fixtures are appropriate. The logger records argument values once per slot, not the pointed-to descriptor contents; “raw words logged” should be understood accordingly. The routing correction follows fix-don’t-disable, but the null substitution must remain explicitly documented as incomplete SRV behavior. No shader-translator rule changes here, so a new translator-contract entry is not required.

AI-assisted.

…0 wins over the built-in slot 70 handler

With LEONIDA_XS_FRAME_INTERVAL_SLOT=70, (0, 16667, 1, 0) reached the null-SRV writer and sent latency 1 as the CPU descriptor handle. The routes now live in route_xbox_device_slot, which slot 70 asks first. New xs_proxy_mock_env_slots_70 test fails before and passes after.
@tedin7

tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the careful review. You were right.

Fixed in the new commit on this branch: with LEONIDA_XS_FRAME_INTERVAL_SLOT=70, slot 70 used to run the null shader-resource-view writer and take latency 1 from (0, 16667, 1, 0) as the CPU descriptor handle. The Xbox routes now sit in one helper, route_xbox_device_slot, and the slot 70 handler asks it first, so an override that moves a route onto 70 wins, as it did before this PR. Without an override, slot 70 is unchanged.

Test: new xs_proxy_mock_env_slots_70 (xs_proxy_mock_test --env-slots-70). It calls slot 70 with (0, 16667, 1, 0) and expects a frame-interval call with no CreateShaderResourceView (mock slot 18 count 0). On the previous commit it fails (exit 1, line 792). After the fix it passes. --env-slots, --env-slots-invalid and the default run also pass (default: PASS, 9 allocations refused on purpose), under Wine on a clang-cl cross build.

AI-assisted.

@dadsmallbuk1

Copy link
Copy Markdown

Tested d5c9490 natively (the native evidence @tikD1337 asked for) on NVIDIA GeForce RTX 5090, driver 617.42, Windows 11 (26200), MSVC 2022 RelWithDebInfo: pass.

  • ctest -R ^xs_proxy_mock: 7/7 pass, including the new xs_proxy_mock_env_slots_70.
  • With --env-slots-70, the log shows device slot 70 routed to SetFrameIntervalX (args 0x0 0x411b 0x1 0x0 0x0). The moved route wins over the built-in null-view writer, so the latency word is no longer used as a descriptor handle, which was the case raised in review.
  • Code read: the five existing routes moved into route_xbox_device_slot unchanged; the new handler writes only the PC null SRV into the destination it is given. Not checked: the retail title under gta6rt --run (stop 14 needs the earlier stops' stand-ins).

AI-assisted (Claude Code).

@jlric

jlric commented Nov 23, 2026

Copy link
Copy Markdown

Retail A/B on CachyOS / Wine 11.22, RTX 4070 (620.73.04), default slot routing. Before: slot 70 hit a write access violation. After adding the null-SRV handler from d5c949061 with #7021 CPU-handle translation, startup passed slot 70 and reached GetResourceAllocationInfo. Same local build otherwise. This verifies boot progression. AI-assisted testing.

@kapitche

Copy link
Copy Markdown
Collaborator

@tedin7 a data point for slot 70 from a local retail boot run (a merge of current main with several open boot-chain PRs; native Windows, RTX 4080 SUPER):

  • With slot 70 forwarded by number to the PC CreatePlacedResource1, the run ends in an access violation inside the runtime at the first slot-70 call. So the console's slot 70 is not the PC CreatePlacedResource1, as this PR says.
  • With a local stand-in that writes nothing and returns E_NOTIMPL, the title goes on past that point to the next stop (slot 127). So at least on this path the title doesn't check a return value, which fits your void reading. This doesn't show that a null SRV is enough for later frames.

I'm leaving slot 70 to this PR.

@eugen1763

Copy link
Copy Markdown

I measured the first retail slot-70 call on a local Windows 11 / Vulkan integration stack. It is a raw buffer SRV: the first argument starts with the desktop D3D12_RESOURCE_DESC layout (buffer), and the second starts with the desktop D3D12_SHADER_RESOURCE_VIEW_DESC layout (R32_TYPELESS, buffer dimension, RAW flag). A D3D12_GPU_VIRTUAL_ADDRESS immediately after the desktop view description is the same console VA that the preceding slot-133 call registered. The third argument is the CPU destination and needs #7021 translation.

I tested writing a genuine GFX10 raw V# for that registered range, using the existing Vulkan buffer index and descriptor encoder rather than a null view. The run recorded one successful slot-70 descriptor write, then advanced to the unhandled slot 127 after 1,632 D3D12 trace records. This confirms descriptor creation, not shader reads from that VA (the shader address-space limitation in #7218 still applies). No assumptions about texture views from this one call. Leaving the slot with this PR rather than opening a duplicate.

AI-assisted (Codex).

…sured raw-buffer shape and the VA is a buffer the layer knows (retail boot chain stop 14)

AI-assisted.
@kormocicsaba

Copy link
Copy Markdown

Tested d5c949061, merged alone into main 8575d36: pass. 258/260, baseline only.

Setup: RTX 4070 (driver 621.01), Windows 11 Pro 26300, MSVC (VS 18) RelWithDebInfo with Ninja, Vulkan SDK 1.4.363.0. The PR head was merged alone into main 8575d36 and runtime/ was built. I ran the full ctest -j8 --timeout 300; no game files were used.
Baseline on main: d3d12_vulkan_device and d3d12_indirect_dispatch_count fail on main 8575d36 as well. d3d12_bindless_churn fails now and then under -j8 on main too: it failed in main's -j8 run and passed 3 of 3 times run alone there.

AI-assisted review (Claude Code). How this compares with the other boot-chain PRs: #7333 (comment)

…and asks for a buffer that holds the whole width (review of the raw view)

AI-assisted.
@tedin7

tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @eugen1763, that measurement was exactly what slot 70 needed.

New commits on this branch (9c8522d and the one after it) use your shape. When arg1 starts with a buffer D3D12_RESOURCE_DESC and arg2 starts with a raw R32_TYPELESS buffer SRV description followed by the D3D12_GPU_VIRTUAL_ADDRESS, slot 70 now looks the VA up in the layer's buffer index (the same index vertex and index views use). If a buffer holds it, the destination gets a raw view of that resource with FirstElement = (VA - resource start) / 4 and NumElements = Width / 4, cut at the end of the resource. Any other shape, or a VA no buffer holds, keeps the null SRV, with one log line saying why.

  • Not done here: the CPU destination is still written as given. The hook point is marked in proxy_create_srv_from_raw_x, so d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles #7021's handle translation goes there.
  • Review found two real problems, both fixed: the resource reference is now taken under the registry lock (new Object::try_add_ref, so a resource being destroyed is skipped), and the lookup asks for a buffer that holds the whole width, so a shorter placed alias does not truncate the view.
  • Test: xs_proxy_mock_test now has check_slot70_raw_buffer. It checks the resource, FirstElement 0x10, NumElements 0x40 and the RAW flag, a width cut at the buffer end, an unknown VA, a non-raw view, a texture description and no provider (all null view), and balanced references. It also copies the description inside the slot-18 mock, as asked earlier. On the previous head (with a stub setter) it fails at line 917; with the change it passes. Wine on a clang-cl cross build: default run PASS, --env-slots, --env-slots-invalid, --env-slots-70 exit 0, and gta6rt_d3d12_com builds.
  • Not checked: the retail run, shader reads from that VA (d3d12_xs: device slot 133 (CreatePlacedResourceX) makes a buffer on the title's own pages (VK_EXT_external_memory_host) #7218), and a native MSVC run.

AI-assisted.

@Zunraz

Zunraz commented Nov 23, 2026

Copy link
Copy Markdown

Independent native Windows/Vulkan integration test of 1d8d1d355d9b37ac1fb88103433f88d2d0975a52.

On the same startup integration as my #7021 report (main 8575d36ed, TLS/XMem/DirectStorage, #6964, #7037, #7076, #6953, #7218 310773a01, #7021, #6991 and RT-488 cache change), adding this head clears the host CreatePlacedResource1 write fault at the old slot-70 frontier. The run reaches 1,632 traced D3D12 calls; the next access violation symbolizes to proxy_slot<25> (GetResourceAllocationInfo), a separate known struct-return ABI issue. No frame/menu.

Local combination resolutions explicitly kept #7037's proxy_create_command_queue_x in the new route helper, and wired #7021 at the marked destination hook:
destination = translate_cpu_descriptor_handle(self, D3D12_CPU_DESCRIPTOR_HANDLE{static_cast<SIZE_T>(destination)}).ptr;
The existing #7218 fallback does not share the title's pages; boot progress must not be read as validation of shader access to those pages.

Mocks: all seven modes pass (default, three guard-setup failure modes, normal/invalid env routes, and --env-slots-70) after fixing one test-fixture interaction with #7021. Its heap translation case passes made-up SRV-description address 0x33; this PR's new slot-18 snapshot correctly tries to copy it, so the combined test initially AVs in mock_call's memcpy. Replacing that sentinel with a readable synthetic null-SRV description makes all seven modes pass. Reusable test-only change on #7021: Zunraz@14a176d32 . This fixes the fixture, not production descriptor parsing; I did not disable the snapshot or any assertion.

Windows 26300, RTX 5090 / driver 32.0.16.2124; clang-cl 21.1.8 + xwin SDK 10.0.26100, static CRT. Vulkan validation unavailable locally. Retail socket creation, DNS and transmission debugger-guarded. Outcomes only, no game files, traces, addresses or title offsets attached. AI-assisted (Codex).

@zohaiblazuli

Copy link
Copy Markdown

Tested d5c949061 on the retail executable (before the latest push): pass.

Retail Xbox Series 1.0.2.1 package + executable (sizes match game/xbox-1.0.2.1.json), Windows 11 10.0.26300, MSVC 14.50, GeForce RTX 3060 (driver 32.0.16.1742). Vulkan backend (LEONIDA_D3D12=vulkan, Vulkan SDK 1.4.363). gta6rt --run with --overlay to a scratch folder, outbound network blocked, LEONIDA_UNIMPLEMENTED=stop. Base: main 8575d36ed plus my local console-queue-flag and struct-return (slots 25/26/43) changes, with these PRs merged in this order: #6953, #7187, #7076, #7075, #7021, #7066, #7235 (which carries #7052). Conflicts resolved locally.

Outcomes only; no game data.

@tedin7

tedin7 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @pvfreis. Added a test-only commit 8e7000800: slot 18 with a non-pointer second argument (0x33, as #7021 passes) no longer crashes the mock. xs_proxy_mock passes on p2. The #6954 queue_x note from @XIIYAZ depends on a PR that is not in this branch, so it is left for after #6954 lands.

@pvfreis

pvfreis commented Nov 23, 2026

Copy link
Copy Markdown

checked: #70668e70008 | with: xs_proxy_mock_test, ctest -R "xs_proxy_mock" | on: Windows 11 26H2 (26300), MSVC 19.44.35229 (v143) + Ninja, RelWithDebInfo, RTX 3060 617.14 | result: pass, 7/7
negative control: slot == 70 || removed from device_slot_overridden in d3d12_xs_device.cpp (a full revert doesn't compile, the test uses set_device_resource_provider) | result: xs_proxy_mock fails at line 888 (device_slot_overridden(70)), so the tests catch the change
note: the mock's slot-18 copy is now guarded (a2 > 0xFFFF) and covered by the new small-token case, so the crash seen when this is merged with #7021 is gone

AI-assisted (Claude Code).

@seblessa

Copy link
Copy Markdown
Contributor

An offer for the "null SRV for now" part, not a competing PR. Our variant goes one step further: seblessa@db87c36b4

Measured statically at the six retail call sites (no code run): slot 70 creates an SRV from a GPU virtual address with no resource object. The arguments are (const D3D12_RESOURCE_DESC*, a 64-byte view desc, destination). The view desc is the PC SRV desc (40 bytes), plus the buffer VA at +0x28, a GFX10 format code and two more words. The title ignores RAX.

The variant has slot 133 (CreatePlacedResourceX) register each committed stand-in under the title's VA. Slot 70 then looks the view's VA up: if it falls inside a stand-in buffer, it creates the PC CreateShaderResourceView on that resource with FirstElement adjusted to the offset; otherwise it writes a null descriptor and logs once, as this PR does. While the stand-ins aren't tied to the VA, the view has the right shape but not the title's data, until there's a page mapper.

On our boots (RTX 4080 SUPER, driver 617.42), with #7240 the slot-70 calls go through, and the boot reaches stops 18–20. Fold it in if it's useful. We're stopping active work.

AI-assisted (Claude Code).

@seblessa

Copy link
Copy Markdown
Contributor

Correction to my comment above: #8304 already adds the slot-133 lookup on top of this PR, so most of our variant duplicates it. The only extras in ours are structured buffer views (FirstElement moves by the offset divided by StructureByteStride, or by 4 for a raw view) and accepting a texture view only when the VA is the resource's start. Take those only if they help; otherwise please ignore it.

@SirKingg

Copy link
Copy Markdown
Contributor

Independent Windows/MSVC check of head 8e70008 in a temporary integration with #7880 and its boot dependencies, translating the slot-70 CPU destination through the descriptor-heap mapping: 13/13 targeted CTest cases passed, including slot-70 mock and route-override variants.

In Windows Sandbox with networking disabled and guest network checks, dry-run and init passed. The retail run progressed beyond slot 70, logged a real raw-buffer view for the observed call (no null-view or fallback log observed), and reached 1,632 D3D12 trace events: 1,618 ok, 14 called. It then stopped on a host read access violation after the first device slot 25; #6973/#7078/#7110 already cover that path. This is one integration experiment, not proof of correct rendering or retail CPU/GPU coherence.

@hammokko

Copy link
Copy Markdown

Integration notes from a local stack of #7066 with #7021, #6954 and #7076 (plus the other boot PRs up to #7110/#7052), on the retail 1.0.2.1 boot. AI-assisted (Claude), checked by building and running, not by reading only.

Three things surfaced when #7066 is combined with them. None shows on #7066 alone:

  1. Slot 70's destination is not translated once d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles #7021 is in. proxy_create_srv_from_raw_x writes to the title's CPU handle as given; with d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles #7021 that handle lies in the title's own heap range and slots 17-24 translate it, but both writes here (write_null_srv and the raw-buffer view) pass it untranslated. Filling the hook you left (// Translating it (#7021) goes here) with
    destination = translate_cpu_handle(self, D3D12_CPU_DESCRIPTOR_HANDLE{static_cast<SIZE_T>(destination)}).ptr;
    fixes it. A regression check in d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles #7021's check_descriptor_heap_hooks (slot 70 with a destination at kCustomBase + off7 must reach the mock's slot 18 at kMockHeapCpuStart + off7) fails without the line and passes with it.
  2. route_xbox_device_slot routes queue_x to proxy_create_command_queue. Next to d3d12_xs: Xbox device slot 48 creates a command queue from its 32-byte description #6954 that drops its 32-byte description handler (proxy_create_command_queue_xbox); xs_proxy_mock's check_slot48 then fails at the queue_desc check. Calling proxy_create_command_queue_xbox from the route restores it.
  3. Test clash with d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles #7021: the new mock copies the SRV description on every device slot 18 call (std::memcpy(&m->srv, a2, ...)), and d3d12_xs: honour __XMemAllocationHooks__ for descriptor heaps and translate CPU handles #7021's check_descriptor_heap_hooks passes 0x33 as that pointer, so xs_proxy_mock_test segfaults when both are merged. Passing a real D3D12_SHADER_RESOURCE_VIEW_DESC there fixes it.

With the three changes: runtime build OK, 51/51 related ctest pass (loader, TLS, DStorage, GDK, xmem, proxy, run_tiny_frame), and the retail boot goes past slot 70 (null view, no buffer at the address without #7218/#8304) to slot 25 as in the boot chain. Windows 11 26200, RTX 5060 (driver 32.0.16.2124), MSVC 14.44 RelWithDebInfo, LEONIDA_D3D12=vulkan, network blocked.

@EdouardSence

Copy link
Copy Markdown
Contributor

Merge note from an integration run (retail executable, Wine 11.22, AMD RX 9070 XT / RADV; numbers in #7232). With #6954 also applied, this PR passes stop 14 on that machine: the boot goes from 1,198 to 1,632 D3D12 calls with none failed.

One thing to watch when this and #6954 both land. This PR moves the Xbox routes into route_xbox_device_slot(), and that function's routes.queue_x branch still calls proxy_create_command_queue(self, reinterpret_cast<const D3D12_COMMAND_QUEUE_DESC*>(a1), ...), which is the cast #6954 replaces with proxy_create_command_queue_xbox(self, reinterpret_cast<const std::uint32_t*>(a1), ...). In my merge the generic thunk's inline routing (which #6954 updates) runs first, so the default slot 48 was fine. But the slot-70 handler calls route_xbox_device_slot() first ("an override moved a route here"), so a route override that sends 48 through it would bring back stop 8 (CreateCommandQueue refused … type 2). Whichever of the two lands second should update both call sites.

AI-assisted (Claude Code), run and checked by me.

dadnotdaddy pushed a commit to dadnotdaddy/Leonida that referenced this pull request Nov 23, 2026
…d by the proxy (a null SRV for now, its raw words logged), not the PC CreatePlacedResource1 (retail boot chain stop 14)

Squashed from ItsNotRexed#7066 by tedin7, head 1d8d1d3 (security scan PASS).

Conflicts with ItsNotRexed#6964/ItsNotRexed#7218/ItsNotRexed#6954: slot 26, slot 133 and this PR's route_xbox_device_slot helper all kept; the helper's queue route calls ItsNotRexed#6954's proxy_create_command_queue_xbox (32-byte description) instead of the slot-8 path it was written against. device_slot_overridden, the header and the mock test's check list take the union.
dadnotdaddy pushed a commit to dadnotdaddy/Leonida that referenced this pull request Nov 23, 2026
…_ for descriptor heaps and translate CPU handles

Squashed from ItsNotRexed#7021 by Khuraie, head 355201c (security scan PASS).

CONFLICTING upstream. registry.cpp: main (Wave 0, ItsNotRexed#7175) replaced the bundled-loader function-local statics with a constant-initialized SRWLOCK and a global pointer; this PR's XMem hook list used the old function-local-static pattern, so it now follows main's SRWLOCK pattern too (function-local static guards fault under the clang-cl static CRT on Wine). d3d12_xs_device.cpp/.h: slot names, device_slot_overridden and the header list take the union with slots 25/26/48/56/70/133. xs_proxy_mock_test: Kind enum keeps command_list and heap; the slot-18 call of check_descriptor_heap_hooks passes a null view description instead of the placeholder 0x33, which ItsNotRexed#7066's mock now copies from (an access violation reviewers reported for this combination).
dadnotdaddy pushed a commit to dadnotdaddy/Leonida that referenced this pull request Nov 23, 2026
…SamplerX, routed to the PC CreateSampler (RT-5 stop 20)

Squashed from ItsNotRexed#7115 by mrp1no, head e229944 (security scan PASS).

Conflicts: slot names, device_slot_overridden, the header overview and the mock test's section header take the union with the earlier slots. Reviewers noted the slot-61 destination handle is untranslated once ItsNotRexed#7021 is in; it now goes through ItsNotRexed#7021's translate_cpu_handle, and so does slot 70's destination (ItsNotRexed#7066 left a marked hook point for it).
dadnotdaddy pushed a commit to dadnotdaddy/Leonida that referenced this pull request Nov 23, 2026
…_OK in the proxy and never reaches the PC ShaderCacheControl (retail boot, after stop 20)

Squashed from ItsNotRexed#7323 by tedin7, head a30e78e (security scan PASS).

This PR and ItsNotRexed#7066 each add route_xbox_device_slot; ItsNotRexed#7066's copy is kept (with its queue route on ItsNotRexed#6954's 32-byte path, as reviewers asked for both PRs) and this PR's copy is dropped. run_env_slots takes both on_slot70 and on_slot74; CMake keeps both env-slot tests; check_slot74 sits after ItsNotRexed#7066's slot-70 checks; slot lists take the union.
Impre-visible pushed a commit to Impre-visible/Leonida that referenced this pull request Nov 23, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.