[PR #2098] [MERGED] Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY) #2105

Closed
opened 2026-11-26 21:20:03 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2098
Author: @Moriz82
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142

Base: main ← Head: pr/upstream-1125


📝 Commits (10+)

  • 9f98dcc Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY)
  • bffc639 Merge main into RT-POST-LOAD-GPU-MEMORY (#2098)
  • 86554c8 Fix the build of three test targets and a BOM in a translator test
  • 6100d3c runtime/README.md: name the 29 switches #2098 reads
  • d86ac98 Fill a never-filled mapped texture before its first submission (async refresh)
  • b83ae01 Build pipelines through main's PipelineCompiles path again, not #2098's pre-pass
  • 7b1d71e Leave the layer's below-arena V#s alone in the table scan
  • fb60a1c d3d12_big_compute_warmup: run without the live warm-up limit
  • 1f64d91 xg_xs_test: a render target without a mode takes main's general layout model
  • 75f6890 Keep the storage view's pNext chain alive for the 2D-array mirror view

📊 Changes

113 files changed (+16735 additions, -972 deletions)

View changed files

📝 docs/buffer_bounds.md (+5 -0)
📝 docs/d3d12_vulkan.md (+165 -9)
📝 docs/design.md (+3 -2)
📝 docs/gameinput.md (+2 -1)
📝 docs/shader_library.md (+17 -4)
📝 runtime/CMakeLists.txt (+74 -5)
📝 runtime/README.md (+30 -0)
📝 runtime/shims/d3d12_com.cpp (+181 -20)
📝 runtime/shims/d3d12_com.h (+15 -0)
➕ runtime/shims/d3d12_compile_helper.h (+443 -0)
📝 runtime/shims/d3d12_compute_input_probe.h (+13 -3)
📝 runtime/shims/d3d12_geometry_views.h (+3 -0)
📝 runtime/shims/d3d12_pipeline_compile.h (+161 -25)
➕ runtime/shims/d3d12_precompile.h (+45 -0)
📝 runtime/shims/d3d12_title_buffer_windows.h (+40 -0)
📝 runtime/shims/d3d12_title_image_upload.h (+7 -3)
📝 runtime/shims/d3d12_vulkan_device.cpp (+3379 -229)
📝 runtime/shims/d3d12_xs_alloc_size.h (+48 -2)
📝 runtime/shims/d3d12_xs_device.cpp (+244 -65)
📝 runtime/shims/d3d12_xs_list_values.h (+3 -1)

...and 80 more files

📄 Description

This draft follows #1723. When the shared Vulkan buffer arena fills, an eligible committed buffer can now use a dedicated allocation. An earlier Proton run stopped during upscaler initialization when no arena slice fit the requested buffer.

Claimed as RT-POST-LOAD-GPU-MEMORY. Coordination issue

Changes

  • Update console heap descriptors on the GPU, track invalidated backing ranges, and retain upstream's host-side bitset for live buffer descriptors.
  • Journal completed pipeline cache entries, move eligible compilation work off the submission thread, and reuse compute shader seeds across runs.
  • Replay indirect mesh records through the GPU clamp. Record the original mesh dimensions before clamping and clear the counters when a readback slot is reused.
  • Preserve scripted button presses until the title reads them. Update translator handling for buffer offsets, image views, and wave64 control flow.

Independent review work overlaps the fixed-count and counted indirect mesh paths and pipeline compile workers. Fixed-count mesh dispatches · Count-buffer mesh dispatches · Pipeline compile workers

Verification

Build Result
Public rebase on db1a22d29, Linux 6,327 translator tests across 493 files, zero failing files. The descriptor-cache check passed. The compute pipeline suite ran four tests with one skip.
Public rebase, Windows x64 cross-build Release gta6rt.exe and gta6rt_tls_host.dll linked on Linux with clang-cl and the Windows SDK.
Public rebase, SPIR-V Both embedded runtime compute shaders passed Vulkan 1.2 validation. The regression for the mesh counter instructions passed.
Public rebase, repository checks Tracked-file game-data scan, forbidden extension check, added-content secret scan, and whitespace check passed.
Source integration, Linux and Proton 6,303 translator tests across 491 files, zero failing files. All 12 focused runtime suites passed, including the compute allocation fallback and pipeline cache journal.
Earlier allocation-fix build, Proton Loading ended at 170 seconds. The title frame counter advanced from 2,369 at 300 seconds to 2,830 at 600 seconds. The run recorded zero upscaler exceptions. Whether it exercised the dedicated fallback is unknown.

The public commit still needs a title boot. Native Windows and playable world rendering remain unverified.

GPU used for the source integration was an NVIDIA GeForce RTX 4070 on Linux under Proton. Public-head runtime checks are in progress.

Contributors include Plaaasma and ivanepsilondelta. AI-assisted.


🔄 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/2098 **Author:** [@Moriz82](https://github.com/Moriz82) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/26/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `pr/upstream-1125` --- ### 📝 Commits (10+) - [`9f98dcc`](https://github.com/ubiquitarianism/leonida/commit/9f98dcc617df5b21eb66b48a289914b551769029) Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY) - [`bffc639`](https://github.com/ubiquitarianism/leonida/commit/bffc6395b11afb042c9d3c69c282f3729206f9b6) Merge main into RT-POST-LOAD-GPU-MEMORY (#2098) - [`86554c8`](https://github.com/ubiquitarianism/leonida/commit/86554c879894b3eb62921653fb27cecfc5dde5fa) Fix the build of three test targets and a BOM in a translator test - [`6100d3c`](https://github.com/ubiquitarianism/leonida/commit/6100d3c43cb2d1854886719ab4b948012be93ad1) runtime/README.md: name the 29 switches #2098 reads - [`d86ac98`](https://github.com/ubiquitarianism/leonida/commit/d86ac9813370b06493286ba3c6f33d438ccc89e9) Fill a never-filled mapped texture before its first submission (async refresh) - [`b83ae01`](https://github.com/ubiquitarianism/leonida/commit/b83ae01f5c16165a27c345adab88c8e189a6408a) Build pipelines through main's PipelineCompiles path again, not #2098's pre-pass - [`7b1d71e`](https://github.com/ubiquitarianism/leonida/commit/7b1d71e218ab37a6a0620d7230e9f3965a493e55) Leave the layer's below-arena V#s alone in the table scan - [`fb60a1c`](https://github.com/ubiquitarianism/leonida/commit/fb60a1cf4a98819f33b9f421ca0d27bd15e7d8ac) d3d12_big_compute_warmup: run without the live warm-up limit - [`1f64d91`](https://github.com/ubiquitarianism/leonida/commit/1f64d91c3f4a4ab60926cfa4836608055debb108) xg_xs_test: a render target without a mode takes main's general layout model - [`75f6890`](https://github.com/ubiquitarianism/leonida/commit/75f6890bb98214d5112c7eb1126f67f9e2948a0a) Keep the storage view's pNext chain alive for the 2D-array mirror view ### 📊 Changes **113 files changed** (+16735 additions, -972 deletions) <details> <summary>View changed files</summary> 📝 `docs/buffer_bounds.md` (+5 -0) 📝 `docs/d3d12_vulkan.md` (+165 -9) 📝 `docs/design.md` (+3 -2) 📝 `docs/gameinput.md` (+2 -1) 📝 `docs/shader_library.md` (+17 -4) 📝 `runtime/CMakeLists.txt` (+74 -5) 📝 `runtime/README.md` (+30 -0) 📝 `runtime/shims/d3d12_com.cpp` (+181 -20) 📝 `runtime/shims/d3d12_com.h` (+15 -0) ➕ `runtime/shims/d3d12_compile_helper.h` (+443 -0) 📝 `runtime/shims/d3d12_compute_input_probe.h` (+13 -3) 📝 `runtime/shims/d3d12_geometry_views.h` (+3 -0) 📝 `runtime/shims/d3d12_pipeline_compile.h` (+161 -25) ➕ `runtime/shims/d3d12_precompile.h` (+45 -0) 📝 `runtime/shims/d3d12_title_buffer_windows.h` (+40 -0) 📝 `runtime/shims/d3d12_title_image_upload.h` (+7 -3) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+3379 -229) 📝 `runtime/shims/d3d12_xs_alloc_size.h` (+48 -2) 📝 `runtime/shims/d3d12_xs_device.cpp` (+244 -65) 📝 `runtime/shims/d3d12_xs_list_values.h` (+3 -1) _...and 80 more files_ </details> ### 📄 Description This draft follows #1723. When the shared Vulkan buffer arena fills, an eligible committed buffer can now use a dedicated allocation. An earlier Proton run stopped during upscaler initialization when no arena slice fit the requested buffer. Claimed as **RT-POST-LOAD-GPU-MEMORY**. [Coordination issue](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7173693934) ### Changes - Update console heap descriptors on the GPU, track invalidated backing ranges, and retain upstream's host-side bitset for live buffer descriptors. - Journal completed pipeline cache entries, move eligible compilation work off the submission thread, and reuse compute shader seeds across runs. - Replay indirect mesh records through the GPU clamp. Record the original mesh dimensions before clamping and clear the counters when a readback slot is reused. - Preserve scripted button presses until the title reads them. Update translator handling for buffer offsets, image views, and wave64 control flow. Independent review work overlaps the fixed-count and counted indirect mesh paths and pipeline compile workers. [Fixed-count mesh dispatches](https://github.com/ubiquitarianism/leonida/pull/424) · [Count-buffer mesh dispatches](https://github.com/ubiquitarianism/leonida/pull/429) · [Pipeline compile workers](https://github.com/ubiquitarianism/leonida/pull/2077) ### Verification | Build | Result | | --- | --- | | Public rebase on `db1a22d29`, Linux | 6,327 translator tests across 493 files, zero failing files. The descriptor-cache check passed. The compute pipeline suite ran four tests with one skip. | | Public rebase, Windows x64 cross-build | Release gta6rt.exe and gta6rt_tls_host.dll linked on Linux with clang-cl and the Windows SDK. | | Public rebase, SPIR-V | Both embedded runtime compute shaders passed Vulkan 1.2 validation. The regression for the mesh counter instructions passed. | | Public rebase, repository checks | Tracked-file game-data scan, forbidden extension check, added-content secret scan, and whitespace check passed. | | Source integration, Linux and Proton | 6,303 translator tests across 491 files, zero failing files. All 12 focused runtime suites passed, including the compute allocation fallback and pipeline cache journal. | | Earlier allocation-fix build, Proton | Loading ended at 170 seconds. The title frame counter advanced from 2,369 at 300 seconds to 2,830 at 600 seconds. The run recorded zero upscaler exceptions. Whether it exercised the dedicated fallback is unknown. | The public commit still needs a title boot. Native Windows and playable world rendering remain unverified. GPU used for the source integration was an NVIDIA GeForce RTX 4070 on Linux under Proton. Public-head runtime checks are in progress. Contributors include Plaaasma and ivanepsilondelta. AI-assisted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:03 +01:00
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#2105
No description provided.