GPU: query the view heap limit before probing allocation #662

Open
github-bot wants to merge 2 commits from github-bot/gh-662 into main AGit
Owner

@⁠Pin0d1 on GitHub · 2026-11-25 04:12 UTC · original
Pin0d1:fix/view-heap-limit → main · +44 −16 · 1 files · 2 commits · open

On my RTX 2060 SUPER, startup tried to create a shader-visible CBV/SRV/UAV heap with 2,097,152 descriptors. The device reported a maximum of 1,000,000. Heap creation failed and D3D12 emitted error 645 (CREATE_DESCRIPTOR_HEAP_INVALID_DESC). The fallback still rendered all 16 expected pixels, so checking the image alone missed the error.

probe_view_limit now queries D3D12_FEATURE_D3D12_OPTIONS19 once. It uses the smaller of the reported capacity and the existing target size, with the final slot reserved for the null descriptor. Runtimes that do not return a usable capacity retain the allocation probe. There is no additional per-draw work.

I compared 310c6eb with this commit in separate Windows builds. In two runs per adapter with GPU-based validation, synchronized queue validation and full state tracking, the RTX reported 645 twice on main and zero times here. WARP reported no errors in either build. The five draw cases still produced 16/16 green pixels and three input vertices each on both adapters. The older-runtime fallback was not exercised on this hardware.

The checked-in limit test runs with cargo test --locked -p victory-gpu --features diagnostics --lib shader_view_limit_fits_the_reported_heap. To reproduce the debug-layer difference, run the main and view-heap cases in the independent harness. Source, commands and transcripts

On the clean PR head, Windows workspace tests passed (511 default, 519 with all features, 9 ignored in each configuration). The release workspace build and repository asset-policy test passed. Both Clippy configurations reported the same lints as on the base commit. Applying this change and #663 to #642 passed both Clippy commands. The workspace formatting check also failed on both. Commands and diagnostics

Prepared with the help of Codex 6.2 Astra Max.

**@⁠Pin0d1** on GitHub · 2026-11-25 04:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/662) `Pin0d1:fix/view-heap-limit` → `main` · +44 −16 · 1 files · 2 commits · open On my RTX 2060 SUPER, startup tried to create a shader-visible CBV/SRV/UAV heap with 2,097,152 descriptors. The device reported a maximum of 1,000,000. Heap creation failed and D3D12 emitted error 645 (`CREATE_DESCRIPTOR_HEAP_INVALID_DESC`). The fallback still rendered all 16 expected pixels, so checking the image alone missed the error. `probe_view_limit` now queries `D3D12_FEATURE_D3D12_OPTIONS19` once. It uses the smaller of the reported capacity and the existing target size, with the final slot reserved for the null descriptor. Runtimes that do not return a usable capacity retain the allocation probe. There is no additional per-draw work. I compared `310c6eb` with this commit in separate Windows builds. In two runs per adapter with GPU-based validation, synchronized queue validation and full state tracking, the RTX reported 645 twice on main and zero times here. WARP reported no errors in either build. The five draw cases still produced 16/16 green pixels and three input vertices each on both adapters. The older-runtime fallback was not exercised on this hardware. The checked-in limit test runs with `cargo test --locked -p victory-gpu --features diagnostics --lib shader_view_limit_fits_the_reported_heap`. To reproduce the debug-layer difference, run the `main` and `view-heap` cases in the independent harness. [Source, commands and transcripts](https://github.com/Pin0d1/victory-fork/tree/73f564e92ca86fe07be7c53492ee0e23a2471fa9/review-evidence) On the clean PR head, Windows workspace tests passed (511 default, 519 with all features, 9 ignored in each configuration). The release workspace build and repository asset-policy test passed. Both Clippy configurations reported the same lints as on the base commit. Applying this change and #663 to #642 passed both Clippy commands. The workspace formatting check also failed on both. [Commands and diagnostics](https://github.com/Pin0d1/victory-fork/blob/27ca3c0058a50ce618613b969d1cc8f180aebd46/review-evidence/results/workspace-checks.json) Prepared with the help of Codex 6.2 Astra Max.
Prepared with the help of Codex 6.2 Astra Max.
Prepared with the help of Codex 6.2 Astra Max.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:48:28 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/662/head:github-bot/gh-662'
git switch 'github-bot/gh-662'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-662'
git switch 'github-bot/gh-662'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-662'
git switch 'github-bot/gh-662'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-662'
git switch 'main'
git merge --squash 'github-bot/gh-662'
git switch 'main'
git merge --ff-only 'github-bot/gh-662'
git switch 'main'
git merge 'github-bot/gh-662'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.