Skip to content

[Flutter GPU] Expose the maximum render target size on GpuContext #196642

Description

@spydon

Use case

An app using Flutter GPU that renders into large textures, such as an atlas, can't find out how large a render target the device supports. OpenGL ES only guarantees 2048, while most GPUs support 8192 or more, so today the app either hard-codes a conservative size or creates a texture and finds out by failing, which on some drivers isn't reported cleanly.

Impeller already knows this limit (Capabilities::GetMaximumRenderPassAttachmentSize()), but GpuContext doesn't expose it.

Proposal

Add GpuContext.maxRenderTargetWidth and GpuContext.maxRenderTargetHeight, reporting that capability:

  • Vulkan: maxFramebufferWidth and maxFramebufferHeight.
  • OpenGL ES: GL_MAX_TEXTURE_SIZE.
  • Metal: the feature set table's maximum texture size.
final context = gpu.gpuContext;
final size = min(desiredSize, min(context.maxRenderTargetWidth, context.maxRenderTargetHeight));

This needs to be in the engine, since a package can't query the backend's limits.

Activity

  1. added
    in triage
    engine
    team-fluttergpu
    on Nov 16, 2026
  2. moved this to 🤔 Needs Triage in Flutter GPUon Nov 16, 2026
  3. added
    c: proposal
    fyi-engine
    and removed
    in triage
    on Nov 16, 2026
  4. puneetkukreja98 commented on Nov 16, 2026

    @puneetkukreja98
    Contributor

    @spydon Thanks for the proposal request, routing this to team-fluttergpu for further investigation.

  5. gaaclarke commented on Nov 16, 2026

    @gaaclarke
    Member

    This has come up a couple of times. It should be easy to implement. I've assigned myself and Andy so the engine team doesn't lose it. We can probably make it happen.

  6. spydon commented on Nov 16, 2026

    @spydon
    ContributorAuthor

    This has come up a couple of times. It should be easy to implement. I've assigned myself and Andy so the engine team doesn't lose it. We can probably make it happen.

    @gaaclarke there is an implementation ready in #196640

  7. moved this from 🤔 Needs Triage to 💡 Features in Flutter GPUon Nov 16, 2026
  8. removed
    fyi-engine
    on Nov 16, 2026
  9. moved this from 💡 Features to ✅ Done in Flutter GPUon Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

c: proposalengineflutter-gputeam-fluttergpu

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions