pub struct VulkanExternalImage {
pub size: PhysicalSize<u32>,
pub format: TextureFormat,
pub generation: u64,
pub producer_sync: SyncMechanism,
pub dmabuf_fd: i32,
pub dmabuf_offset: u64,
pub dmabuf_stride: u64,
pub drm_modifier: u64,
pub wait_semaphore_fd: Option<i32>,
}Expand description
A frame backed by a Linux DMABUF imported via Vulkan
VK_KHR_external_memory_fd + VK_EXT_image_drm_format_modifier.
The producer (e.g. WPE) hands the consumer a DMABUF fd, DRM format
modifier, and per-plane offset/stride; the importer wraps it as a
wgpu::Texture on the host’s wgpu Vulkan device. Single-plane RGBA is
the common case; multi-plane formats are not yet supported.
The dmabuf_fd and wait_semaphore_fd are consumed by the importer
— Vulkan’s vkImportMemoryFdKHR and vkImportSemaphoreFdKHR take
ownership of the descriptors and the driver closes them. The producer
must not close its copy after handoff.
Fields§
§size: PhysicalSize<u32>§format: TextureFormat§generation: u64§producer_sync: SyncMechanism§dmabuf_fd: i32DMABUF file descriptor of the producer’s allocated image. Linux only.
dmabuf_offset: u64Offset in bytes into the dmabuf where the image data starts. 0 for
most allocators.
dmabuf_stride: u64Row stride in bytes. The producer’s allocator reports this (often
width * bytes_per_pixel rounded up to alignment).
drm_modifier: u64DRM format modifier reported by the producer. 0
(DRM_FORMAT_MOD_LINEAR) for linear-tiled buffers.
wait_semaphore_fd: Option<i32>Optional fd to a VkSemaphore payload (OPAQUE_FD) the producer
signals after rendering. Pair with
VulkanSemaphoreSynchronizer
to gate consumer submits on the signal.
Trait Implementations§
Source§impl Clone for VulkanExternalImage
impl Clone for VulkanExternalImage
impl Copy for VulkanExternalImage
Auto Trait Implementations§
impl Freeze for VulkanExternalImage
impl RefUnwindSafe for VulkanExternalImage
impl Send for VulkanExternalImage
impl Sync for VulkanExternalImage
impl Unpin for VulkanExternalImage
impl UnsafeUnpin for VulkanExternalImage
impl UnwindSafe for VulkanExternalImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more