GPU: cap oversized sampler heaps #1032

Open
divyeshganta wants to merge 2 commits from upstream-pr/1032 into main
divyeshganta commented 2026-11-24 15:14:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by divyeshganta on 2026-11-24T15:14:02Z.


Caps oversized host sampler heaps at D3D12’s 2,048 descriptor limit and logs when higher slots are unavailable. Addresses #65.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6585018019 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1032). Originally posted by [divyeshganta](https://github.com/divyeshganta) on 2026-11-24T15:14:02Z. --- Caps oversized host sampler heaps at D3D12’s 2,048 descriptor limit and logs when higher slots are unavailable. Addresses #65.
ThomasHFWright commented 2026-11-24 16:05:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ThomasHFWright on 2026-11-24T15:23:45Z.


Independent Wine/hardware validation of 392b86f50af9fd20ab899985cff39811ee3360c2, base ffe310e. This reproduces the oversized sampler-heap failure and confirms that the cap avoids it on this setup.

A temporary test inside descriptor::host::tests required the hardware device, created sampler heaps with the following requested counts, and checked GetDesc().NumDescriptors, the tracked count, made/kept lengths, zero dynamic slots, and no device removal:

Requested Created / tracked
1 1
2,048 2,048
2,049 2,048
65,536 2,048

All checks passed. Negative control: retaining the test but replacing count.min(PORTABLE_SAMPLERS) with count makes HostHeap::new(true, 2049) return None, failing after the first two cases. The test/control edits were removed before the full suite.

Full workspace unit/integration suite, all features, all 14 generated Windows MSVC test executables: 341 passed, 5 failed, 6 ignored, identical to the matched ffe310e baseline. The five failures remain the empty pipeline library (#347), missing Wine Winsock export (#217), shader-checksum rejection expectation, nested Cargo fixture build, and Windows xtask attempting to launch host Git. Native Linux xtask separately passes all 4 tests. Windows-target workspace Clippy with all targets/features and -D warnings, and native cargo xtask policy, pass.

Environment: Rust 1.98.1, Wine 11.22, RTX 5090 / NVIDIA 620.73.04, vkd3d-proton 30b0eb9bc12dc9f, native d3dcompiler_47 for GPU fixtures; same runtime DLLs as baseline. Offline, offscreen, no game data. This establishes heap-creation behavior only: it does not establish correct rendering for titles using sampler slots above 2,047, which remain unavailable. No gameplay, native Windows/WARP, or Wine doctests were run. Aggregate counts include existing early-return tests when optional console compilers or the DXIL validator are unavailable.

AI-assisted testing with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135952581 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1032#issuecomment-7135952581). Originally posted by [ThomasHFWright](https://github.com/ThomasHFWright) on 2026-11-24T15:23:45Z. --- Independent Wine/hardware validation of `392b86f50af9fd20ab899985cff39811ee3360c2`, base `ffe310e`. This reproduces the oversized sampler-heap failure and confirms that the cap avoids it on this setup. A temporary test inside `descriptor::host::tests` required the hardware device, created sampler heaps with the following requested counts, and checked `GetDesc().NumDescriptors`, the tracked count, `made`/`kept` lengths, zero dynamic slots, and no device removal: | Requested | Created / tracked | | ---: | ---: | | 1 | 1 | | 2,048 | 2,048 | | 2,049 | 2,048 | | 65,536 | 2,048 | All checks passed. Negative control: retaining the test but replacing `count.min(PORTABLE_SAMPLERS)` with `count` makes `HostHeap::new(true, 2049)` return `None`, failing after the first two cases. The test/control edits were removed before the full suite. Full workspace unit/integration suite, all features, all 14 generated Windows MSVC test executables: **341 passed, 5 failed, 6 ignored**, identical to the matched `ffe310e` baseline. The five failures remain the empty pipeline library (#347), missing Wine Winsock export (#217), shader-checksum rejection expectation, nested Cargo fixture build, and Windows xtask attempting to launch host Git. Native Linux xtask separately passes all 4 tests. Windows-target workspace Clippy with all targets/features and `-D warnings`, and native `cargo xtask policy`, pass. Environment: Rust 1.98.1, Wine 11.22, RTX 5090 / NVIDIA 620.73.04, vkd3d-proton `30b0eb9bc12dc9f`, native `d3dcompiler_47` for GPU fixtures; same runtime DLLs as baseline. Offline, offscreen, no game data. This establishes heap-creation behavior only: it does not establish correct rendering for titles using sampler slots above 2,047, which remain unavailable. No gameplay, native Windows/WARP, or Wine doctests were run. Aggregate counts include existing early-return tests when optional console compilers or the DXIL validator are unavailable. AI-assisted testing with Codex.
Zipettte commented 2026-11-24 17:04:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T16:30:33Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at b38a3c9: cargo test -p victory-gpu passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137774998 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1032#issuecomment-7137774998). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T16:30:33Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at b38a3c9: `cargo test -p victory-gpu` passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Marvisak commented 2026-11-25 01:08:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:34:02Z.


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-gpu/src/descriptor/host.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148645106 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1032#issuecomment-7148645106). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:34:02Z. --- <!-- victory-triage v1 head=b38a3c9fa1a60647bcf152c6e6464be4137519c1 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-gpu/src/descriptor/host.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1032:upstream-pr/1032'
git switch 'upstream-pr/1032'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1032'
git switch 'upstream-pr/1032'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1032'
git switch 'upstream-pr/1032'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1032'
git switch 'main'
git merge --squash 'upstream-pr/1032'
git switch 'main'
git merge --ff-only 'upstream-pr/1032'
git switch 'main'
git merge 'upstream-pr/1032'
git push origin 'main'
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!1032
No description provided.