Skip to content

[embedder api] Vulkan External Resources #144613

Closed

Description

@jwinarske

Use case

Per discussion on Discord - Use case gaps in order to switch to external embedder Vulkan backend

Vulkan external VkImage Support

  1. GL interop. Same or different process. Source could be anything that inherently requires GL/GLES/EGL.
  2. GStreamer pipeline output. Pipeline creates Vulkan objects directly via vulkanupload pipeline stage. Same or different process. Example pipeline which exposes VkImage to CPU:
    https://gist.github.com/jwinarske/dda0f7154a0bf34c3e7b6606907ad0f7
  3. Present render target (VkImage) from (Unity, Filament, etc).
  4. libcamera - source format is determined by the Camera sensor, and has to be determined at runtime.

External processes would have an array of VkImages available to present.

Proposal

The proposal is to adopt the OpenGL external Texture pattern for Vulkan. This would allow re-use of the TextureWidget.

GL Texture API:

FlutterEngineRegisterExternalTexture
FlutterEngineUnregisterExternalTexture
FlutterEngineMarkExternalTextureFrameAvailable

TextureFrameCallback would need to be updated to include VkImageInfo which describes the backing VkImage. Skia GrVkImageInfo is used to construct a GrBackendTexture.

Activity

  1. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    engineflutter/engine related. See also e: labels.
    e: embedderUsers of the Embedder API
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Mar 6, 2024
  2. added
    P3Issues that are less important to the Flutter project
    on Mar 12, 2024
  3. jonahwilliams commented on Mar 12, 2024

    @jonahwilliams
    Contributor

    @jwinarske is this something you are intending to work on yourself that you would like guidance on, or is this a feature request for the engine team?

  4. perkele1989 commented on Apr 27, 2024

    @perkele1989

    This is something I'll likely need for day job in near future. Curious about progress on this, and if there's any way I could contribute.

  5. jonahwilliams commented on May 9, 2024

    @jonahwilliams
    Contributor

    The flutter engine/impeller teams have no plans to work on this in the near future. If someone contributed a working implementation (with tests) I think we could accept it?

  6. perkele1989 commented on May 9, 2024

    @perkele1989

    Thank you for responding. may look into it going forward. for now leaning to do a CPU roundtrip and see if its performant enough. Seems like most of the work/time investment would involve setting up a development environment. The actual codebase seems very ready for it already to accept external Vulkan VkImages/VkImageViews via something like VK_KHR_external_memory, the same way it can do so from Java.

  7. jwinarske commented on Sep 15, 2026

    @jwinarske
    ContributorAuthor

    Superseded. Splitting this into the pieces that are actually moving:

    Leaving the policy note here for anyone who finds this later: per @jonahwilliams above, the engine team has no plans to do this work but would take a contributed implementation with tests. #188855 is that route working.

    GL interop stays the embedder's job before hand-off; nothing in the engine blocks it.

  8. github-actions commented on Sep 30, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: goinge: embedderUsers of the Embedder APIengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions