Keep independent D3D12 allocations out of the global title buffer lock #196
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay#196
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@NotADonky43 on GitHub · 2026-11-27 08:31 UTC · original
Keep independent D3D12 allocation out of the title buffer table lock
A first lookup of a registered title buffer takes the global
BUFFERSwriter throughtitle_shared_buffer(). Independent recording threads then wait to read even unrelated, already-published entries while the new resource is allocated, made resident, and mapped. This is separate from #178's stock of 64 KiB buffers and #192's dirty-page work inside an individual shadow.Change: move only the independent backing allocation out of the table writer. A per-registration ticket serializes creators of that entry. Rerun the range lookup under the writer and check ticket identity before publishing; an unregister/re-register or a new more-specific range cannot inherit the earlier candidate. The imported/in-place paths and final card-copy bookkeeping remain under the existing lock; the residency fence is unchanged. The patch does not require enabling prewarm or importing the diagnostic counters.
Diagnostic A/B: Series X on Windows, RTX 5070 Ti, same
e939566c-based executable and settings, 25,692 precompiled shader entries and the same native pipeline library, prewarm disabled both times. From startup through the first accepted present with at least 500 recorded draws since the preceding accepted present:Acquisitions below 2 µs are omitted from the sums. The table times overlap across threads and are not seconds of wall-clock delay. The present marker had 1,393 vs. 1,145 draws, so this single pair shows a shorter observed gap, not a matched visual benchmark or sustained FPS gain. Summed small-allocation time increased (about 1.78 to 4.21 s through the first heavy telemetry sample) as allocations overlapped. Both runs ended cleanly without logged device removal or pipeline refusal.
Clean upstream port: tested on
fdcfc2e9with #192's shadow refresh changes intact. The included title-free RTX regressions use real D3D12 buffers, debug layer and GPU validation. They check independent readers, one result for concurrent creation, retry after failure, and byte-exact GPU readback after re-registering the same key or inserting a narrower overlapping registration during allocation. Validation command:The optimized diagnostics build and the full workspace suite also passed. A separate boot of the clean port with precompiled shaders and the compatible native pipeline library reached the first heavy render sample (1,178 draws/frame) and closed normally on the requested milestone, under the 180 s game-only deadline. No device loss or pipeline refusal was logged. This is a runtime smoke check, not a claim of visual parity, steady frame rate, or lower memory use.
The diff below applies to both
fdcfc2e9(tested source base) and current main4ee1a47b(git apply --check; only launcher logging and documentation changed between those two upstream revisions). It contains only engine source and synthetic tests.@TaynanGT on GitHub · 2026-11-27 09:03 UTC · original
@NotADonky43 I’ve put your patch and readback tests in #199 and credited you on the commit. The range and ticket checks cover the case where a narrower registration wins during allocation. I gave the lock probes a short retry window so a parallel test briefly taking the table can’t trip them.
The drop in summed read-lock wait is worth following up. I’ll check the port’s readback and compare matched presents before drawing an FPS conclusion.