GPU: reduce CPU time selecting indexed textures from a backlog #144
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/144"
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?
Imported from Zettrox/ztrx. Originally posted by syrrath-creator on 2026-11-25T14:17:57Z.
The renderer can have 25,000–40,000 texture slots waiting for a host view. Each pass takes up to 4,096. The current implementation sorts all due slots, copies the retry candidates before truncating them, and walks the queue again for diagnostics, all while holding the queue mutex.
This change computes the five existing counters during selection and orders only the parts needed for the result. It preserves the retry-first rule and alternates newest and oldest fresh writes as before. The returned vector releases capacity used solely for discarded retries.
The release-mode comparison ran in three processes, nine alternating A/B pairs per shape per process. 8,400 comparisons agreed on all returned (slot, generation) pairs and the complete census, including zero capacity, just over the cap, retries, partial uploads and future frames. The crate suite passed on Windows, as did Clippy with all targets and features. These timings cover queue selection and exclude uploads, GPU execution and game frame time.
Reproduce the comparison without game assets. Prepared and tested with Codex.
Imported from Zettrox/ztrx. Originally posted by Artking175 on 2026-11-25T15:01:28Z.
Independent rerun on an Intel Core i7-9750H, Windows 10 22H2, Rust 1.98.1 MSVC. I used the pinned synthetic fixture and extracted the selector implementations from
90b529fandc459d07as in the supplied build script. The three seeds matched every selected(slot, generation)sequence and all five census values in 8,400 comparisons.Each median covers 27 alternating A/B pairs across three processes. The timed region covers CPU queue selection. All inputs were synthetic.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.