GPU: size a capped view heap to the host's limit #1523
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1523
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1523/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@cyudev on GitHub · 2026-11-24 18:45 UTC · original
cyudev:gpu/nvidia-host-limits→main· +27 −2 · 1 files · 2 commits · closed without mergingGPU: size a capped view heap to the host's limit
When the title's shader-visible CBV/SRV/UAV heap does not fit,
HostHeap::newcapped 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:Grand Theft Auto VI asks for 1,245,184 slots. Two NVIDIA drivers take exactly 1,000,000:
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 heapdid 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.🤖 Generated with Claude Code
@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
946edfeon mainffe310e(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).
@Bullet18x on GitHub · 2026-11-24 20:07 UTC · original
RTX 5090 (driver 621.40, Windows 11 10.0.28000), head
946edfeonffe310e, diag build: the search reportshost 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 inDXGI_ERROR_DEVICE_HUNG~30 s in (as onmain). 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 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_skippedexists. That was a helper function in the removed 16-bit part, not a test.@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 inHostHeap::new, where #1520 also reservesaliasesslots: the search's upper bound and the title count need- aliasesthere too.@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.
Pull request closed