hle(xmem): export VirtualQuery and VirtualProtect hooks when VICTORY_LAZY_VIEWS=1 #3085

Closed
github-bot wants to merge 1 commit from github-bot/gh-3085 into main AGit
Owner

@⁠RanoGames on GitHub · 2026-11-29 19:55 UTC · original
RanoGames:fix/xmem-lazy-views-query-hooks → main · +26 −2 · 1 files · 1 commits · closed without merging

What it changes

Fixes xmem::module() in crates/victory-hle/src/modules/xmem.rs:

  • title_virtual_query and title_virtual_protect call materialize_for(..., Touch::TitleCall) so VirtualQuery and VirtualProtect materialize lazy host-placeholder views instead of letting the title observe MEM_RESERVE or fail protection changes.
  • xmem::module() previously only exported VirtualQuery and VirtualProtect when VICTORY_SOFT_VIEWS was set (!= "0"), leaving them unbound to the host when VICTORY_LAZY_VIEWS=1 was used without VICTORY_SOFT_VIEWS.
  • Extracted exports_query_hooks(soft, lazy) / module_with(hook_queries) so VirtualQuery and VirtualProtect are exported whenever VICTORY_SOFT_VIEWS != "0" or VICTORY_LAZY_VIEWS == "1".
  • Added unit test modules::xmem::tests::lazy_views_export_virtual_query_and_virtual_protect_without_soft_views.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): N/A (unit-tested HLE xmem export fix)
  • Before: with VICTORY_LAZY_VIEWS=1 and VICTORY_SOFT_VIEWS unset (or "0"), xmem::module() did not export VirtualQuery or VirtualProtect.
  • After: xmem::module() exports both hooks for VICTORY_LAZY_VIEWS=1 as well as VICTORY_SOFT_VIEWS != "0".
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A
  • cargo test passed for the crates it touches: yes (cargo test --locked -p victory-hle --lib -- modules::xmem::tests --test-threads=1: 44 passed, 0 failed, 1 ignored; cargo xtask policy --staged passed)

Checked for overlap

  • I searched the open and closed pull requests for VICTORY_LAZY_VIEWS, title_virtual_query, and title_virtual_protect (only unrelated #2390, #1492, #1014 touched title_virtual_protect).
**@⁠RanoGames** on GitHub · 2026-11-29 19:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3085) `RanoGames:fix/xmem-lazy-views-query-hooks` → `main` · +26 −2 · 1 files · 1 commits · closed without merging ## What it changes Fixes `xmem::module()` in `crates/victory-hle/src/modules/xmem.rs`: - `title_virtual_query` and `title_virtual_protect` call `materialize_for(..., Touch::TitleCall)` so `VirtualQuery` and `VirtualProtect` materialize lazy host-placeholder views instead of letting the title observe `MEM_RESERVE` or fail protection changes. - `xmem::module()` previously only exported `VirtualQuery` and `VirtualProtect` when `VICTORY_SOFT_VIEWS` was set (`!= "0"`), leaving them unbound to the host when `VICTORY_LAZY_VIEWS=1` was used without `VICTORY_SOFT_VIEWS`. - Extracted `exports_query_hooks(soft, lazy)` / `module_with(hook_queries)` so `VirtualQuery` and `VirtualProtect` are exported whenever `VICTORY_SOFT_VIEWS != "0"` or `VICTORY_LAZY_VIEWS == "1"`. - Added unit test `modules::xmem::tests::lazy_views_export_virtual_query_and_virtual_protect_without_soft_views`. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): N/A (unit-tested HLE `xmem` export fix) - Before: with `VICTORY_LAZY_VIEWS=1` and `VICTORY_SOFT_VIEWS` unset (or `"0"`), `xmem::module()` did not export `VirtualQuery` or `VirtualProtect`. - After: `xmem::module()` exports both hooks for `VICTORY_LAZY_VIEWS=1` as well as `VICTORY_SOFT_VIEWS != "0"`. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A - `cargo test` passed for the crates it touches: yes (`cargo test --locked -p victory-hle --lib -- modules::xmem::tests --test-threads=1`: 44 passed, 0 failed, 1 ignored; `cargo xtask policy --staged` passed) ## Checked for overlap - [x] I searched the open and closed pull requests for `VICTORY_LAZY_VIEWS`, `title_virtual_query`, and `title_virtual_protect` (only unrelated #2390, #1492, #1014 touched `title_virtual_protect`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 20:00:11 +00:00
github-bot force-pushed github-bot/gh-3085 from 5b65dfd44d to 56e62cca8e 2026-12-01 16:29:21 +00:00 Compare
github-bot closed this pull request 2026-12-01 18:59:09 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!3085
No description provided.