Skip to main content

import

Function import 

pub fn import(
    device: &Device,
    image: &DmabufRef<'_>,
) -> Result<ImportedPlanes, ImportError>
Expand description

Import image as sampleable wgpu textures, aliasing its GPU memory.

The returned textures own their VkImage + imported VkDeviceMemory (and the duplicated fds) and release them when dropped. Releasing them is what returns the buffer to the producer’s pool, so do not hold them longer than the GPU needs them.

§Errors

Returns ImportError when the buffer’s format, modifier, or plane layout is unsupported, the device is not backed by Vulkan, or Vulkan cannot import one of the planes.