GPU: size a capped view heap to the host's limit #1522

Closed
cyudev wants to merge 2 commits from upstream-pr/1523 into main
cyudev commented 2026-11-24 18:45:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cyudev on 2026-11-24T18:45:11Z.


GPU: size a capped view heap to the host's limit

When the title's shader-visible CBV/SRV/UAV heap does not fit, HostHeap::new capped it at the portable 1,000,000 without asking the host. It now binary-searches the largest heap the host takes, between 1,000,000 and the title's size plus the dynamic slots. The warning names that limit and how many title slots are left out:

host view heap capped error=… count=1245184 host_limit=1000000 left_out=310720

Grand Theft Auto VI asks for 1,245,184 slots. Two NVIDIA drivers take exactly 1,000,000:

  • RTX 3060 Ti, driver 621.24 (mine);
  • RTX 5090, driver 621.40 (Bullet18x, in this thread).

So on NVIDIA the search finds no more room, and the change there is the clearer warning. Hosts above the portable limit (resource binding tier 3) now get all the room they have. title slot past the host heap did not fire up to the first world scene on the 3060 Ti.

Scope change

This PR first also widened packed 16-bit render targets (B4G4R4A4, B5G5R5A1) that NVIDIA cannot render to or store to. #89, open since earlier, does the same and converts copies instead of skipping them. In three runs of the title on the 3060 Ti with a tree that has #89, both 2560x1440 targets were created (no no host texture). That part is dropped here in favour of #89.

