[PR #113] runtime/vulkan: unified per-frame perf pack (bindless 0-alloc, view/descriptor/format tables) #167

Open
opened 2026-11-26 20:17:00 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/113
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9846


📝 Commits (4)

  • 8dd4565 gfx10_descriptors: index the format table instead of scanning it
  • 189a8bd vulkan_backend: hash the attachment-view cache and index it by image
  • 954fbda d3d12_vulkan_device: hash the border colour table and key replaced views by address
  • f00b505 vulkan_bindless: pending writes in flat per-binding arrays, free index by memchr

📊 Changes

12 files changed (+1850 additions, -65 deletions)

View changed files

📝 runtime/CMakeLists.txt (+18 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+11 -28)
➕ runtime/src/descriptor_tables.h (+140 -0)
📝 runtime/src/gfx10_descriptors.h (+56 -5)
➕ runtime/src/image_view_cache.h (+96 -0)
📝 runtime/src/vulkan_backend.h (+11 -14)
📝 runtime/src/vulkan_bindless.h (+23 -17)
➕ runtime/test/bindless_queue_test.cpp (+650 -0)
➕ runtime/test/descriptor_tables_test.cpp (+326 -0)
📝 runtime/test/gfx10_descriptors_test.cpp (+38 -1)
➕ runtime/test/gfx10_format_bench.cpp (+232 -0)
➕ runtime/test/image_view_cache_test.cpp (+249 -0)

📄 Description

Carried over from old PR 9846 by TG0000 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9846, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
TG0000: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Consolidated per-frame Vulkan runtime performance pack replacing closed PRs #8021, #8042, #8159, and #8180 (all previously independently verified across multiple GPUs including RX 9070 XT, RX 7800 XT, RX 6800, RTX 5070 Ti, RTX 5070, RTX 3070 Ti, RTX 2080, and Intel UHD 770).

What this combines

  1. GFX10 descriptor format table indexing (was #8021): compile-time indexed lookup instead of linear scan (~20x faster: 111 -> 5 ns).
  2. Hashed attachment-view cache indexed by image (was #8042): 2x–4.5x faster lookup and up to 460x faster image destroy (0.67 ms -> 3.4 us).
  3. Hashed border-color table & address-keyed replaced views (was #8159): removes O(N) scans under descriptor_mutex (5x–62.5x border colors, 3.3x–22.1x replaced views).
  4. Flat per-binding pending-write arrays & memchr free-index scan in vulkan_bindless.h (was #8180): 0 heap allocations per frame (was 2,811), 4x faster (206 -> 48 us/frame).

Testing

  • Built on Windows 11 (Ryzen 9 5900X, AMD Radeon RX 6800 gfx1030, clang++/Ninja/CMake 4.5.1, -DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF, RelWithDebInfo): 158/158 targets, 0 warnings.
  • All 7 touched Vulkan tests pass (gfx10_tiling, image_view_cache, descriptor_tables, bindless_sizing, bindless_queue, gfx10_descriptors, gfx10_format_bench_selftest); 73/74 full CTest pass (the only failure is vk_queue_query_sync, which fails identically on bare origin/main on RX 6800).
  • git diff --check and scripts/check_no_game_data.py clean. No game data used.

AI-assisted (Claude Opus 5.5).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/113 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9846` --- ### 📝 Commits (4) - [`8dd4565`](https://github.com/ubiquitarianism/leonida/commit/8dd45654417110811e40b374f7415b8e564d398c) gfx10_descriptors: index the format table instead of scanning it - [`189a8bd`](https://github.com/ubiquitarianism/leonida/commit/189a8bd09fc191cd89c2a60ea74249fbb6d14bc8) vulkan_backend: hash the attachment-view cache and index it by image - [`954fbda`](https://github.com/ubiquitarianism/leonida/commit/954fbda1743143e2a4c3f1d35855306dd421e895) d3d12_vulkan_device: hash the border colour table and key replaced views by address - [`f00b505`](https://github.com/ubiquitarianism/leonida/commit/f00b5056b45e7861543d8ebfd819154155f6f99a) vulkan_bindless: pending writes in flat per-binding arrays, free index by memchr ### 📊 Changes **12 files changed** (+1850 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+18 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+11 -28) ➕ `runtime/src/descriptor_tables.h` (+140 -0) 📝 `runtime/src/gfx10_descriptors.h` (+56 -5) ➕ `runtime/src/image_view_cache.h` (+96 -0) 📝 `runtime/src/vulkan_backend.h` (+11 -14) 📝 `runtime/src/vulkan_bindless.h` (+23 -17) ➕ `runtime/test/bindless_queue_test.cpp` (+650 -0) ➕ `runtime/test/descriptor_tables_test.cpp` (+326 -0) 📝 `runtime/test/gfx10_descriptors_test.cpp` (+38 -1) ➕ `runtime/test/gfx10_format_bench.cpp` (+232 -0) ➕ `runtime/test/image_view_cache_test.cpp` (+249 -0) </details> ### 📄 Description > Carried over from **old PR 9846** by `TG0000` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9846`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `TG0000`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Consolidated per-frame Vulkan runtime performance pack replacing closed PRs `#8021`, `#8042`, `#8159`, and `#8180` (all previously independently verified across multiple GPUs including RX 9070 XT, RX 7800 XT, RX 6800, RTX 5070 Ti, RTX 5070, RTX 3070 Ti, RTX 2080, and Intel UHD 770). ### What this combines 1. **GFX10 descriptor format table indexing** (was `#8021`): compile-time indexed lookup instead of linear scan (~20x faster: `111 -> 5 ns`). 2. **Hashed attachment-view cache indexed by image** (was `#8042`): `2x–4.5x` faster lookup and up to `460x` faster image destroy (`0.67 ms -> 3.4 us`). 3. **Hashed border-color table & address-keyed replaced views** (was `#8159`): removes O(N) scans under `descriptor_mutex` (`5x–62.5x` border colors, `3.3x–22.1x` replaced views). 4. **Flat per-binding pending-write arrays & `memchr` free-index scan in `vulkan_bindless.h`** (was `#8180`): `0` heap allocations per frame (was 2,811), `4x` faster (`206 -> 48 us/frame`). ### Testing - Built on Windows 11 (Ryzen 9 5900X, AMD Radeon RX 6800 gfx1030, clang++/Ninja/CMake 4.5.1, `-DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF`, RelWithDebInfo): 158/158 targets, **0 warnings**. - All 7 touched Vulkan tests pass (`gfx10_tiling`, `image_view_cache`, `descriptor_tables`, `bindless_sizing`, `bindless_queue`, `gfx10_descriptors`, `gfx10_format_bench_selftest`); 73/74 full CTest pass (the only failure is `vk_queue_query_sync`, which fails identically on bare `origin/main` on RX 6800). - `git diff --check` and `scripts/check_no_game_data.py` clean. No game data used. AI-assisted (Claude Opus 5.5). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#167
No description provided.