Skip to content

[Flutter GPU] Expose compressed texture formats and a format capability query #187073

Closed

Description

@bdero

Depends on #148443.

Use case

Flutter GPU's PixelFormat exposes no compressed texture formats, and there is no API to query whether a format is supported on the current backend. 3D content needs compressed textures to keep GPU memory and bandwidth reasonable, and the supported formats vary by device, so a capability query is required.

glTF assets ship compressed textures through the KHR_texture_basisu extension, which stores KTX2 containers with Basis Universal supercompression (ETC1S or UASTC). At load time these transcode to a device-appropriate hardware format: UASTC to BC7 or ASTC, ETC1S to BC1/BC3 or ETC2. Flutter Scene needs Flutter GPU to expose those target formats and a query so the transcoder can pick the right one.

Proposal

Once Impeller lands compressed support (#148443), extend the Flutter GPU surface to match.

  1. Add the same three compressed families to the PixelFormat enum: BC (BC1 to BC7), ETC2 and EAC, and ASTC LDR. Skip PVRTC, ETC1, and HDR variants initially, matching the Impeller issue.
  2. Add a capability query to GpuContext.
  3. Treat compressed textures as upload-only and sample-only. createTexture validates usage and block-aligned dimensions, and Texture.overwrite accepts compressed block data.
  4. Keep KTX2 and Basis transcoding a layer above Flutter GPU, in Flutter Scene or a companion package. Flutter GPU exposes only the hardware formats and the query. The transcoder uses the query to choose a family.

Capability query API

enum TextureCompressionType { bc, etc2, astc }

class GpuContext {
  // ...existing members...

  /// Whether the backend supports a whole compressed family.
  bool supportsTextureCompression(TextureCompressionType type);

  /// Whether [format] can be used with the given usage on this backend.
  bool supportsTextureFormat(
    PixelFormat format, {
    bool renderTarget = false,
    bool shaderRead = true,
  });
}

This mirrors the Impeller capability API.

Formats supported almost universally at landing

No single compressed format is universal, which is why the query exists. The three families together cover essentially every target:

  • ETC2 and EAC: mobile, OpenGL ES 3.0, WebGL2.
  • BC (BC1 to BC7): desktop.
  • ASTC LDR: modern mobile.

These are exactly the transcode targets for Basis Universal, so they cover KHR_texture_basisu glTF textures. One asset runs on every backend through the query plus Basis transcoding, with uncompressed RGBA as a fallback.

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    engineflutter/engine related. See also e: labels.
    on May 26, 2026
  2. moved this to 🤔 Needs Triage in Flutter GPUon May 26, 2026
  3. jtmcdole commented on May 26, 2026

    @jtmcdole
    Member

    #148443 is P3 at the moment. I've mentioned it would be a nice to have for any app developers. Do you need this in the near future?

  4. bdero commented on May 26, 2026

    @bdero
    MemberAuthor

    Yeah I have a user that's asking for it and am working on landing the initial support for Impeller here: #187077
    This is something we've been talking about landing in Impeller for years but never quite got around to. Happy to just unlock it for everyone.

  5. bdero commented on Jun 19, 2026

    @bdero
    MemberAuthor

    This has been done for a few weeks.

  6. moved this from 🤔 Needs Triage to ✅ Done in Flutter GPUon Jun 19, 2026
  7. self-assigned this
    on Jun 19, 2026
  8. github-actions commented on Jul 14, 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 Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.flutter-gputeam-fluttergpuOwned by Flutter GPU team

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions