d3d12_xs: device slots 127 (CreateCommittedResource3) and 133 (CreatePlacedResourceX with a resource desc 1) for GXDK 2504+ callers #335
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!335
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/335/head"
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?
@GDAgent on GitHub · 2026-11-23 20:24 UTC · original
GDAgent:fix/d3d12-device-slots-127-133→main· +642 −3 · 4 files · 2 commits · closed without mergingBuilds on #334 (
cl_edition.rs: caller-edition detection). Stacked on it: only the last commit (2a9c3ed) belongs to this PR; please reviewgit diff 18a07ac..until #334 lands, then I will rebase ontomain.What
Newer GDK titles create their resources through two device methods that
mainanswers with the genericE_NOTIMPLstub:CreatePlacedResourceX, new form. Same as the existing slot 44 but the description is aD3D12_RESOURCE_DESC1(its first fields are identical toD3D12_RESOURCE_DESC, so it is passed through unchanged) and the initial-state argument is a barrier layout instead of a resource state.CreateCommittedResource3: heap properties, heap flags,D3D12_RESOURCE_DESC1, barrier layout, optional clear value, optional protected session, castable-format list, riid, out pointer.Both are routed through the existing PC-layout creation paths (
create_placed_resource_x,create_committed_resource), so all current placed/committed fixups apply. The barrier layout becomes a legacy resource state throughlayout_state(generic read 0xac3, render target 4, UAV 8, depth write 0x10 / read 0x20, shader resource 0xc0, copy source 0x800, copy dest 0x400, resolve source 0x2000 / dest 0x1000, shading-rate source 0x1000000; the direct-queue and compute-queue variants map the same way; common, present, undefined and layouts without a legacy state map to common, 0).Routing uses the caller's GXDK edition from #334: 2504+ callers get the new meaning; older callers go to the handler that was registered before this layer, and with none,
E_NOTIMPL(as before this change; no success is faked). The protected-session and castable-format arguments are not applied on the legacy path; when a caller passes either, the call is logged with that fact.Why / evidence
A very popular AAA title built with a 2504+ GDK reaches both calls right after list creation. In native Windows 11 runs (not run under Proton), calls to slot 133 and then slot 127 came back with an unlogged
E_NOTIMPLand stopped the title's GPU-memory setup; with this change both create the resources (hr=0) and the title proceeds to descriptor-heap creation. The next blocker in that title (descriptor heaps placed at title-chosen addresses) is a separate topic and not addressed here. The argument order was read from the title's call sites; the barrier-layout values followD3D12_BARRIER_LAYOUT.I did not add the log-and-
E_NOTIMPLstubs for device slots 91-159 and the log-and-return-0 probes for list slots 128-159 that I used while finding these slots:mainalready returnsE_NOTIMPLfor unmapped device slots, and a probe that returns 0 would claim success.Tests
cargo test -p d3d12_xs --lib cl_edition(generic, no title data), added by this PR:E_NOTIMPL, creation function not called;13 passed (9 from #334, 4 new).
TOMBOX_REMOVED_EXIT_MS=off cargo test -p d3d12_xs --lib -- --test-threads=1on this branch: 677 passed, 4 failed, 71 ignored; the 4 are the same pre-existing failures listed in #334. Native Windows 11; not run under Proton.Not verified
D3D12_RESOURCE_DESC1's extra field (sampler-feedback mip region) is ignored; no sampler-feedback resource has been created through this path.D3D12_BARRIER_LAYOUTdocumentation, and only the layouts of the one title above were exercised.@omonkeyz on GitHub · 2026-11-25 13:50 UTC · original
Applied on main in
495cadf(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed