vulkan: copy descriptor table slots directly into mapped staging #1196

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

@⁠Kadamitas on GitHub · 2026-11-24 20:00 UTC · original
Kadamitas:perf/descriptor-table-staging → main · +15 −17 · 1 files · 1 commits · open

Claimed in the coordination issue as bulk-copy occupied descriptor staging slots.

What and why

Full bindless table uploads currently write every slot in small fragments, even though the descriptor and value records are already laid out in upload order. Copy the occupied slot range directly into mapped staging and use the same serializer for both the span and pointer entry points. The cleared-marker form still clears those words, and the upload layout and tombstone values are preserved.

Tested

  • The existing descriptor_table_test passed on Windows.
  • A synthetic byte comparison matched 2,309,432 bytes across aligned and unaligned destinations, with marker clearing enabled and disabled, including insert, erase, clear and rehash.
  • On a Ryzen 9 7950X with MSVC /O2, a 40 MiB write-combined staging copy took 5.49–5.64 ms before and 1.39–1.44 ms after. Each result is the median of nine groups of four copies, with baseline and patch measured in alternating order. This measures CPU staging time.

GPUs tested: N/A. The benchmark used native Windows write-combined host pages.

AI-assisted: yes.

Checklist

  • Based on current main (6293c1c4f).
  • One topic.
  • No game data, keys or decryption.
**@⁠Kadamitas** on GitHub · 2026-11-24 20:00 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1196) `Kadamitas:perf/descriptor-table-staging` → `main` · +15 −17 · 1 files · 1 commits · open Claimed in the coordination issue as [bulk-copy occupied descriptor staging slots](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14). ### What and why Full bindless table uploads currently write every slot in small fragments, even though the descriptor and value records are already laid out in upload order. Copy the occupied slot range directly into mapped staging and use the same serializer for both the span and pointer entry points. The cleared-marker form still clears those words, and the upload layout and tombstone values are preserved. ### Tested - The existing `descriptor_table_test` passed on Windows. - A synthetic byte comparison matched 2,309,432 bytes across aligned and unaligned destinations, with marker clearing enabled and disabled, including insert, erase, clear and rehash. - On a Ryzen 9 7950X with MSVC /O2, a 40 MiB write-combined staging copy took 5.49–5.64 ms before and 1.39–1.44 ms after. Each result is the median of nine groups of four copies, with baseline and patch measured in alternating order. This measures CPU staging time. GPUs tested: N/A. The benchmark used native Windows write-combined host pages. AI-assisted: yes. ### Checklist - [x] Based on current `main` (`6293c1c4f`). - [x] One topic. - [x] No game data, keys or decryption.
(cherry picked from commit f9347a7ef29b23856b9d222feb3fa9217c06cb6d)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:42:24 +00:00
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:07 UTC · original

Recommendation: [MERGE]

Reasoning: Bindless descriptor-table uploads memcpy the occupied slot range directly into staging instead of writing each slot in fragments. New static_asserts pin the trivially-copyable 40-byte layout the copy relies on, the clear_pad path still zeroes the marker word, and both entry points share one serializer. I checked the moved private: label: no member's access changes. Byte-identical output was verified over 2.3 MB of synthetic cases, with a roughly 4x faster CPU staging copy. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 3/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1196#issuecomment-7143086394) **Recommendation:** [MERGE] **Reasoning:** Bindless descriptor-table uploads memcpy the occupied slot range directly into staging instead of writing each slot in fragments. New static_asserts pin the trivially-copyable 40-byte layout the copy relies on, the `clear_pad` path still zeroes the marker word, and both entry points share one serializer. I checked the moved `private:` label: no member's access changes. Byte-identical output was verified over 2.3 MB of synthetic cases, with a roughly 4x faster CPU staging copy. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 3/10
This pull request has changes conflicting with the target branch.
  • runtime/src/descriptor_table.h
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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