D3D12.X: the per-draw mirror sync copies and index-scans buffers the title has not written #2393
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#2393
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?
@KOLESNiii on GitHub · 2026-11-25 17:43 UTC · original
Part of #2389.
sync_title_buffers(crates/xcl/src/hle/d3d12x/list_x.rs:3539onmain3f4495a) does the full work on every draw, whether or not the title has written the source since the last draw:list_x.rs:3577-3583), at every draw, for an index buffer that usually never changes.instances > 1(callers pass at least 2 when the first instance is not 0), an unknown range, or a stride of 0, the whole vertex buffer is copied (list_x.rs:3597). This is 1.1 MiB per draw for the buffer seen below.LISTS, collects the vertex bindings into a newVec(list_x.rs:3546), then locksMIRRORSand scans it linearly for each binding (mirrored,list_x.rs:3496).Proposal:
(lo, hi)vertex range per (index buffer, first index, count, base vertex), and drop it when the index source changes.Vec.Seen: in my title's menus, on an RTX 2070 SUPER with
main3f4495a, the first two mirrors appear 36 s in: a 384 KiB index buffer and a 1.1 MiB vertex buffer. Every draw after that goes through this path. I have no numbers from inside a world yet.Found by code reading with Claude Code (Claude Opus 5.5); not measured yet.