Return a descriptor heap's host heap without a lock once it exists #27

Merged
romainhedouin merged 1 commit from upstream-pr/27 into main 2026-11-25 17:09:21 +00:00
romainhedouin commented 2026-11-25 12:32:24 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by romainhedouin on 2026-11-25T12:32:24Z.


Every draw asks descriptor heaps for their host heap several times, and each ask took a mutex, even long after the host heap was made. That mutex only protects writes queued before the host heap exists, and nothing is queued after that, so the ask now returns right away once the heap is made.

Per ask, once the host heap exists Before After
Mutex locks 1 0
Model benchmark (same lock pattern, one thread) 10.9–15.2 ns 2.0–2.5 ns

"Model benchmark" = the same logic copied into a standalone program and timed in release mode on a Mac, not in the game. Type-checked for Windows (cargo clippy --target x86_64-pc-windows-msvc, with and without --all-features, no new warnings); not run.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:6604548352 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/27). Originally posted by [romainhedouin](https://github.com/romainhedouin) on 2026-11-25T12:32:24Z. --- Every draw asks descriptor heaps for their host heap several times, and each ask took a mutex, even long after the host heap was made. That mutex only protects writes queued before the host heap exists, and nothing is queued after that, so the ask now returns right away once the heap is made. | Per ask, once the host heap exists | Before | After | |---|---|---| | Mutex locks | 1 | 0 | | Model benchmark (same lock pattern, one thread) | 10.9–15.2 ns | 2.0–2.5 ns | "Model benchmark" = the same logic copied into a standalone program and timed in release mode on a Mac, not in the game. Type-checked for Windows (`cargo clippy --target x86_64-pc-windows-msvc`, with and without `--all-features`, no new warnings); not run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Belobug/VIctory-Belobug-AMD!27
No description provided.