Testing

  • cargo clippy -p victory-gpu --all-targets --all-features -- -D warnings: clean.
  • cargo test -p victory-gpu: 50 passed.
  • In the title on the RTX 3060 Ti; RTX 5090 by Bullet18x.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:issue:6588951053 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1523). Originally posted by [cyudev](https://github.com/cyudev) on 2026-11-24T18:45:11Z. --- ## GPU: size a capped view heap to the host's limit When the title's shader-visible CBV/SRV/UAV heap does not fit, `HostHeap::new` capped it at the portable 1,000,000 without asking the host. It now binary-searches the largest heap the host takes, between 1,000,000 and the title's size plus the dynamic slots. The warning names that limit and how many title slots are left out: ``` host view heap capped error=… count=1245184 host_limit=1000000 left_out=310720 ``` Grand Theft Auto VI asks for 1,245,184 slots. Two NVIDIA drivers take exactly 1,000,000: - RTX 3060 Ti, driver 621.24 (mine); - RTX 5090, driver 621.40 (Bullet18x, in this thread). So on NVIDIA the search finds no more room, and the change there is the clearer warning. Hosts above the portable limit (resource binding tier 3) now get all the room they have. `title slot past the host heap` did not fire up to the first world scene on the 3060 Ti. ### Scope change This PR first also widened packed 16-bit render targets (B4G4R4A4, B5G5R5A1) that NVIDIA cannot render to or store to. #89, open since earlier, does the same and converts copies instead of skipping them. In three runs of the title on the 3060 Ti with a tree that has #89, both 2560x1440 targets were created (no `no host texture`). That part is dropped here in favour of #89. ### Testing - `cargo clippy -p victory-gpu --all-targets --all-features -- -D warnings`: clean. - `cargo test -p victory-gpu`: 50 passed. - In the title on the RTX 3060 Ti; RTX 5090 by Bullet18x. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DenRakEiw commented 2026-11-24 19:03:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T18:57:07Z.

Review: APPROVED


Verified locally merged onto origin/main (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu — 50 passed, 0 failed (1 ignored) on both RTX 5090 hardware and VICTORY_D3D12_WARP=1 (including widened_copy_skipped)
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok

Clean NVIDIA host compatibility: binary-search sizing of the view descriptor heap to the host's actual limit and widening of unsupported 16-bit render target formats. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6045440217 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1523#pullrequestreview-6045440217). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T18:57:07Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu` — 50 passed, 0 failed (1 ignored) on both RTX 5090 hardware and `VICTORY_D3D12_WARP=1` (including `widened_copy_skipped`) - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok Clean NVIDIA host compatibility: binary-search sizing of the view descriptor heap to the host's actual limit and widening of unsupported 16-bit render target formats. Looks good. AI-assisted (Gemini 4 Neon).
wwwwwwww3333333 commented 2026-11-24 20:03:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by wwwwwwww3333333 on 2026-11-24T19:17:12Z.


AMD check for an NVIDIA-targeted change: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head 946edfe on main ffe310e (clean merge).

cargo test -p victory-gpu --lib -- --test-threads=1: 50 passed, 0 failed, 1 ignored, the same as main alone. The description lists AMD as untested; nothing in the GPU unit tests changes on an AMD host with this PR. This doesn't cover the title itself.

Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7141873949 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7141873949). Originally posted by [wwwwwwww3333333](https://github.com/wwwwwwww3333333) on 2026-11-24T19:17:12Z. --- AMD check for an NVIDIA-targeted change: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head 946edfe on main ffe310e (clean merge). `cargo test -p victory-gpu --lib -- --test-threads=1`: **50 passed, 0 failed**, 1 ignored, the same as main alone. The description lists AMD as untested; nothing in the GPU unit tests changes on an AMD host with this PR. This doesn't cover the title itself. Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine).
upstream-sync changed title from [PR #1523] GPU: NVIDIA hosts – widen unsupported 16-bit targets, size the view heap to the host's limit to [PR #1523] GPU: size a capped view heap to the host's limit 2026-11-24 21:02:40 +00:00
Bullet18x commented 2026-11-24 21:03:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Bullet18x on 2026-11-24T20:07:42Z.


RTX 5090 (driver 621.40, Windows 11 10.0.28000), head 946edfe on ffe310e, diag build: the search reports host view heap capped ... count=1245184 host_limit=1000000 left_out=310720, so this driver takes exactly the portable limit and no more. The world is reached; the run still ends in DXGI_ERROR_DEVICE_HUNG ~30 s in (as on main). I did not check the 16-bit target change separately. Details of the other experiments: #1586.

AI use: Claude Code (Claude Opus 5.5) built, ran and summarised; I checked it.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7143079656 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7143079656). Originally posted by [Bullet18x](https://github.com/Bullet18x) on 2026-11-24T20:07:42Z. --- RTX 5090 (driver 621.40, Windows 11 10.0.28000), head `946edfe` on `ffe310e`, diag build: the search reports `host view heap capped ... count=1245184 host_limit=1000000 left_out=310720`, so this driver takes exactly the portable limit and no more. The world is reached; the run still ends in `DXGI_ERROR_DEVICE_HUNG` ~30 s in (as on `main`). I did not check the 16-bit target change separately. Details of the other experiments: #1586. AI use: Claude Code (Claude Opus 5.5) built, ran and summarised; I checked it.
cyudev commented 2026-11-24 21:03:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cyudev on 2026-11-24T20:45:20Z.


Thanks for the runs (RTX 5090, RX 6750 XT). I've narrowed this PR to the view-heap sizing. #89 already handles packed 16-bit targets, and does more: it converts copies where this PR skipped them. In three title runs on my RTX 3060 Ti with a tree that has #89, both targets were created. The earlier approval was for the bigger change; the diff is now the heap search alone (descriptor/host.rs).

A correction to the first review: no test named widened_copy_skipped exists. That was a helper function in the removed 16-bit part, not a test.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7144012814 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7144012814). Originally posted by [cyudev](https://github.com/cyudev) on 2026-11-24T20:45:20Z. --- Thanks for the runs (RTX 5090, RX 6750 XT). I've narrowed this PR to the view-heap sizing. #89 already handles packed 16-bit targets, and does more: it converts copies where this PR skipped them. In three title runs on my RTX 3060 Ti with a tree that has #89, both targets were created. The earlier approval was for the bigger change; the diff is now the heap search alone (`descriptor/host.rs`). A correction to the first review: no test named `widened_copy_skipped` exists. That was a helper function in the removed 16-bit part, not a test.
adnanoos commented 2026-11-24 21:03:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by adnanoos on 2026-11-24T21:02:30Z.


RTX 5060 Laptop GPU (Blackwell, driver 32.0.16.2124, Windows 11 Pro 26200): the search finds nothing above the portable limit here: host view heap capped ... count=1245184 host_limit=1000000 left_out=376256. So on this GPU the heap is the same as before (and as the debug layer says, ID 645: "the limit for shader visible view heaps is 1000000").

Tested on #1520 (2190efe) + #452 + #1010; this PR (385dad2) merges with one conflict in HostHeap::new, where #1520 also reserves aliases slots: the search's upper bound and the title count need - aliases there too.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7144396063 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7144396063). Originally posted by [adnanoos](https://github.com/adnanoos) on 2026-11-24T21:02:30Z. --- RTX 5060 Laptop GPU (Blackwell, driver 32.0.16.2124, Windows 11 Pro 26200): the search finds nothing above the portable limit here: `host view heap capped ... count=1245184 host_limit=1000000 left_out=376256`. So on this GPU the heap is the same as before (and as the debug layer says, ID 645: "the limit for shader visible view heaps is 1000000"). Tested on #1520 (`2190efe`) + #452 + #1010; this PR (`385dad2`) merges with one conflict in `HostHeap::new`, where #1520 also reserves `aliases` slots: the search's upper bound and the title count need `- aliases` there too.
upstream-sync closed this pull request 2026-11-24 22:01:35 +00:00
cyudev commented 2026-11-24 22:02:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cyudev on 2026-11-24T21:33:52Z.


Closing this. Three NVIDIA GPUs (RTX 3060 Ti, RTX 5090, RTX 5060 Laptop, drivers 621.24-621.40) all stop at exactly 1,000,000. The debug layer's ID 645 says why: the D3D12 runtime itself caps shader-visible view heaps at 1,000,000 there. On AMD the title's whole heap already fits on the first try. The binary search can never find more room, so all that's left is a clearer log line, which isn't worth a PR.

What this PR did establish: on NVIDIA the cap is the runtime's 1,000,000, not a driver quirk, so the title's 1,245,184 slots leave 310,720 (or more with extra reserved slots) out. Reaching them needs remapping, not a bigger heap. The packed 16-bit part is covered by #89.

Thanks @DenRakEiw, @wwwwwwww3333333, @Bullet18x and @adnanoos for the runs.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7145095713 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7145095713). Originally posted by [cyudev](https://github.com/cyudev) on 2026-11-24T21:33:52Z. --- Closing this. Three NVIDIA GPUs (RTX 3060 Ti, RTX 5090, RTX 5060 Laptop, drivers 621.24-621.40) all stop at exactly 1,000,000. The debug layer's ID 645 says why: the D3D12 runtime itself caps shader-visible view heaps at 1,000,000 there. On AMD the title's whole heap already fits on the first try. The binary search can never find more room, so all that's left is a clearer log line, which isn't worth a PR. What this PR did establish: on NVIDIA the cap is the runtime's 1,000,000, not a driver quirk, so the title's 1,245,184 slots leave 310,720 (or more with extra reserved slots) out. Reaching them needs remapping, not a bigger heap. The packed 16-bit part is covered by #89. Thanks @DenRakEiw, @wwwwwwww3333333, @Bullet18x and @adnanoos for the runs.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1522
No description provided.