HLE: implement mfplat.dll!MFResetDXGIDeviceManagerX with system fallback #22
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!22
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/22/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?
@raylitebull on GitHub · 2026-11-21 21:57 UTC · original
raylitebull:mfplat-reset-dxgi→main· +438 −0 · 4 files · 1 commits · merged 2026-11-21 22:54 UTCSummary
Implements the Xbox GDK Media Foundation helper
mfplat.dll!MFResetDXGIDeviceManagerXwith transparent system fallback for all standard Media Foundation exports.Changes
crates/xcl/src/hle/mfplat.rs:MFResetDXGIDeviceManagerX(pDeviceManager, pDevice, resetToken) -> HRESULTusing the typedwindows::Win32::Media::MediaFoundation::IMFDXGIDeviceManagerCOM interface (borrowing caller-owned pointers withManuallyDrop).E_POINTER) and attemptsIMFDXGIDeviceManager::ResetDevicedirectly first (which succeeds natively forID3D12Deviceon Windows 11 and preservesE_INVALIDARGfor invalid reset tokens).ResetDevicefails for anID3D12Device, creates a companion D3D11 device (dynamically loaded fromd3d11.dll) on the matching adapter LUID withVIDEO_SUPPORT | BGRA_SUPPORTandID3D10Multithread::SetMultithreadProtected(TRUE), then passes it toResetDevicewith the caller'sresetToken.LoadLibrary+GetProcAddress, null pointer handling, invalid token rejection, realID3D12Devicereset +OpenDeviceHandle/TestDevice/CloseDeviceHandle, and the companion D3D11 bridge path.crates/xcl/src/hle/mod.rs:MFPLAT(mfplat.dll) with system fallback&[mfplat.dll](aliases_are_system() == false), so standard exports (MFStartup,MFCreateDXGIDeviceManager,MFCreateMediaType, etc.) resolve to Windows'mfplat.dllwhileMFResetDXGIDeviceManagerXresolves to XCL's HLE export andhle::opusdynamic loading remains unchanged.tests/testtitle/src/gpu.rs&tests/testtitle/src/main.rs:MFStartup,MFCreateDXGIDeviceManager,MFShutdown, andMFResetDXGIDeviceManagerXfrommfplat.dllagainst the consoled3d12_xsdevice.Verification
cargo build --workspace: 0 new warningscargo test --workspace -- --test-threads=4: all tests passed (243 lib unit tests, 12console_dlls_e2e, 1console_shaders, 1e2eincluding the newtesttitlecheck, 6gpu_pso_e2e, 3xg_oracle).@ivall on GitHub · 2026-11-21 22:54 UTC · original
Reviewed and merged, thanks. It conflicted with #20 in
tests/testtitle/src/main.rs(both added a check line); I merged it on main keeping both lines (your MFPlat check and the XMA2 + Opus XAudio2 line). Checked together with #21, #22 and #25 on top of current main: full workspace tests pass (277 lib tests, e2e, console_dlls_e2e, gpu_pso_e2e, rpf_e2e), no new build warnings.