GPU: cap oversized sampler heaps at 2,048 with dynamic slots #2451
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!2451
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2451"
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?
@makmatvey on GitHub · 2026-11-25 13:48 UTC · original
makmatvey:cursor/gpu-sampler-heap-cap-afb6→main· +84 −13 · 2 files · 1 commits · openWhat's wrong
A title sampler heap larger than
D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE(2,048) makesHostHeap::newreturnNoneon hosts that refuse the larger heap.Descriptor::host()caches that miss, andState::bindbuildsSetDescriptorHeapswithfilter_map(...host()), so the heap disappears from the list and the root-signature heap indices shift (#65).View heaps already cap at
PORTABLE_VIEWS. Sampler heaps had no matching path. Open #1032 (triage: needs rebase) and closed #86 covered the same design; this is a focused re-land on currentmain.What the change does
In
crates/victory-gpu/src/descriptor/host.rs:State::tablescan remake tables whose entries reach past the cap (same path as capped view heaps).HostHeap::dynamic/releaseon capped sampler heaps.main.Comment in
draw.rsupdated to name the sampler limit next to the view one.Tests
large_sampler_heap_is_capped— requests4 * HEAP_SAMPLERS, expects 1,792 title slots, a 2,048-descriptor host heap, and working dynamic allocate/release.small_sampler_heap_has_no_dynamic_slots— requests 16, expects no dynamic slots and a host heap sized forHEAP_SAMPLERS.No game data used.
Fixes #65. Supersedes the needs-rebase approach in #1032 for current
main.@kotekompotek on GitHub · 2026-11-25 14:23 UTC · original
Mechanics verified:
State::tablesalready routes any table whose end index is>= host.count()through the fresh-table path (dynamic(n)+make_at), so a capped sampler heap works exactly like a capped view heap — before this,dynamic()unconditionally returnedNonefor samplers and the draw was dropped. Keeping the cap unconditional (not only when creation fails) makes behavior host-independent, matching the comment. The warn-once when a table exceeds the dynamic pool is a good failure signal — a 256-slot dynamic budget is small, so a pathological title table pattern will show in the log rather than silently dropping draws.@Marvisak on GitHub · 2026-11-25 16:08 UTC · original
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/descriptor/host.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
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.Merge
Merge the changes and update on Forgejo.