Skip to content

[Embedder API] Support external textures for Vulkan #117937

Closed

Description

@anlumo

Use case

I want to use Flutter as the UI layer in a desktop application that relies heavily on graphics, similar to Adobe Illustrator.

Displaying my documents is planned to happen using Vulkan and Metal in order to allow more flexibility with GPU-based effects (think Photoshop filters). The code for this is native (written in Rust using wgpu). [Ideally, I'd like to use DX12 on Windows, but that's not an option with Flutter at all at the moment.]

In order to achieve this, I want to use the embedder API in Vulkan mode. I've written a proof-of-concept here, which already works.

However, in order to display the document view, I have to use Flutter's platform view API and integrate with that. This would work fine in theory, however this means that I have to render the view synchronously within the present_layers_callback callback. This is not really an option for me, because I want to use the rendering engine bevy (built on top of wgpu) that has its own render loop. Vulkan can support this use case as long as I'm rendering to different surfaces, but within present_layers_callback this is not the case. So, I'd have to either render the platform view to a texture or copy all of Flutter's layers into my own textures, so the renderer can composite them at its own pace.

I think that using Flutter as a UI layer for 3D content would also be interesting for games and other media applications (like Google Earth or a CAD tool for example). There are a few solutions for this (like Neosis GUI and Coherent Gameface), but nothing that comes close to Flutter's feature set and performance combination.

Proposal

For OpenGL and Metal, the Flutter embedder supports external textures. However, this is not implemented for Vulkan. With this support, I could skip a lot of the overhead described above, making the code much simpler and also faster (because Flutter could directly render the texture using the Texture widget and wouldn't have to flatten its own rendering into multiple textures).

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    engineflutter/engine related. See also e: labels.
    a: platform-viewsEmbedding Android/iOS views in Flutter apps
    P3Issues that are less important to the Flutter project
    on Jan 4, 2023
  2. eladmaimoni commented on Jan 15, 2023

    @eladmaimoni
  3. anlumo commented on Jan 16, 2023

    @anlumo
    Author
  4. eladmaimoni commented on Jan 16, 2023

    @eladmaimoni
  5. MindStudioOfficial commented on Mar 19, 2024

    @MindStudioOfficial

    Hi, I am also facing a similar problem with my application.

    My goal is to render something using Vulkan and display it as part of my Flutter UI using a Texture Widget.
    Seeing this issue gave me hope that there might be a way to do that.

    @anlumo while I don't see any progress here, were you able to achieve your goal with some workaround?

  6. jwinarske commented on Mar 19, 2024

    @jwinarske
    Contributor

    @anlumo I'm starting the implementation on this in a week or so:
    #144613

  7. anlumo commented on Mar 20, 2024

    @anlumo
    Author

    @anlumo while I don't see any progress here, were you able to achieve your goal with some workaround?

    While I haven't started with the project where I'm going to need this yet, but my planned workaround is to use PlatformViews instead, as mentioned in the description.

  8. 1 remaining item

  9. jwinarske commented on Mar 20, 2024

    @jwinarske
    Contributor

    @MindStudioOfficial

    #144613

    Which platforms will this apply to?

    Anything that uses the Vulkan embedder API would be able to use it. Platform agnostic.

  10. nrbnlulu commented on Dec 11, 2025

    @nrbnlulu

    isn't it supported by the android embedder for impeller?

    class ImageExternalTextureVKImpeller : public ImageExternalTexture {

  11. anlumo commented on Dec 11, 2025

    @anlumo
    Author

    This ticket is about the C-based Embedder API.

  12. loic-sharma commented on Apr 21, 2026

    @loic-sharma
    Member

    Samsung's Flutter Tizen has forked the engine and added support for Vulkan external textures through the embedder API. This might be useful prior art:

  13. xiaowei-guan commented on Apr 22, 2026

    @xiaowei-guan
    Contributor

    Yes, flutter-tizen has supported render external texture for vulkan. I can create a PR for this part.

  14. changed the title [-]External Texture Support for Vulkan[/-] [+][Embedder API] Support external textures for Vulkan[/+] on May 29, 2026
  15. andywolff commented on Oct 7, 2026

    @andywolff
    Contributor

    #188855 has merged. Please open a new issue if there's something not covered by that PR

  16. github-actions commented on Oct 21, 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.

  17. locked as resolved and limited conversation to collaborators on Oct 21, 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 capabilitye: 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