An image over a dma-buf block names a type the block is exported as, with no image-side compatibility test

On the 780M (m3-max-10304 at 07d9fcac79) the image naming an opaque
file descriptor over a block exported as DMA_BUF | OPAQUE_FD was
refused only by the image-side compatibility test this branch added:
RADV's format query lists compatibleHandleTypes 0x1 (the opaque type
alone) for its opaque linear images. That test was stricter than
Vulkan:

- VUID-VkExportMemoryAllocateInfo-handleTypes-09860: the export set's
  bits must be compatible "as reported by ...
  VkExternalImageFormatProperties, or VkExternalBufferProperties"; the
  buffer query answers them so (FdExport::new).
- VUID-VkImageCreateInfo-pNext-00990: an image's handleTypes lie in its
  own compatibleHandleTypes; the image names one type.
- VUID-vkBindImageMemory-memory-02728: the memory's export set includes
  one of the image's types.

So the test goes (LinearRefusal::Incompatible and
ModifierMemory::shared_with with it). What stays, per handle type the
image names: the format query reports it EXPORTABLE, not
DEDICATED_ONLY; the image made requires no dedicated allocation
(VkMemoryDedicatedRequirements); its memoryTypeBits take the block's
type and its alignment is met at the texels' offset (alias_unbound_in's
aliases check); and the in-place check measures that exact image, under
the layer, before a texture takes it. The VUIDs are cited where the
export set (FdExport::new) and the image's handle type (alias_unbound)
are decided. Docs follow: API.md's shadow rule, HOWTO section 7, the
in_place.rs module doc.

Verification: the 780M, the RX 550, lavapipe and the Iris Xe next, then
the 5080 through an entry.

(cherry picked from commit 239d8ff9bbd4477d784f4ccc815ebf8af53dcad0)
This commit is contained in:
Anees Iqbal committed 2026-11-08 18:30:28 -08:00
1 parent 8b76a00025
commit 0b1dd0fc36
7 files changed
+53 -91

No files matched your search

+8 -8
View File
@@ -1659,14 +1659,14 @@ bound.
over memory the runtime exports (`MemoryExport`, a runtime extension), where either image names
a handle type the memory is exportable as, as Vulkan requires, and so starts `UNDEFINED`: its
check of that exported memory has not passed for the texture's accesses (a pending one moving
the same way), the device's image format query takes none of those handle types for such an
image but in a dedicated allocation, or lists not every one the memory is exportable as among
those compatible with it, or the memory is the buffer's dedicated allocation, to which no image
may be bound (a block of dma-bufs is exportable as an opaque file descriptor too where the
device's buffer queries answer both together, each compatible with the other, and its image then
names the opaque handle type where the query takes no dma-buf for it, as RADV's does for linear
images, `WorkCounts::exported_dma_buf_images_named_opaque_fd`; the buffer's export stays a dma-buf
of the same memory);
the same way), the device takes none of those handle types for such an image but in a dedicated
allocation (its image format query says so, or the image made requires one), or the memory is
the buffer's dedicated allocation, to which no image may be bound (a block of dma-bufs is
exportable as an opaque file descriptor too where the device's buffer queries answer both
together, each compatible with the other, and its image then names the opaque handle type where
the device takes no dma-buf for it in a shared block, as RADV takes none for a linear image,
`WorkCounts::exported_dma_buf_images_named_opaque_fd`; the buffer's export stays a dma-buf of the
same memory);
for one that renders, whose rows each to its
pitch share no line with bytes past them, the check of renders that lets the rows' padding
change, as the declaration does, and no byte past the last row's pitch); past a bound in bytes of its rows to their