Debug tracing: XCL_D3D12_TRACE shows the arguments, XCL_TRACE_IMPORTS logs every HLE import call with its result #187
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/190"
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?
Imported from ivall/xcl. Originally posted by gbuyssens on 2026-11-23T20:00:58Z.
Tooling only, off by default; no change to a title's run without the variables.
XCL_D3D12_TRACE=1 lines carry the arguments: the three register arguments after this, two stack arguments, and what a pointer argument points at (the first words – a descriptor, the hidden return slot of a struct-returning method; a string when it reads like one). The thunk passes its stack frame to the logger (mov r8, rsp); still a tail jump, so the slot splits keep classifying by the caller's return address.
XCL_TRACE_IMPORTS=1 (guard::make_call_tracer, resolver::trace_filter): every import of the title that resolves to an HLE function is wrapped in a call-through thunk → trace: dll!Function ← module+offset: (args) → result. The thunk keeps the register arguments, forwards eight stack arguments, calls the original and logs when it returns; it registers unwind info (RtlAddFunctionTable) so an exception raised inside unwinds through it. all wraps system imports too (short runs – a data export would be wrapped as well); kernelx!Create,-kernelx!GetTickCount are include / exclude prefixes of dll!Function. Stubs are left alone (they log themselves).
Refused interfaces are logged: QueryInterface on an XGameRuntime object and on the DirectStorage factory / queue / file names the IID (how the newer DirectStorage factory IID was found).
Why: during a bring-up the question is usually "which call returned 0 just before the assert" – the D3D12 trace showed the device calls but nothing of kernelx / XGameRuntime / GameInput.
Test: call_tracer_forwards_arguments_and_results (integer, stack and floating-point arguments; integer and floating-point results) next to the existing guard tests. cargo test -p xcl guard on Windows.
upstream-sync referenced this pull request2026-11-24 06:57:41 +00:00
upstream-sync referenced this pull request2026-11-24 06:57:54 +00:00
Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T21:09:19Z.
Merged (main
6da33fa). Checked on an RX 9070 (RDNA4) with the 22 PRs merged together on maineaa36b6:cargo build --workspace && cargo test --workspace -- --test-threads=4- 582 unit tests passed, 0 failed (20 ignored), the integration and e2e tests passed too; and the retail game still reaches its first menu (646 frames in 30 s, no device removal).mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #172mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #172