GPU/descriptor: sync raw-copied heap slots before draw passes and handle page-straddling records #801
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/802"
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?
Imported from fxceless/victory-fork. Originally posted by AscilCH on 2026-11-25T08:19:12Z.
Summary
Fix two
descriptor::sync_heaps()bugs introduced ina26859f..9376fd6(crates/victory-gpu/src/descriptor.rs,crates/victory-gpu/src/draw.rs):Sync raw-byte-copied slots before
State::heap_buffersandState::early_texturesrun.sync_heaps()previously ran only atHost::submit()(after command-list recording). For raw-byte-copied buffer views and placed textures (View::is_buffer()),HostHeap::mirror(..., /*for_draw=*/ false)defers materialization, writes a NULL descriptor into the host slot, and queues the slot intochanged/texturesforheap_buffers()/heap_textures().State::heap_buffers()already ran and latched its per-frameFRAMEguard during recording, runningsync_heaps()only atHost::submit()nulled out raw-copied buffer and placed-texture slots immediately before GPU execution.crate::descriptor::sync_heaps()before drainingbuffer_changes()inState::heap_buffers()and beforeheap_textures()inState::early_textures()(keeping theHost::submit()call for samplers and texture objects copied after recording).Handle descriptor records straddling 64 KiB
PAGEboundaries insync_heaps().sync_heaps()sliced each dirty range into 64 KiBPAGEchunks and skipped any slot where(handle - from)underflowed orat + step > page_bytes.len(). In an unaligned placed heap, any record straddling a 64 KiB boundary was dropped by both adjacent pages.read_into()of thestep-byte record into a stack buffer whenever a slot in[start, end)straddlesfromorto.Verification
cargo test -p victory-gpu --locked -- descriptor:::30 passed; 0 failed; 0 ignored, including newstraddling_record_across_page_boundary_is_mirrored_on_syncandraw_copied_buffer_view_is_queued_by_sync_heaps_and_made_for_draw.cargo clippy -p victory-gpu --all-targets --all-features --locked: 0 warnings incrates/victory-gpu/src/descriptor.rsandcrates/victory-gpu/src/draw.rs(only pre-existing9376fd6warnings indraw.rs:2399andindirect.rs:1436).cargo xtask policy:171 files ok.(AI-assisted; synthetic unit tests only, no game data.)
Imported from fxceless/victory-fork. Originally posted by yualk on 2026-11-25T18:54:32Z.
Independent off-title WARP check of exact
55502c19on top of #792's coherent record decoder (635b77cproduction change):ResourceDescriptorHeap[NonUniformResourceIndex(slot)](createHandleFromHeap) andTexture2D.Load(0,0,0)on raw-copied placed-Texture2D slot 2047.0). API-published control0xff21d452, same-shaped decoy0xff7924b6, and covered guard0xffffffffpassed after the production submission fence.0xc35a29e7; controls/guard unchanged. Scan receipts were[pages, looked, mirrored] = [1,2048,3]aligned and[2,2049,3]straddling.336/460 usbaseline vs374/557 uscombined. This is synthetic first-draw cost, not title FPS.No game data, title launch, or lighting claim. This qualifies the combined changes for a first live copied-Texture2D comparison; it does not prove a title slot or the exposure LUT uses this path. AI-assisted fixture; I reviewed the fenced outputs and split attribution.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.