perf(draw): ExecuteIndirect uses the cached host command signature by reference (no AddRef/Release per call) #643

Open
github-bot wants to merge 1 commit from github-bot/gh-643 into main AGit
Owner

@⁠Raptorbk45 on GitHub · 2026-12-05 22:37 UTC · original
Raptorbk45:perf/indirect-signature-by-ref → main · +21 −9 · 1 files · 1 commits · open

host_signature returns a clone of a command signature cached for the whole process, so every ExecuteIndirect translated does an AddRef and a Release (two atomic RMWs through COM). host_signature_ref returns &'static to the cached one (the COMMON OnceLocks, or a leaked box for the rare other kinds/strides, which were already kept forever in MADE); host_signature keeps its signature as host_signature_ref(..).cloned() for indirect.rs.

Same behaviour; the signatures were already never released.

How it was checked

Run after the final edit, on Linux (CachyOS), against main at 8c4e6633:

  • ./build.sh check (release, MSVC target): passes; the one warning (room_lately never used, resource.rs) is already on main
  • cargo xtask policy: passes

Not run: the game, on this branch (same change in daily use on our fork since 1 December 2026).

Branch head: f57a628c.

Not measured on its own (a pair of atomics per indirect call). No test: needs a D3D12 device.

Checks

  • One subject
  • N/A: switch, docs (no behaviour change)
  • N/A: unit test (see above)
  • Queue checked: no open PR touches host_signature
  • cargo xtask policy
**@⁠Raptorbk45** on GitHub · 2026-12-05 22:37 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/643) `Raptorbk45:perf/indirect-signature-by-ref` → `main` · +21 −9 · 1 files · 1 commits · open `host_signature` returns a clone of a command signature cached for the whole process, so every `ExecuteIndirect` translated does an `AddRef` and a `Release` (two atomic RMWs through COM). `host_signature_ref` returns `&'static` to the cached one (the `COMMON` `OnceLock`s, or a leaked box for the rare other kinds/strides, which were already kept forever in `MADE`); `host_signature` keeps its signature as `host_signature_ref(..).cloned()` for `indirect.rs`. Same behaviour; the signatures were already never released. ## How it was checked Run after the final edit, on Linux (CachyOS), against `main` at 8c4e6633: - `./build.sh check` (release, MSVC target): passes; the one warning (`room_lately` never used, `resource.rs`) is already on `main` - `cargo xtask policy`: passes Not run: the game, on this branch (same change in daily use on our fork since 1 December 2026). Branch head: `f57a628c`. Not measured on its own (a pair of atomics per indirect call). No test: needs a D3D12 device. ## Checks - [x] One subject - N/A: switch, docs (no behaviour change) - N/A: unit test (see above) - [x] Queue checked: no open PR touches `host_signature` - [x] `cargo xtask policy`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 22:39:40 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/643/head:github-bot/gh-643'
git switch 'github-bot/gh-643'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-643'
git switch 'github-bot/gh-643'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-643'
git switch 'github-bot/gh-643'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-643'
git switch 'main'
git merge --squash 'github-bot/gh-643'
git switch 'main'
git merge --ff-only 'github-bot/gh-643'
git switch 'main'
git merge 'github-bot/gh-643'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.