perf(gpu): batch texture queue mirrors, optimize equality/staging pass, fix HERO LEAD & prelude recheck #18
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/MahanYTT--VIctory-MA!18
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-18"
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?
@MahanYTT on GitHub · 2026-12-04 18:59 UTC · original
MahanYTT:perf/draw-texture-queue-lock→mega-upgrade-v3· +356 −85 · 2 files · 1 commits · merged 2026-12-04 20:18 UTCSummary
Targets the bottlenecks and edge-case warnings captured in
victory-ma-play-20261204-165800-18832.log:1. Texture queue lock (
queue_site::WRITE/noting a slot's record) & view-making overheadcrates/victory-gpu/src/draw.rs:QueueFlusherinsideTells<'a>(flushed strictly beforetexture_slots_toldinTells::flush) soheap_texturesmirrors (mirror,at_once,shows_other) batch up to 64 ops per lock instead of acquiringqueue_site::WRITEper slot.already_made(texture_slot_made_from) per slot inheap_texturesso slots already made from the current record (including the 155,500+ re-uploads under pressure) skip the duplicatetexture_slot_made_fromlock,texture_slot_shows_other, and redundanthost.mirrorcalls, reusing(held, held_key).host.mirrorcalls inheap_buffer_pass(batch.mirror) andflush_deferred_texture_standins(QueueFlusher).table_flusher: Option<QueueFlusher<'static>>onStateacross consecutive draws in the same command list (flushing onreset,clear_state,tables_done, andDrop).2. Host-copy equality checks, fingerprinting, and staging contention
crates/victory-gpu/src/texture.rs:STAGINGfromMutextoRwLockso read-heavy paths (is_staged,staged,staged_from,staged_memory,staged_state, andstagingcache hits) run concurrently without cross-thread mutex contention.unstage_memoryto remove and return(at, len)under a single write lock inheap_textures.title_memory_reading_of_now+!through_copy()+soft_runs.is_empty()+all_there) tofingerprintandunchanged_with_fingerprint(avoiding per-check kernel copies and buffer allocations), and computed the recheck fingerprint from the same read pass inheap_textureson a match.3.
HERO LEAD&prelude upload left outedge casescrates/victory-gpu/src/texture.rs:seed_laternow marksviewinHOST_WRITTEN(mark_host_written) without overwritingsource's entry inHOST_WRITTEN_AT, andplaced_in_host_writtenskips the false-positiveWARN HERO LEADwhenseed_lateralready scheduled a GPU copy fromsourceat the same address.PreludeUpload::finish_refreshdeduplicates host-written upload suppression (suppress_host_written_upload) by settinguploaded = trueand clearingdirty = false, preventing repeated refreshes and duplicate warnings across hoisted + own-list checks.crates/victory-gpu/src/draw.rs:heap_texturesandflush_deferred_texture_standinsnow checkcrate::texture::host_wrote(resource)alongsidetitle_written(andheap_texturesdefers slot visibility viatexture_slot_show_afterwhenseed_pendingrecorded a GPU seed copy onlist).Verification
cargo clippy -p victory-gpu --target x86_64-pc-windows-gnu -- -D warnings: pass (0 warnings)cargo clippy -p victory-gpu --tests --target x86_64-pc-windows-gnu -- -D warnings: pass (0 warnings)cargo clippy -p victory-gpu --features diagnostics --target x86_64-pc-windows-gnu -- -D warnings: pass (0 warnings)draw.rsandtexture.rs.