Skip to content

[Impeller] Compute dispatch contract cleanup: literal workgroup sizes, device limits, persistent bindings #193868

Closed

Description

@bdero

Part of #188474.

#188601 moved compute dispatch to 3D workgroup counts, but several backend differences remain in the dispatch contract that the Flutter GPU compute API will expose.

Changes

  • Remove the Vulkan specialization constant that overrides constant_id = 0 with maxComputeWorkGroupSize[0] on every compute pipeline. It silently clobbers any user constant with that id. Convert prefix_sum_test.comp to a literal local_size.
  • Validate the workgroup size against device limits when a compute pipeline is created, on Metal (the pipeline's maxTotalThreadsPerThreadgroup and the device's per-dimension maximum) and on Vulkan (maxComputeWorkGroupSize and maxComputeWorkGroupInvocations), and fail with a clear error.
  • Expose the limits on Capabilities: max workgroup invocations, max workgroup size, max workgroup count, max shared memory and the minimum storage-buffer offset alignment.
  • A dispatch with a zero count is a no-op on every backend instead of an error.
  • Bindings persist across dispatches within a pass on every backend. Vulkan currently resets the pipeline and bindings after each dispatch.
  • Fix the Metal compute pass pushing a debug group whose pop only happens in debug builds.

Testing

compute_unittests on Metal and Vulkan: a literal-size prefix sum, an oversized workgroup rejected at pipeline creation, a zero-count dispatch, and two dispatches sharing one set of bindings.

Dependencies

None.

Activity

  1. self-assigned this
    on Oct 5, 2026
  2. added
    c: new featureNothing broken; request for a new capability
    engineflutter/engine related. See also e: labels.
    e: impellerImpeller rendering backend issues and features requests
    on Oct 5, 2026
  3. added 2 commits that reference this issue on Oct 11, 2026
    98c2f80
    c1a6be3
  4. moved this from 🤔 Needs Triage to 💡 Features in Flutter GPUon Oct 19, 2026
  5. added a commit that references this issue on Oct 25, 2026
    18b6c49
  6. moved this from 💡 Features to ✅ Done in Flutter GPUon Oct 26, 2026
  7. added a commit that references this issue on Oct 26, 2026
    a3a21c8
  8. added a commit that references this issue on Oct 29, 2026
    3e73917
  9. github-actions commented on Nov 9, 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.

  10. locked as resolved and limited conversation to collaborators on Nov 9, 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 capabilitye: impellerImpeller rendering backend issues and features requestsengineflutter/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