Skip to content

[Impeller] Support configurable Vulkan image layout handoff for embedder backing stores #194238

Open

Description

@andywolff

In #193003, Impeller returns Vulkan backing stores in VK_IMAGE_LAYOUT_GENERAL. Skia returned them in VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.

This difference means that switching from skia vulkan to impeller vulkan will break an embedder which previously used skia with backingstores expecting the layout Skia uses. The form of the breakage would be synchronization and validation failures (VUID-vkCmdPipelineBarrier-oldLayout-01181).
Also, VK_IMAGE_LAYOUT_GENERAL can disable hardware framebuffer compression on tile-based mobile GPUs.

The reason that PR uses VK_IMAGE_LAYOUT_GENERAL is because that PR uses a shortcut to create its render target for the backingstore. It calls SurfaceVK::WrapSwapchainImage with a dummy present callback. This leads to them being treated as onscreen swapchains, which uses VK_IMAGE_LAYOUT_GENERAL.

We should provide a contract for embedders to request a particular image layout.

I propose adding a presentation_layout field to FlutterVulkanBackingStore in embedder.h. We can keep the default on VK_IMAGE_LAYOUT_GENERAL.
We should also extract a dedicated helper for wrapping offscreen render targets to get rid of the SurfaceVK::WrapSwapchainImage shortcut.

Activity

  1. andywolff commented on Oct 12, 2026

    @andywolff
    ContributorAuthor

    A note regarding RFC 410 (flutter/rfc#24)

    Android expects VK_IMAGE_LAYOUT_GENERAL, so this issue is not blocking for the android embedder migration, but it may still be useful for other potential embedders

  2. added
    in triagePresently being triaged by the triage team
    e: impellerImpeller rendering backend issues and features requests
    engineflutter/engine related. See also e: labels.
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Oct 13, 2026
  3. added
    P2Important issues not at the top of the work list
    on Oct 19, 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

    P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Fluttere: impellerImpeller rendering backend issues and features requestsengineflutter/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