perf(gpu): batch constant_slots under one SHADER_HEAPS lock, skip Does::Refresh without copies, and zero-clone prelude_uploads #4042
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!4042
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4042"
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?
@qlfu on GitHub · 2026-11-30 15:05 UTC · original
qlfu:pr/perf-batched-constant-slots-and-prelude-uploads→main· +156 −39 · 5 files · 1 commits · closed without mergingSummary
Cuts submitting-thread and sending-thread CPU overhead in
card_stepsandprelude_uploads:descriptor::constant_slots_batch&constant_slots_shown(descriptor.rs,descriptor/host.rs,host/card_steps.rs):SHADER_HEAPS.read()once outside the worker pool instead of ~11,000 contendedRwLockacquisitions/frame across 8 threads.&HostHeaptargets once, pre-buckets ops by worker (index / 4 % parts) so workers do not scan the full slice 8x, and passes precomputedbuffer_gpuviaHostHeap::constant_at_with_baseto eliminate ~11,000 COMGetGPUVirtualAddress()calls/frame.Does::Refreshincard_steps::does_ofwhen noStep::Copyexists:Does::Refreshis only consulted byelsewhere()when evaluatingDoes::Copy; skipping refreshes when!has_copyshrinksdoes/steps/taken/givenby ~5-10x on copy-free submissions.HostList::prelude_uploadsfast path (texture.rs,host.rs):PreludeUpload::needs_finish_refresh()soprelude_uploadsavoids cloning the entireVec(and 3Arcs per entry) for the ~99% of textures already uploaded and clean, while still releasingself.deferred()before callingfinish_refresh().Verification
cargo check -p victory-gpu --all-targets --all-features --locked: exit 0.cargo test -p victory-gpu --lib --locked -- descriptor:: host::card_steps:: --test-threads=1: 125 passed, 0 failed.git merge-tree --write-tree 41adb551 HEAD: clean merge.heaps + slotsdown to0.2 ms.@trustno1-coder on GitHub · 2026-12-01 18:46 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed