umem: declare the DMA-BUF handle type on sparse title windows #52
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!52
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-52"
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?
@TheRifai on GitHub · 2026-12-01 08:16 UTC · original
TheRifai:umem-sparse-window-dma-buf→main· +32 −10 · 1 files · 2 commits · merged 2026-12-01 08:32 UTCWhat
The chunks bound into a title window are exported as DMA-BUFs (
make_chunk), but the window's sparse buffer was created withoutVkExternalMemoryBufferCreateInfo. Binding exported memory into a resource that did not declare a matching handle type is invalid:VUID-VkSparseMemoryBind-memory-02730(issue #42, listed in docs/TASKS.md).window()now queriesvkGetPhysicalDeviceExternalBufferPropertiesfor the same flags/usage withDMA_BUF_EXTand declares that handle type on the sparse buffer where the driver offers the combination. Where it does not, the window stays plain and the fallback is counted (Stats::windows_without_dma_buf) and logged — the same shape as #30's counted image fallback.Evidence
cargo test -p umem: 14 unit tests + the sparse probes pass (they bind exported chunk memory through the window path).DMA_BUF_EXT.UNASSIGNED-Threading-MultipleThreads-Writeof issue #38; that is unrelated to this change and also occurs on main when a run exits.)The house scene on main does not currently emit 02730 (it was reported on a contributor build), so this is a spec-correctness fix for the documented cause rather than a removed-VUID A/B in that scene; the declaration is required whenever exported memory is sparse-bound.
793dbf279ato2ec5c09243@vktory6 on GitHub · 2026-12-01 08:31 UTC · original · edited 2026-12-01 08:33 UTC
Merged, thanks! The fix itself is right. umem needs the DMA-BUF export (it maps that fd into the title's address space), so declaring the handle type on the window is the correct fix, not dropping the export.
One commit of mine on top (
d7706f2), for AGENTS.md rule 33/36 (less code; no fallback for a case we can't support): the per-window query, the counter and the log are gone. umem now checks once at setup, next to the other driver checks, that the driver offers DMA-BUF export for that kind of sparse buffer, and stops there with a "deliberately unhandled" error if not. Every window then declares the handle type unconditionally. Going on with an invalid bind on a driver that lacks it would only make a later failure harder to read. RADV offers it, so nothing changes on the target.Check on the reference system (RX 9070 XT): umem and vkback tests and the policy pass, and the house-scene validation run shows no new error (02730 never fired in the house scene; its cause is gone by construction). It's off the validation list.
VUID-VkSparseMemoryBind-memory-02730on main (not on the TASKS.md list) #42