Skip to content

[Impeller] ☂️ Use hardware features to improve performance of advanced blends. #120223

@bdero

Description

@bdero

In order to perform advanced blends today, we:

  1. end the pass,
  2. store the resolve texture,
  3. perform the advanced blend via FilterContents, reading the the resolved texture as the backdrop,
  4. create a new pass,
  5. draw the previously resolved texture to the new pass,
  6. draw the blend result to the new pass.

We can avoid this Rube Goldberg machine by taking better advantage of hardware/API features:

  • For OpenGL, advanced blends can be performed using builtin pipeline blend modes. OpenGL extension: KHR_blend_equation_advanced
    image
  • For Vulkan, advanced blends can also be performed using builtin pipeline blend modes. Vulkan extension: VK_EXT_blend_operation_advanced
    image
    . This is obsoleted by the next item.
  • For Vulkan devices that don't support the advanced blend equation extension, we can read from the framebuffer by setting up passes. This is complicated because it requires subcaching VkPipelines with unique subpass variations.
  • For Metal on iOS, it's also possible to read from the framebuffer and perform the blend as part of the shader inline. I'm not sure this can be done with compiler magic in ImpellerC -- we'll probably need a special compilation path for these in the build system. Completed with: [Impeller] read from framebuffer for advanced blends on iOS. engine#39567

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestse: openglengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions