Files
metal2vulkan/crates
Anees Iqbal fb591032fa Count a dma-buf lane's in-place texture by its pages' class: the pointer's import on NVIDIA
What. `sampled_textures_over_dma_buf_pages_are_in_place_where_their_pages_make_one_dma_buf`
now counts an image in place by `host_textures_in_place` and tells its class apart: over a
dma-buf of its own pages (`dma_buf_textures_in_place`) where the device imports dma-bufs
(RADV), and over the pointer's import where the device imports the pointer (NVIDIA,
lavapipe), where the source must stay uncalled and no texture counts as a dma-buf one. The
RADV strict check (one run in place, scattered runs the source's refusal, where the DmaBuf
check passed) is kept. Where the device imports the pointer and its Pointer check passed,
each texture is in place or a shadow its refusal counts, as in_place_textures.rs holds any
texture over host pages (its `refused` helper is now shared). The printed line names both
counts.

Why. On the RTX 5080 Laptop GPU (NVIDIA 615.71.09) the device refuses foreign dma-buf
imports, so the no-copy buffer over the memfd view is a pointer import
(`texture.rs`: `CallerMemory::HostPages` without `over_dma_buf()` is
`PagesClass::Pointer`), the in-place check answered "Pointer: Passed", and the texture is an
image in place over that import, counted in `host_textures_in_place` alone. The test assumed an
aliased texture could only come from a dma-buf (`in_place == dma_buf_textures_in_place`), so it
failed with left 0, right 1 before its byte checks ran. The product took the right path; the
test was wrong.

Verified on msi's RTX 5080 Laptop GPU (NVIDIA 615.71.09), --cfg m2v_gpu:
- at development 7f76090454 the test fails as reported (left 0, right 1);
- with this change `runtime_lane::dma_buf_imports` passes 17 of 17. Printed: one run 64x16
  rows 256 bytes apart in place (in place 1, of them over a dma-buf 0, no refusal, the source
  uncalled), scattered runs 1024x1100 rows 4096 bytes apart in place likewise; the blits of
  the CPU's bytes and of its later bytes match for both textures, which never ran there before.
- clippy -p metal2vulkan-validation --all-targets --all-features -D warnings, plain and
  --cfg m2v_gpu, clean on msi (Linux, where dma_buf_imports compiles) and on the Mac.

One work packet, landed as 1 commit on archive/development-linear-2026-10-29: daf1bf625f.
2026-10-29 15:43:55 +02:00
..