Resolve overlapping staged Vulkan copy regions #243
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/vktory6--VKtory!243
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-243"
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?
@Omar-Alme on GitHub · 2026-12-02 15:54 UTC · original
Omar-Alme:render/order-staged-buffer-writes→main· +134 −4 · 3 files · 2 commits · openWhat
Closes #160. vkback can batch multiple staged writes into one
vkCmdCopyBuffercall for a destination buffer. When queued writes overlap, Vulkan forbids those overlapping destination regions and the later write must still win as it does on the direct-write path. The resolver partitions the ranges by destination boundaries, keeps the latest queued write for each byte, and coalesces compatible adjacent regions. Both staged-copy flush paths use it.Reference
The motivating behavior is the Vulkan validation error reported in #160 (
VUID-vkCmdCopyBuffer-pRegions-12482). There is no D3D12 counterpart: this enforces Vulkan's copy-region validity while preserving vkback's existing queued-write semantics.Evidence
cargo test --manifest-path greenfield/Cargo.toml -j 6 --locked -p vkback --lib staged_copies_: 2 passed; the tests cover exact duplicates, partial/nested overlaps, last-write-wins bytes, and unchanged disjoint copies.VK_LAYER_KHRONOS_validationenabled.cargo test --manifest-path greenfield/Cargo.toml -j 6 --locked -p vkbackpassed, including the host XCB and GPU tests; the six vkback policy tests passed.cargo clippy --manifest-path greenfield/Cargo.toml -j 6 --locked -p vkback --all-targets -- -D warningspassed.@vktory6 on GitHub · 2026-12-02 17:37 UTC · original
Merged, thanks: overlapping staged writes in one copy now resolve to the latest write per byte, so the copy regions no longer overlap (the validation error in #160).
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.