hle: stub XboxBvhBuilder build/copy/rehydrate when VICTORY_BVH_BUILDER is off #418

Closed
github-bot wants to merge 0 commits from github-bot/gh-418 into main AGit
Owner

@⁠wellisrite on GitHub · 2026-12-02 04:39 UTC · original
wellisrite:fix/stub-bvh-builder-when-off → main · +142 −0 · 3 files · 72 commits · closed without merging

Fixes #375

Problem

When VICTORY_BVH_BUILDER is off (the default), the GPU side already skips ray-tracing BVH shaders, but the title still calls into XboxBvhBuilder.dll (BuildRaytracingAccelerationStructureBatched2X, etc.) on the CPU. On a 12 GB RTX 3060 / 32 GB RAM system this caused:

  • Series X: D3D12 XDXR Error: Failed to allocate upload buffer (0xe06d7363 / 0x80004005 at XboxBvhBuilder.dll+0x210bc) during initial scene load.
  • Series S: 0xc0000005 (write 0x0 at XboxBvhBuilder.dll+0x1cef4) in heavy prestream scenes when the title's internal pools were nearly full.

Change

  • Added victory_hle::modules::bvh_builder::Interpose (modeled after fidelityfx::Interpose), chained in apps/victory/src/run.rs.
  • When VICTORY_BVH_BUILDER != 1 (and VICTORY_BVH_STUB != 0), stubs BuildRaytracingAccelerationStructure, BuildRaytracingAccelerationStructureBatched2X, CopyRaytracingAccelerationStructure, CpuValidateResultX, RehydrateRaytracingAccelerationStructure* (S_OK), and ValidateRehydrateAccelerationStructureBuildDesc (S_OK).
  • Keeps constructor, destructor, GetRaytracingAccelerationStructurePrebuildInfo, and Set64BitMortonCodes bound to the title DLL.

Verification

  • cargo test --locked -p victory-hle bvh_builder (1 passed; 0 failed)
  • cargo clippy --locked -p victory-hle -p victory -- -D warnings (clean)
  • cargo xtask policy (asset policy: 294 files ok)
  • Tested locally on Windows 11 (RTX 3060 12 GB, Ryzen 5 7500F, 32 GB RAM): resolves both the Series X startup crash and the Series S heavy-scene crash.
**@⁠wellisrite** on GitHub · 2026-12-02 04:39 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/418) `wellisrite:fix/stub-bvh-builder-when-off` → `main` · +142 −0 · 3 files · 72 commits · closed without merging Fixes #375 ### Problem When `VICTORY_BVH_BUILDER` is off (the default), the GPU side already skips ray-tracing BVH shaders, but the title still calls into `XboxBvhBuilder.dll` (`BuildRaytracingAccelerationStructureBatched2X`, etc.) on the CPU. On a 12 GB RTX 3060 / 32 GB RAM system this caused: - **Series X:** `D3D12 XDXR Error: Failed to allocate upload buffer` (`0xe06d7363` / `0x80004005` at `XboxBvhBuilder.dll+0x210bc`) during initial scene load. - **Series S:** `0xc0000005` (`write 0x0` at `XboxBvhBuilder.dll+0x1cef4`) in heavy prestream scenes when the title's internal pools were nearly full. ### Change - Added `victory_hle::modules::bvh_builder::Interpose` (modeled after `fidelityfx::Interpose`), chained in `apps/victory/src/run.rs`. - When `VICTORY_BVH_BUILDER != 1` (and `VICTORY_BVH_STUB != 0`), stubs `BuildRaytracingAccelerationStructure`, `BuildRaytracingAccelerationStructureBatched2X`, `CopyRaytracingAccelerationStructure`, `CpuValidateResultX`, `RehydrateRaytracingAccelerationStructure*` (`S_OK`), and `ValidateRehydrateAccelerationStructureBuildDesc` (`S_OK`). - Keeps constructor, destructor, `GetRaytracingAccelerationStructurePrebuildInfo`, and `Set64BitMortonCodes` bound to the title DLL. ### Verification - `cargo test --locked -p victory-hle bvh_builder` (`1 passed; 0 failed`) - `cargo clippy --locked -p victory-hle -p victory -- -D warnings` (clean) - `cargo xtask policy` (`asset policy: 294 files ok`) - Tested locally on Windows 11 (`RTX 3060 12 GB`, `Ryzen 5 7500F`, `32 GB` RAM): resolves both the Series X startup crash and the Series S heavy-scene crash.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 04:44:19 +00:00
github-bot closed this pull request 2026-12-02 07:54:16 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.