gpu: cache heap handles, fast-path twins_written, reuse Deferred allocations, and stack-allocate hot list paths #347
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!347
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-347"
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?
@Wiktorxd-1 on GitHub · 2026-11-27 21:15 UTC · original
Wiktorxd-1:perf/host-handles-and-deferred-reuse→main· +115 −32 · 4 files · 2 commits · merged 2026-11-29 08:16 UTCWhat this fixes
Command-list translation (
victory_gpu::list::thin) and draw recording hit several avoidable per-call overheads on every draw, barrier, render-target bind, and list reset:HostHeap::gpu_handlecalledID3D12DescriptorHeap::GetGPUDescriptorHandleForHeapStart()on every descriptor lookup, even thoughHostHeap::newalready computesgpu.Host::rtvandHost::dsvcalledGetCPUDescriptorHandleForHeapStart()on every RTV/DSV creation.HostList::twins_written()lockedself.twinsat the end of everydraw::State::bind, even on lists that never touch a depth twin.HostList::resetreplaced*self.deferred() = Deferred::default(), dropping allVec,HashSet, andHashMapheap capacities on every list reset.list::state::targets,list::barrier, anddraw::State::bindheap-allocated small temporaryVecs ([u64; 8],Vec<Barrier>,Vec::with_capacity(2)) on every call.I can't give a clean 3D-scene fps delta yet: the local launch test (
90s, Series S, DLSS Performance, FG 6x) only ran through boot and the intro/menu at 120 presents/s (warns=0,crashes.log=False) without loading into a heavy 3D save.The commits
HostHeap::gpu,Host::rtv_start,Host::dsv_start).HostHeap::newandHost::newstore the descriptor heap start pointers once instead of querying COM on every handle/view lookup.HostList::twins_written()fast path. Addedhas_twins: AtomicBoolonHostList(set intwin_use, cleared inHostList::reset) sotwins_written()returns immediately when no depth twin is in use.Deferredallocations acrossHostList::reset. AddedDeferred::clear()(preservinggive_chunksandALIVE[6]/ALIVE[7]accounting fromDrop) socopies,uploads,kept,bound,refreshed,gpu_written,filled,textures,writes,backs, andback_wanted/texture_backskeep their capacities.list::state::targetsuses a[u64; 8]stack buffer forone_range(and borrowsitems(handles, count)directly otherwise);list::barrieruses[MaybeUninit<Barrier>; 16]for< 16barriers;draw::State::binduses[Option<ID3D12DescriptorHeap>; 2].Tests
cargo test --locked -p victory-gpu --lib descriptor(110 passed, 0 failed, 16 ignored acrossdescriptor+host::)cargo test --locked -p victory-gpu --lib host::(passed, 0 failed)cargo build --release --locked -p victory(succeeded)target\release\victory.exeviascripts\play-nvidia.ps1(90s,warns=0,crashes.log=False).Setup
NVIDIA GeForce RTX 5070, driver
621.14.0, Windows 11 (10.0.26300). Series S profile, DLSS Performance, Frame Generation 6x. My own dump:<game dir>. No game files are attached or quoted.This change and its testing were done with an AI assistant (Antigravity), and I checked the results on my machine.
0b4cfccfb8to65e275c9e8