GPU: cap a refused sampler heap and remap its past-cap tables #74
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/74"
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?
Imported from Marvisak/VIctory. Originally posted by WallasSCRIPTS on 2026-11-24T00:14:00Z.
Relates to #65.
What
A sampler heap larger than
D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE(2,048) that the host refused made
HostHeap::newreturnNone. The genericerror arm had no fallback, unlike view heaps which cap at 1,000,000.
Losing the heap is worse than losing the slots:
draw::State::bindbuildsSetDescriptorHeapswithfilter_map(...host()), so a heap without a hostis dropped and the heap indices the translated root signature expects shift.
This PR:
asked for, what the host made, and what was lost. The heap stays bound.
HostHeap::dynamic/releaseuse them.State::tablesalready remakes atable with an entry past
host.count(), so sampler tables past the capnow take that path instead of being skipped. An uncapped sampler heap
keeps all 2,048 slots for the title.
count.saturating_add(extra)keeps a title asking foru32::MAXon the cappath rather than overflowing in a debug build.
Driver note
Some drivers accept a 2,049-slot sampler heap — the RX 7600 here does. The
test forces the refusal with
u32::MAXso the path is exercised on any host.Verification
cargo test -p victory-gpu: 41 passed, 0 failed.cargo clippy -p victory-gpu --all-targets: clean.rustfmt --edition 2024clean. The file haspre-existing formatting drift elsewhere, untouched here.
no title was run.
Imported from Marvisak/VIctory. Originally posted by WallasSCRIPTS on 2026-11-24T00:25:05Z.
Closing in favour of #86, which is the better design and covers the same
ground. #74 only capped when the host refused an over-limit sampler heap;
the RX 7600 here accepts one, so behaviour depended on the driver. #86 caps
at the spec limit up front and gives the capped heap its 256 scratch slots,
so
State::tablesremaps past-cap sampler tables on every host. It alsofixes the null-sampler fallback and reports an oversized table instead of
dropping it. One PR for #65 is enough.
One suggestion if it helps: the cap warning currently logs only
count.Reporting
wanted,madeandlostlike the view-heap warning in #35makes a tester's log self-explanatory without a second diagnostic run.
Verified on my branch before closing:
cargo test -p victory-gpu41 passed,clippy clean. No title run.
Pull request closed