GPU: bound shadow buffer lookup by maximum registered size instead of 64 entries #2556
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2556
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2556"
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?
@fuzeofficlal on GitHub · 2026-11-29 14:18 UTC · original
fuzeofficlal:fix/gpu-shadow-find-max-size→main· +244 −47 · 1 files · 1 commits · merged 2026-11-30 14:12 UTCProblem
BUFFERSreverse scans incrates/victory-gpu/src/shadow.rs(lookup,peek,peek_overlapping,extent,in_buffer, andin_place_let_go) stopped after a fixed.take(64)/.take(256)entry cap. When a title registers more than 64 smaller inner buffers inside a larger covering heap/buffer, lookups past those inner buffers missed the covering outer buffer and fell through to loose windows or returnedNone.Fix
BUFFERS(RwLock<Buffers>) to track live registration counts per buffer size insizes: BTreeMap<u64, usize>, keepingmax_size()exact in O(log n) across inserts, in-place size replacements, and removals..take(64)/.take(256)caps inlookup(both read and write paths),peek,peek_overlapping,extent,in_buffer, andin_place_let_gowith a reverse range bounded bymax_size()(lowest = end.saturating_sub(max_size)).extentandnearfrom write-lockingbuffers()to sharedbuffers_read().shadow::buffer_lookup_testscovering lookup (find,extent,in_buffer,peek,peek_overlapping) past 128 inner buffers,max_size()bounding and tightening on unregister, equal-size counts, in-place replacements, and descending removals to empty.Verification
cargo test --locked -p victory-gpu --lib shadow::buffer_lookup_tests -- --test-threads=1— passed on RTX 5090 and WARP (VICTORY_D3D12_WARP=1).cargo clippy --locked -p victory-gpu --tests— 0 new warnings inshadow.rs.cargo run --quiet --locked -p xtask -- policy --staged— passed.