[PR #2122] [MERGED] d3d12: the title texture pass can time-box its mapped and stale visits (RT-TITLE-EVERY-BUDGET) #2127

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

📋 Pull Request Information

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

Base: main ← Head: rt-title-every-budget


📝 Commits (2)

  • 5da3b6b d3d12: the title texture pass can time-box its mapped and stale visits (RT-TITLE-EVERY-BUDGET)
  • 8d832fd Merge main into rt-title-every-budget (#2122)

📊 Changes

4 files changed (+123 additions, -8 deletions)

View changed files

📝 runtime/README.md (+1 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+32 -8)
📝 runtime/src/title_texture_refresh.h (+34 -0)
📝 runtime/test/xg_xs_test.cpp (+56 -0)

📄 Description

Claimed in the coordination issue as: RT-TITLE-EVERY-BUDGET (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7175193465)

Depends on: nothing. Conflicts textually with #2050 and #2098, which change the same loop in refresh_title_textures; whichever lands second rebases.

What and why

Each pass of refresh_title_textures visits every texture that is mapped by the title or known stale. During a streaming burst on retail that is thousands of textures, 30-75 ms a pass, before every submission on the title's submitting thread.

LEONIDA_TITLE_EVERY_BUDGET_US (default 0: unchanged) limits how long one pass spends on those visits:

  • The visits resume from a cursor of their own (title_every_cursor_), in address order, so every marked texture gets its turn however many there are. The texture that crosses the limit is finished; one not reached keeps its mark and waits for a later pass.
  • A mapped texture never filled yet is visited first, whatever the limit, so a video plane is not left empty until its turn comes.
  • The pass stays synchronous, before the submission, exactly as today. Only the number of visits per pass changes.

The walk is leonida::visit_marked_title_textures in runtime/src/title_texture_refresh.h, next to poll_title_textures, so it is tested without a device.

The asynchronous variant is left out on purpose: #2098 already adds LEONIDA_TEXTURE_REFRESH_ASYNC.

Tested

  • xg_xs_test (new cases: unlimited pass visits every marked texture once and in order; one visit a pass rotates and wraps; the cursor survives an erased entry; an urgent texture comes first and is not visited twice in the same pass; empty registry). Built with MSVC 2022 RelWithDebInfo, xg_xs passes, gta6rt builds.

  • In game, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11, earlier base (main + #1893 + #1849), same build and inputs, 7 min runs:

    Run Pass on mapped + stale textures Submissions by ~240 s
    Without the budget (LEONIDA_TITLE_FILL_ASYNC=1) ~43 ms 6,181
    LEONIDA_TITLE_EVERY_BUDGET_US=4000, with the earlier asynchronous pass and LEONIDA_REFRESH_MAPPED_TEXTURES=0 4-8 ms 12,109

    That run also had the asynchronous pass on and mapped refresh off, so the submission gain is not the budget's alone.

  • @DadaCap ran an earlier version on an RTX 5080 (621.24), with the budget and the asynchronous pass together: the pass itself went from 20.3 to 6.3 ms and the textures visited from 2,237 to 24 a pass, with no change in submissions per second on that machine (limited elsewhere). The gain depends on the machine.

  • No in-game run of this exact branch (budget alone, synchronous) yet.

  • Not checked: video planes over a long run. The urgent rule is meant for them, but no run here compared a video before and after.

GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, driver 621.40, Windows 11 Pro (in game); NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 (in game, by @DadaCap)

AI-assisted: yes (Claude Code, Claude Opus 5.5 wrote the change, the tests and this text)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code


🔄 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/2122 **Author:** [@OreoFR](https://github.com/OreoFR) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/26/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `rt-title-every-budget` --- ### 📝 Commits (2) - [`5da3b6b`](https://github.com/ubiquitarianism/leonida/commit/5da3b6be3cefc1499452ba8c8370a50092674d61) d3d12: the title texture pass can time-box its mapped and stale visits (RT-TITLE-EVERY-BUDGET) - [`8d832fd`](https://github.com/ubiquitarianism/leonida/commit/8d832fd10913064e1c8aec74191e3ba8f70211c8) Merge main into rt-title-every-budget (#2122) ### 📊 Changes **4 files changed** (+123 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `runtime/README.md` (+1 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+32 -8) 📝 `runtime/src/title_texture_refresh.h` (+34 -0) 📝 `runtime/test/xg_xs_test.cpp` (+56 -0) </details> ### 📄 Description Claimed in the coordination issue as: RT-TITLE-EVERY-BUDGET (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7175193465) Depends on: nothing. Conflicts textually with #2050 and #2098, which change the same loop in `refresh_title_textures`; whichever lands second rebases. ### What and why Each pass of `refresh_title_textures` visits every texture that is mapped by the title or known stale. During a streaming burst on retail that is thousands of textures, 30-75 ms a pass, before every submission on the title's submitting thread. `LEONIDA_TITLE_EVERY_BUDGET_US` (default `0`: unchanged) limits how long one pass spends on those visits: - The visits resume from a cursor of their own (`title_every_cursor_`), in address order, so every marked texture gets its turn however many there are. The texture that crosses the limit is finished; one not reached keeps its mark and waits for a later pass. - A mapped texture never filled yet is visited first, whatever the limit, so a video plane is not left empty until its turn comes. - The pass stays synchronous, before the submission, exactly as today. Only the number of visits per pass changes. The walk is `leonida::visit_marked_title_textures` in `runtime/src/title_texture_refresh.h`, next to `poll_title_textures`, so it is tested without a device. The asynchronous variant is left out on purpose: #2098 already adds `LEONIDA_TEXTURE_REFRESH_ASYNC`. ### Tested - `xg_xs_test` (new cases: unlimited pass visits every marked texture once and in order; one visit a pass rotates and wraps; the cursor survives an erased entry; an urgent texture comes first and is not visited twice in the same pass; empty registry). Built with MSVC 2022 RelWithDebInfo, `xg_xs` passes, `gta6rt` builds. - In game, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11, earlier base (`main` + #1893 + #1849), same build and inputs, 7 min runs: | Run | Pass on mapped + stale textures | Submissions by ~240 s | |---|---|---| | Without the budget (`LEONIDA_TITLE_FILL_ASYNC=1`) | ~43 ms | 6,181 | | `LEONIDA_TITLE_EVERY_BUDGET_US=4000`, with the earlier asynchronous pass and `LEONIDA_REFRESH_MAPPED_TEXTURES=0` | 4-8 ms | 12,109 | That run also had the asynchronous pass on and mapped refresh off, so the submission gain is not the budget's alone. - @DadaCap ran an earlier version on an RTX 5080 (621.24), with the budget and the asynchronous pass together: the pass itself went from 20.3 to 6.3 ms and the textures visited from 2,237 to 24 a pass, with no change in submissions per second on that machine (limited elsewhere). The gain depends on the machine. - No in-game run of this exact branch (budget alone, synchronous) yet. - Not checked: video planes over a long run. The urgent rule is meant for them, but no run here compared a video before and after. GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, driver 621.40, Windows 11 Pro (in game); NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 (in game, by @DadaCap) AI-assisted: yes (Claude Code, Claude Opus 5.5 wrote the change, the tests and this text) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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:08 +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#2127
No description provided.