Repository navigation
D3D12.X: find superseded placements under a shared lock - #3577
raylitebull wants to merge 1 commit into
Conversation
|
Review (head b0fa4d6, diff read, not a merge-check; draft):
Fine: lookups only read the set, and the new lock is only ever taken last, under AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
placements::note_use runs for every barrier, copy and descriptor-table texture of a draw while any target is superseded, and took the REGISTRY mutex for each to learn whether that texture is one of them; almost never is. SUPERSEDED_IDS holds the superseded ones. Registry records each change where it counts them (superseded_delta), and the callers that already store SUPERSEDED under the registry's lock apply it (sync_superseded). note_use returns early when the texture is not in the set, and note_superseded_in_tables collects a draw's textures once and checks them under one read lock (note_uses). Ported from amd-dev 4d6d4a7, which measured this together with its other lock changes on amd-dev; this part was not measured on its own or on main. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
b0fa4d6 to
ea033df
Compare
|
Follow-up (head ea033df; the diff from b0fa4d6 read). Both points are addressed: AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
@Foniass thanks, both are in (ea033df), as you confirmed. A measurement on AI use: written by Capy (Claude Opus 5.5) and posted on raylitebull's behalf, with their go-ahead. |
|
Test report (not a merge-check: draft, AI-written and posted by Foniass without a human check of each point. |
While any target is superseded,
placements::note_useruns for every barrier, every copy and every texture in a draw's descriptor tables, and it took theREGISTRYmutex each time to learn whether that texture was superseded. It almost never is. Now the superseded placements are mirrored in a set that a shared read lock can check, andREGISTRYis taken only for the ones that are superseded.What is in it
placements.rs:SUPERSEDED_IDS.Registryrecords each change where it counts superseded placements (superseded_delta), andsync_supersededapplies those changes whereSUPERSEDEDwas stored before.note_usereturns early for a texture not in the set, andnote_useschecks a batch under one read lock.bind.rs:note_superseded_in_tablescollects a draw's textures, sorts and deduplicates them, and callsnote_uses.sync_supersededchecks that the set holds as many entries asRegistry::unmappedcounts.the_superseded_set_follows_the_registry.Tested
cargo check --workspace --all-targets --target x86_64-pc-windows-gnu: no errors, no new warnings.x86_64-pc-windows-gnuand run under Wine 9.0 (no GPU) with--test-threads=4, next to the same filters onmainb2b1f109:hle::d3d12x::placements: 14 passed, 0 failed (main: 13 / 0)hle::d3d12x::bind: 113 passed, 3 failed (main: 113 / 3)The failures are the same tests on both, ones that need a D3D12 device or Windows' working-set queries, which Wine lacks.
Regression run
Not run yet: there was no Windows machine or title here.
scripts/smoke.ps1still has to run on a title, built frommainand from this head, soPR checksfails until those two blocks are added.Not tested
cargo test --workspace -- --test-threads=4) on Windows, with or without a GPU; CI's no-GPU job is the first Windows run.main, and any performance onmain: the numbers above are fromamd-dev.amd-devit is part of4d6d4a77, whose numbers cover all of its lock changes together.AI use
amd-devcommit4d6d4a77tomain, split it into this PR and five others, and wrote the test, the commit message and this description. Theamd-devmeasurements are raylitebull's own runs.