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

Closed
github-bot wants to merge 2 commits from gh-pr/1523/head into gh-pr/1523/base
Owner

@⁠cyudev on GitHub · 2026-11-24 18:45 UTC · original
cyudev:gpu/nvidia-host-limits → main · +27 −2 · 1 files · 2 commits · closed without merging

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

**@⁠cyudev** on GitHub · 2026-11-24 18:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/1523) `cyudev:gpu/nvidia-host-limits` → `main` · +27 −2 · 1 files · 2 commits · closed without merging ## 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)
NVIDIA (RTX 3060 Ti) refuses B4G4R4A4 render targets and B5G5R5A1/B5G6R5
typed UAV stores, which the console and AMD allow: Grand Theft Auto VI's
two 2560x1440 targets of those formats had no host texture. Render-target
and unordered-access textures of such formats now get a B8G8R8A8 host
copy, which their views, target views, clear values and pipelines name;
sampled-only textures keep their format. Copies between a widened and a
native texture are skipped (the host refuses them).

A view heap larger than the host takes now finds the host's limit by
binary search instead of assuming the portable 1,000,000 (which is
exactly the RTX 3060 Ti's limit).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#89 (open since before this PR) already makes packed 16-bit render
targets R8G8B8A8 where the host cannot render to them or store to them,
and converts copies instead of skipping them. In the title on an RTX 3060
Ti, a tree with #89 creates both 2560x1440 targets (no `no host texture`).
This PR now only sizes the capped view heap to the host's limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:35:03 +00:00
github-bot closed this pull request 2026-11-26 04:35:03 +00:00
Author
Owner

@⁠wwwwwwww3333333 on GitHub · 2026-11-24 19:17 UTC · original

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).

**@⁠wwwwwwww3333333** on GitHub · 2026-11-24 19:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7141873949) 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).
Author
Owner

@⁠Bullet18x on GitHub · 2026-11-24 20:07 UTC · original

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.

**@⁠Bullet18x** on GitHub · 2026-11-24 20:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7143079656) 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.
Author
Owner

@⁠cyudev on GitHub · 2026-11-24 20:45 UTC · original

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.

**@⁠cyudev** on GitHub · 2026-11-24 20:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7144012814) 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.
Author
Owner

@⁠adnanoos on GitHub · 2026-11-24 21:02 UTC · original

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.

**@⁠adnanoos** on GitHub · 2026-11-24 21:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7144396063) 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.
Author
Owner

@⁠cyudev on GitHub · 2026-11-24 21:33 UTC · original

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.

**@⁠cyudev** on GitHub · 2026-11-24 21:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/1523#issuecomment-7145095713) 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

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/Marvisak--VIctory!1523
No description provided.