Skip to content

[Impeller]Support GL_TEXTURE_EXTERNAL_OES in Embedder Texture #183817

Closed

Description

@xiaowei-guan

Use case

Currently, the Impeller texture mapping in embedder_external_texture_gl.cc does not explicitly set the TextureType in the TextureDescriptor. This limits the embedder's ability to handle special texture types, most notably GL_TEXTURE_EXTERNAL_OES which is critical for efficient video and camera preview.
I propose introducing a mapping utility to translate OpenGL texture targets to Impeller texture types.

Proposal

Proposed Change

  1. Add a mapping helper:
    Introduce a utility function to handle the translation of GL enums to Impeller types:
constexpr std::optional<impeller::TextureType> ToImpellerTextureType(GLenum type) {
  switch (type) {
    case GL_TEXTURE_2D:
      return impeller::TextureType::kTexture2D;
    case GL_TEXTURE_CUBE_MAP:
      return impeller::TextureType::kTextureCube;
    case GL_TEXTURE_EXTERNAL_OES:
      // This ensures Impeller handles OES external textures correctly
      return impeller::TextureType::kTextureExternalOES;
    default:
      return std::nullopt;
  }
}
  1. Update the descriptor initialization:
    Update the logic in embedder_external_texture_gl.cc to use the provided texture target:
impeller::TextureDescriptor desc;
desc.size = impeller::ISize(texture->width, texture->height);
desc.format = impeller::PixelFormat::kR8G8B8A8UNormInt;

auto type = ToImpellerTextureType(texture->target);
if (!type.has_value()) {
  return false; 
}
desc.type = type.value();

Activity

  1. changed the title [-][Impeller]Support GL_TEXTURE_EXTERNAL_OES in Impeller Embedder[/-] [+][Impeller]Support GL_TEXTURE_EXTERNAL_OES in Embedder Texture[/+] on Mar 18, 2026
  2. 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.
    c: proposalA detailed proposal for a change to Flutter
    e: impellerImpeller rendering backend issues and features requests
    and removed
    in triagePresently being triaged by the triage team
    on Mar 19, 2026
  3. gaaclarke commented on Mar 23, 2026

    @gaaclarke
    Member

    Can you explain to us why the exiting external texture API isn't sufficient and can you give us some more concrete use-cases that you are attempting to create?

  4. added
    P2Important issues not at the top of the work list
    on Mar 23, 2026
  5. xiaowei-guan commented on Mar 27, 2026

    @xiaowei-guan
    ContributorAuthor

    After investigation, it was found that Windows and Linux do not support GL_TEXTURE_EXTERNAL_OES.

  6. github-actions commented on Apr 10, 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.

  7. locked as resolved and limited conversation to collaborators on Apr 10, 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: new featureNothing broken; request for a new capabilityc: 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