Declare each shader-written range once per list #29

Manually merged
github merged 1 commit from gh-pr/29/head into gh-pr/29/base 2026-11-26 03:33:42 +00:00
Owner

@⁠romainhedouin on GitHub · 2026-11-25 12:32 UTC · original
romainhedouin:perf/gpu-write-dedupe → main · +24 −17 · 1 files · 1 commits · merged 2026-11-25 17:09 UTC

Every draw that writes a buffer added a "shaders write this range" step, even when an earlier draw of the list had already added the same range. Each of these steps also forced a flush of pending refreshes, and at submission they were de-duplicated by comparing each one with all the others. Now a range is added once per list until the title next writes memory (the rule refreshes already use), and submission de-duplicates with a hash set. Repeated steps did nothing, so the result is the same.

N = 9,000 declarations, U unique ranges Before After
Steps and refresh flushes per list N U
Model benchmark, adding + de-duplicating, U = 16 0.16 ms 0.23–0.32 ms
Model benchmark, adding + de-duplicating, U = 2,000 8.3 ms 0.89 ms
Model benchmark, refreshes skipping written ranges, U = 16 2.6 ms 0.18 ms

"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

**@⁠romainhedouin** on GitHub · 2026-11-25 12:32 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/29) `romainhedouin:perf/gpu-write-dedupe` → `main` · +24 −17 · 1 files · 1 commits · merged 2026-11-25 17:09 UTC Every draw that writes a buffer added a "shaders write this range" step, even when an earlier draw of the list had already added the same range. Each of these steps also forced a flush of pending refreshes, and at submission they were de-duplicated by comparing each one with all the others. Now a range is added once per list until the title next writes memory (the rule refreshes already use), and submission de-duplicates with a hash set. Repeated steps did nothing, so the result is the same. | N = 9,000 declarations, U unique ranges | Before | After | |---|---|---| | Steps and refresh flushes per list | N | U | | Model benchmark, adding + de-duplicating, U = 16 | 0.16 ms | 0.23–0.32 ms | | Model benchmark, adding + de-duplicating, U = 2,000 | 8.3 ms | 0.89 ms | | Model benchmark, refreshes skipping written ranges, U = 16 | 2.6 ms | 0.18 ms | "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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:33:37 +00:00
github manually merged commit dd799aadf3 into gh-pr/29/base 2026-11-26 03:33:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.