gpu(native): wrap non-linear multi-page VB, IB, and blit spans (#442) #447
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!447
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-443"
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?
@Sheffy007 on GitHub · 2026-11-27 19:07 UTC · original
Sheffy007:fix/multipage-vb-ib-blit-aliases→main· +439 −54 · 7 files · 1 commits · merged 2026-11-28 00:38 UTCSummary
Fixes hardware stage-in vertex buffers, hardware index buffers, and buffer blits/indirect spans that cross 64 KiB title-page boundaries mapped in descending or non-contiguous pool order (
#442,#258):SizeInBytesonIASetVertexBuffersandIASetIndexBufferand wrap non-linear mapped prefixes (list.rs,glue.rs,native/list.rs,native/memory.rs,native/host.rs):glue::vertex_buffersandlist::state::index_buffernow forwardSizeInBytes(clearingindexwhenaddress == 0 || size == 0).PoolTable::resolve_prefix/NativeHost::resolve_spankeep the fast linear pool-buffer path when all mapped pages of[addr, addr + size)follow linearly in one pool, and wrap the title's contiguous virtual pages viaNativeHost::title_aliaswhen the mapped prefix crosses descending or scattered pool pages (even when a reserved buffer'sSizeInBytesextends past its mapped tail). This stops Metal's[[stage_in]]vertex fetcher and hardware index fetcher from reading past the first 64 KiB page into adjacent unrelated pool memory.native/host.rs):prepresolvesindexonly onDrawCall::Indexedand skips bothvertexandindexonDrawCall::Mesh, preventing stale IA bindings to later-unmapped pages from dropping non-indexed draws or mesh dispatches.native/host.rs):Cmd::Copy,Cmd::Fill,Cmd::CopyBufferToTexture,Cmd::CopyTextureToBuffer, andExecuteIndirectargument/count addresses useNativeHost::resolve_or_aliasinstead of dropping non-linear title ranges withNOT_MAPPED.title_aliascachesPoolTable::generation()alongside the mapping signature (avoiding repeatedPoolTablewalks across draws at the same generation) and separates the eviction limit into1024small wraps (< 16 MiB) and64large wraps (>= 16 MiB).Verification
native::memory::tests::resolve_prefix_handles_linear_descending_and_partially_mapped_spansnative::tests::descending_pool_page_vertex_index_and_blit_spans_render_and_follow_remaps(Metal GPU quad draw straddling descending pool pages for both VB and IB with poisoned adjacent pool pages, page remap invalidation, reserved oversizedSizeInBytes, stale unmapped IB on non-indexed draw, and descending-pageFill+Copy)cargo test -j6 -p victory-hle -p victory -p victory-gpu -p victory-metal -p victory-shader -p xtaskcargo clippy -j6 --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warningscargo clippy -j6 --workspace --all-targets --all-features --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policyCloses #446
Refs #258
cc @Olima34
@alexballvideos-netizen on GitHub · 2026-11-27 21:28 UTC · original
Tested this PR (
4ff27ec0, onb998bb65) against main on an M3 Max, 36 GB, macOS 27.2.1, Series X, headless, 300 s, withVICTORY_DEPTH_TWINS=0so the scene is lit enough to judge geometry. Dumps every 20 s from 110 s. Counts only.b998bb650x2215c35path)lit=, peakThe black holes are axis-aligned and look like blocks of the lit target left unwritten, rather than triangles. That's a guess, but it would point at a tiled lighting or classification pass that drops tiles, not at vertex fetch.
4ff27ec09ato014f943878