Skip to content

[Flutter GPU] ComputePipeline and ComputePass with dispatch #188480

Closed

Description

@bdero

Part of #188474.

The public compute surface.

Changes

  • ComputePipeline built from a single compute Shader.
  • CommandBuffer.createComputePass returning a ComputePass with bindStorageBuffer, bindUniform and bindTexture, plus dispatch(x, y, z) in workgroup counts. The workgroup size comes from the shader.
  • A zero count is a no-op, matching a draw with zero vertices.
  • Bindings persist across dispatches within a pass on every backend. Vulkan currently resets them after each dispatch.
  • A compute pass follows the pass lifecycle in the [Flutter GPU] ☂️ Compute shaders #188474 contract: creating the next pass, recording a copy or readback, or submitting ends it, end() ends it explicitly, and any later use throws a StateError. That lifecycle lands as its own change first.
  • Lands behind the supportsCompute gate tracked on [Flutter GPU] ☂️ Compute shaders #188474, so the API is never reachable where the contract is not implemented.

Testing

Dart tests in gpu_test.dart, on Metal and Vulkan:

  • A kernel writes a buffer that a render pass then draws from, checked through Texture.asImage().toByteData().
  • A compute pass and a render pass recorded on the same command buffer execute in creation order, and using the compute pass after the render pass was created throws a StateError.
  • Tests skip where supportsCompute is false.

Dependencies

#188477, #188479, and the pass lifecycle and supportsCompute items on #188474.

Activity

  1. 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 Jun 24, 2026
  2. moved this to 🤔 Needs Triage in Flutter GPUon Jun 24, 2026
  3. moved this from 🤔 Needs Triage to 💡 Features in Flutter GPUon Jun 24, 2026
  4. self-assigned this
    on Oct 5, 2026
  5. added 2 commits that reference this issue on Oct 11, 2026
    9323d18
    8b2fe3d
  6. added a commit that references this issue on Oct 25, 2026
    ce3f774
  7. moved this from 💡 Features to ✅ Done in Flutter GPUon Oct 26, 2026
  8. added a commit that references this issue on Oct 26, 2026
    a3a21c8
  9. added a commit that references this issue on Oct 29, 2026
    3e73917
  10. 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.

  11. 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