Skip to content

Vulkan multi-planar DMA-buf import support - #10629

Open
andyleiserson wants to merge 4 commits into
gfx-rs:trunkfrom
andyleiserson:jj-push-lsys
Open

andyleiserson wants to merge 4 commits into
gfx-rs:trunkfrom
andyleiserson:jj-push-lsys

Conversation

@andyleiserson

Copy link
Copy Markdown
Contributor

Adds support for importing multi-planar DMA-bufs to the Vulkan HAL.

The primary motivation is supporting external textures in Firefox; it also fixes #9801.

It supports importing planes spread across multiple DMA-bufs (up to 4, imported with VK_IMAGE_CREATE_DISJOINT_BIT), but this part is not tested, because my setup doesn't support it.

More description to come later.

Testing

TBD. I have some LLM-generated tests on a local branch (not present in this PR).

Squash or Rebase?

Rebase

LLM Use?

Yes, LLM was used for code generation and refactoring. I have reviewed and polished all the code.

Checklist

  • I self-reviewed and fully understand this PR.
  • CHANGELOG.md entries for the user-facing effects of this change are present.
  • The PR is minimal, and doesn't make sense to land as multiple PRs.
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.
  • (If applicable) WebGPU implementations built with wgpu may be affected behaviorally.
  • (If applicable) Validation and feature gates are in place to confine behavioral changes.
  • (If applicable) Tests demonstrate the validation and altered logic works.

Extract `import_dmabuf_fd`, which imports a DMA-buf as device memory with an
optional dedicated image, and fold `create_image_without_memory_with_tiling`
into `create_image_without_memory` and `create_vk_image`.

Change `import_dmabuf_fd` and `import_dmabuf_memory` to take an owned
file descriptor. It does not matter that much here, but it simplifies
the (future) multi-plane version to take an owned FD, so change these to
be consistent with that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

vulkan: texture_from_dmabuf_fd cannot import multi-planar (NV12) dma-bufs

1 participant