Repository navigation
d3d12x: implement KickoffX, Wait32/64BitValueX, and RSSetDepthBiasX - #23
Conversation
|
Transparency note on what is grounded vs. inferred in this PR, since this touches the D3D12.X submission path and was written without a real console executable or live capture: What is grounded in the repo
What was inferred and needs verification against real title call sites
Happy to adjust any signatures once checked against a real trace, keep parts behind a flag/opt-in, or trim this down if you'd rather keep these slots as logged no-ops until real call sites are observed. |
|
you're amazing man, keep it up just don't burn yourself out 😭 |
9a3f9f4 to
3dfbcfb
Compare
|
Merged in 7e74038 (conflicts with main resolved by hand), thanks. One change on top: KickoffX resets the PC list mid-recording, and the Reset also clears state the title had set and keeps using afterwards - descriptor heaps, topology, viewports, scissors, blend factor, stencil ref, vertex buffers, render targets. On the console a kickoff leaves the list as it was. Without the heaps, a translated draw or dispatch after a kickoff indexes whatever heap is bound (garbage descriptors). That state is now tracked per list (console #20-#24, #32, #48, OMSetRenderTargets) and set again right after the Reset ( |
…ads, console heaps and resources, merged ES+GS - Run from <Game>/Binaries/XSX: the package root is the folder above whose MicrosoftGame.config names the exe. - XMemGetWorkingSetStatistics writes only the limit and the use (the structure differs between GDK versions; zeroing 0x78 bytes broke EOSSDK's stack cookie). - The title's executable takes TLS slot 0, as a process's executable has it (code built with /GA reads it without _tls_index); xcl.exe's TLS moves. - Command queue #23 SignalX. - Title textures: the first upload waits for the title's next submit and all uploads go in batches (one list, one wait); XCL's own submits do not refresh; close write-watch ranges are scanned as one. The render thread no longer stalls in CreatePlacedResourceX (UE's garbage collector ended the game after 10 s). - CreateHeap and CreatePlacedResource (#29) with console flags / layouts retried the PC's way. - Merged ES+GS of older kits: an ES program ends with s_setpc_b64 into the GS. - end_title suspends the title's threads before releasing its fences (a running title reset command allocators the GPU still ran: device hang at the end). - Diagnostics: stack-cookie failures reported with the function, the CRT's invalid-parameter handler, first-chance C++ exceptions of title code, THREADNAME_INFO, XCL_THREAD_DUMP_AT (unwound stacks), XCL_ACTIVITY. - HANDOFF: Fortnite's state (splash screen; the login is an Xbox Live sign-in).
Part of #480. Add integration tests comparing D3D12.X runtime wrappers against host ID3D12Device objects and console ABI contracts across: - ID3D12Resource Map, Unmap, GetGPUVirtualAddress (including lazy TITLE_ADDRESS texture fallback and UMA buffer placement), and WriteToSubresource - ID3D12DescriptorHeap console slot #9/#10 start handles and console_heap::start lifecycle on host and console #14 heaps - ID3D12CommandQueue GetDesc, GetTimestampFrequency, GetClockCalibration (host parity and pre/post-QUEUE_OLDER console calls), ExecuteCommandLists, Wait, Signal, and SignalX (#23) - ID3D12Fence slot #12 64-byte-aligned completed-value cell and CPU Signal updates, plus ID3D12CommandAllocator::Reset (#8) Verified on AMD Radeon RX 9070 XT (debug, release, XCL_D3D12_DEBUG=1), AMD Radeon(TM) Graphics, and WARP.
Implements three D3D12.X command list extensions in
crates/xcl/src/hle/d3d12x/:Summary
KickoffX(command list slot #93):(device, list_type)(withReleasecleanup on lists, queues, and allocators).ExecuteCommandLists, resetting the list on the same allocator (preserving XCL's vtable on copy lists), and restoring tracked state.Close+ExecuteCommandLists.Wait32BitValueX(#71) andWait64BitValueX(#72):(va, comparison, value, mask, flags)withD3D12_COMPARISON_FUNC(1..=8) and(mem & mask) <op> valuesemantics.ALWAYSas a no-op and logs/skipsNEVERto prevent hangs.execute_with_waits(splitting multi-listExecuteCommandListsbatches before an unsatisfied list, with spin+sleep polling and a 2 s timeout cap).RSSetDepthBiasX(command list slot #94):(depthBias: f32, depthBiasClamp: f32, slopeScaledDepthBias: f32)with non-finite sanitization and an atomic fast-path guard.device_x::depth_bias_pso, patchingRasterizerState.{DepthBias, DepthBiasClamp, SlopeScaledDepthBias}at verified offsets0x1D0..0x1DC, capped at 1024 entries and COM-released outside locks inforget_base).DrawInstanced,DrawIndexedInstanced,DrawIndexedX,ExecuteIndirect) and restores the base PSO when reset to(0, 0, 0)(or onReset/ClearState).Testing
device_x.rsandlist_x.rscoveringDepthBiasdesc patching/offsets,compare_u64, 32/64-bit masked cross-thread waits + timeout, written-range overlap,execute_with_waitsbatch splitting, queue picking/release, and depth-bias state transitions.tests/testtitle/src/gpu.rscoveringKickoffX(verifying GPU write completes beforeClose()and post-kickoff recording succeeds), cross-threadWait32BitValueX/Wait64BitValueX, andRSSetDepthBiasXon a real depth buffer.cargo build --workspace: 0 new warnings.cargo test --workspace -- --test-threads=4: all tests passed (xcllib 247 passed,console_dlls_e2e12 passed,console_shaders1 passed,e2e1 passed,gpu_pso_e2e6 passed,xg_oracle3 passed).