Texture refresh: a submission takes the queued textures on several threads #57
No reviewers
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/ThatRecompDev--five-star-recomp!57
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/57/head"
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?
@Sr-0w on GitHub · 2026-11-26 06:30 UTC · original
Sr-0w:resources/refresh-settle-parallel→main· +28 −12 · 2 files · 1 commits · merged 2026-11-26 06:49 UTCWhat
TextureRefreshWorker.Settle, called before every submission, now refreshes the textures still queued on several threads:Parallel.ForEachon half the logical processors (SettleThreads). Before, it refreshed them one after another on the submitting game thread. The background worker keeps its one thread.Why
The game thread waits for the whole queue in
Settleanyway. Reading, hashing and detiling a texture run outside the uploader's lock:[ThreadStatic];Interlocked;RefreshGate;The worker and the submitting thread already ran
Refreshconcurrently. No lock is held around the call (XboxQueueMethods.Execute).Through a loading screen, about 1,300 textures were queued between two summaries, mostly first fills. With
--cpu-sample, the submitting thread spent its time inContentHash.Of(33–58 %),NtReadVirtualMemory(14–17 %) andXgSwizzle.Index. Up to 16.8 s of one frame went to texture refresh, and the game's 30 s hang watchdog ended the boot.In game (a retail game, RX 7800 XT, main + #56, untraced)
The run with the fix later ended in a device removal with the system commit full (74.2 of 74.3 GB). The driver's pipeline compiles take up to 6 GB each, several at once, and our process stood at 29.9 GB private. The per-thread copy buffers add at most one largest-texture buffer per settle thread.
Tests
docs/gpu-resources.mdis updated.🤖 Generated with Claude Code
@ThatRecompDev on GitHub · 2026-11-26 07:30 UTC · original
thanks, this lines up with what we saw on our side (texture refresh on the submitting thread was most of the CPU frame)
one thing to keep an eye on is memory, the per-thread copy buffers plus the driver compiles is where your run ran out. merged, we'll watch commit in the next boots