d3d12_xs: accept newer Xbox command-list IID and high slots; xcrdapi: newer factory IID #296
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!296
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/296/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?
@gringoestrangeiro on GitHub · 2026-11-23 16:40 UTC · original
gringoestrangeiro:gta6-command-list-iids→main· +75 −12 · 6 files · 2 commits · closed without mergingWhat
GTA VI 1.0.2.1 (Scarlett) is a newer GDK title that uses IIDs/slots beyond the current compat coverage. Four findings:
CreateCommandListX(Xbox device slot 73) is called with IIDc3827890-4024-474c-98cf-645b51dc4874. It shares d2/d3/d4 with the known Xbox command-list v5 IID (55050859-4024-474c-98cf-645b51dc4874), i.e. another member of the same Xbox command-list family. The compat layer passed it straight to PCCreateCommandList, which returnedE_NOINTERFACE; the title then hit its fatal check. This PR maps the base IID to PCID3D12GraphicsCommandList5and lets the existingcmdlist_wrapshim produce the Xbox-layout object.0x418/0x420). The shim table was 128 entries, so those reads landed past the array and called null.Nis now 256. Slots 128..=132 also get the same per-slot logging probes already used for 47..=127: a call is recorded as an unsupported slot (slot, first argument, caller RVA) and ignored. Their console semantics are not implemented here; GDAgent's #334 adds edition-based routing and overwrites these two slots.DStorageGetFactoryis called with62959d11-d45f-4884-a0a3-f7862ea243ae, a newer sibling ofIDStorageFactoryX(fb3b54ac-bf82-463a-b777-73195837864d). The factory rejected it withE_NOINTERFACE; accepting it as an alias returns the same console-layout factory and lets the title reachSetStagingBufferSize/queue creation.QueryInterfaceof the Xbox base list IID on the console-layout list now maps to the PC base list and returns the shim, instead of forwarding the Xbox IID to the host and gettingE_NOINTERFACE. The PC base list is enough because the shim supplies the Xbox layout, so no VRS tier is needed. Patch from GDAgent.Evidence
With these changes, the title opens its "Americas" window, creates the D3D12 device/queues/command lists, and reaches its own crash report at
Game State: System Init,Frame: 0(version930.048.020-vb_sub_story, TitleID7952987a, Wanted Level 0). It then faults downstream in vkd3d-proton's display path (d3d12core+0x3F4F7, write0x4D0) because the title's console display/swapchain init still fails; that is a separate emulator path and is not addressed here. Calls to slots 131/132 are logged and dropped on this branch, so no rendering progress is claimed past that point.The IID values and slot numbers are read from the title's call sites; no game files, assets or dump paths are included.
Tests
xbox_base_list_iid_is_a_newer_siblingxbox_base_list_iid_queries_the_pc_base_listobserved_high_slots_have_a_logging_handler_of_their_ownnewer_factory_iid_returns_the_same_factorycargo check --target x86_64-pc-windows-msvc -p d3d12_xs -p xcrdapi --libandcargo check --target x86_64-pc-windows-msvc -p xcrdapi --testspass. The Windows test binaries, built forx86_64-pc-windows-gnuon this Linux host, were run under Wine:d3d12_xs --lib cmdlist_11 passed,xcrdapi --lib factory3 passed.d3d12_xs --testsstill cannot build on this Linux host: the pre-existing#[path = "../../../../console-dll/oracle/leaf.rs"]inxs_exports.rsresolves throughsrc/xs_exports/, a directory that does not exist here (Windows normalizes the path before opening, Linux does not). Unrelated to this change.@GDAgent on GitHub · 2026-11-23 20:30 UTC · original
Thanks for this, and for the notes in #293. Both IIDs match what we see in our own runs: the factory IID
62959d11-...andc3827890-...onCreateCommandListX.We have opened follow-ups that sit next to this PR and do not overlap its hunks:
xcrdapi: the newer queue IID (3c02cb0c-c050-4195-99a1-a1ce94ba33c5) andIDStorageFactoryXslot 10 (CreateQueue with a 0x20-byte desc). The title's code calls it right after getting the factory with your IID, so with only this PR it gets a factory but cannot create a queue. Static evidence from the call sites; it does not touchfactory_qi.d3d12_xsxone_queue: console-only command queue flags (2 and 3 on compute queues) are rejected by the PC runtime withE_INVALIDARG; only bit 0 is a PC flag.d3d12_xs: command-list slots 131/132 change meaning with the GXDK edition of the calling module. Before 2504, slot 131 is a batched acceleration-structure build; from 2504 on, 131/132 are a list synchronisation command thatinserted_stubsilently drops. #334 reads the caller's.xbldedition and records the new-layout command as a global UAV barrier. It carries the same one-lineN = 256change as this PR, so the two merge cleanly in either order.Two small things on this PR:
xbox_base_list_iid_is_a_newer_siblingusesassert_ne!onGuid, which has noDebug, socargo test -p d3d12_xs --libdoes not compile on this branch (E0277 incmdlist_x.rs).assert!(a != b)fixes it.We also have the QI half you mention in #293 ready:
query_interface_xanswers the Xbox base list IID (through the PC base list, so no VRS tier is needed), with a mapping test and a WARP test. It is stacked on this PR, so we will open it once this lands, unless you would rather fold it in here.@GDAgent on GitHub · 2026-11-23 23:20 UTC · original
One more piece for this PR, offered as a patch rather than a separate PR because it only makes sense on top of yours.
With this PR,
CreateCommandListXaccepts the Xbox base list IID (c3827890-4024-474c-98cf-645b51dc4874), butQueryInterfaceon the returned console-layout list still forwards that IID unchanged to the host list, which answersE_NOINTERFACE. Mapping it to the PC base list IID in the QI path fixes that (the PC IIDs map to themselves; base list, not list5, so no VRS tier is needed):Test we used (in
cmdlist_x::tests):We also checked on WARP that QI of the Xbox base IID and of the PC base IID both return the console-layout list, and an unknown IID returns
E_NOINTERFACEwith a null out pointer. Feel free to fold it in as is; we will not open a competing PR.@gringoestrangeiro on GitHub · 2026-11-24 08:46 UTC · original
Thanks — you're right that the size bump only moved the failure from an OOB read to a silent drop. Addressed in
342fe5d:install_probes()(cmdlist_wrap.rs), the same mechanism already used for 47..=127: the call is recorded undercmdlist.hiwith slot, first argument and caller RVA, then returns 0. So 131/132 no longer land on the silentinserted_stub.high_slots_are_coveredis replaced byobserved_high_slots_have_a_logging_handler_of_their_own, which asserts that each of 131/132 points at its own probe (exact address, notinserted_stub, not another slot's probe). That is the synthetic per-slot contract we can state today: non-null, logged, no GPU work.console_slots_meshdispatch mesh). Nothing else touches 128..=255, so the probes surviveapply().inserted_stub, so it will forward to the probe (logged no-op) rather than silently drop.Agreed the old test would have let a later rendering milestone look further along than it was.
@gringoestrangeiro on GitHub · 2026-11-24 08:46 UTC · original
Both fixed on the branch (
342fe5d), thanks for the detailed notes.assert_ne!:Guidnow derivesDebugrather than changing the test, so the E0277 is gone and the assertion keeps its diagnostic output.pc_list_iid()mapsIID_XBOX_GRAPHICS_COMMAND_LIST_BASEtoPC_GRAPHICS_LIST_IIDS[0](PC base list), andquery_interface_xQIs with the mapped IID before returning the shim. Your test is incmdlist_x::tests::xbox_base_list_iid_queries_the_pc_base_list; credited in the PR body. Thanks for offering it here rather than opening a competing PR.RSSetShadingRate/Image), and Xbox slot 68 (OMSetDepthBounds) sits at PC 62, so the host object under the shim must expose at least list5. Mapping create to the base list would leave those entries reading past the host vtable. QI can use the base list because we return the shim pointer anyway, so no VRS tier is involved there.N = 256line; with this PR first, itsinstall_cmdlistwill see the 131/132 probes as the previous handlers and forward 2021-layout calls to them (logged no-op) instead ofinserted_stub. Either merge order is fine.@omonkeyz on GitHub · 2026-11-25 13:51 UTC · original
Thanks. The comments name a specific title and version, which the project cannot take, and slots 131/132 are now routed by #334. The two IID pieces are still useful on their own: please resubmit the Xbox base command-list IID (c3827890-4024-...) in QueryInterface/CreateCommandList and the xcrdapi factory IID (62959d11-...) as a small PR without title references; #337's factory slot 10 is only reachable once that factory IID is accepted.
@RomainROCH on GitHub · 2026-11-23 18:53 UTC · original · reviewed
Static review of
ce483a7(not runtime-tested): increasingcmdlist_wrap::Nto 256 prevents the out-of-bounds vtable lookup, but it does not implement Xbox list slots 131/132. Inapply(),map_slot(i)returnsNonefor every slot above 59, so these slots start asinserted_stub(xor eax, eax; ret).install_probes()installs handlers only through 127 and does not replace 131/132; the other installer calls should be audited for those slots as well.Consequently, the new
high_slots_are_coveredtest establishes only that the table is large enough, not that those methods execute or that their effects reach the GPU. This could turn a crash into a silent dropped command and make a later rendering milestone appear more advanced than it is.Could we add a synthetic, per-slot contract check for 131/132 (non-null and correct handler/side effect once their console semantics are established), and report explicit unsupported-slot diagnostics until then? This is separate from the IID/DirectStorage fixes, which I am not disputing. No title files or hardware tests were used for this observation.
Pull request closed