Skip to content

[Flutter GPU] shader bundle carries compute workgroup size and storage buffer bindings #188477

Closed

Description

@bdero

Part of #188474.

The Flutter GPU shader bundle records uniform structs and uniform textures, but not the storage buffers or workgroup size a compute shader needs. Flutter GPU needs the storage buffers to bind buffers from Dart and to build Vulkan descriptor set layouts, and the workgroup size to dispatch on Metal and to validate against device limits.

A bundle containing a compute shader already builds today, GL variants included: impellerc compiles compute shaders to 310 es and 430 (#179683). All five backend variants stay required.

Changes

  • Bump the bundle format to version 3 and append to BackendShader:
    • storage_buffers: name, ext_res_0, set, binding, access, size_in_bytes (the block with any trailing runtime-sized array counted as empty) and runtime_array_stride.
    • workgroup_size, present for compute shaders only.
  • Record access as the shader declares it (kReadWrite, kReadOnly, kWriteOnly), so storage images can reuse the enum without deciding how write-only is exposed.
  • impellerc reflects storage buffers for every stage and the workgroup size for compute shaders. A bundled compute shader that sizes its workgroup with local_size_*_id fails with an error naming the shader.
  • lib/gpu loads both into Shader, registers storage-buffer descriptor set layouts, skips storage buffers the compiler optimized out, and leaves out a compute shader without a workgroup size.
  • No Dart API changes. Those land with [Flutter GPU] Storage buffer bindings #188479 and [Flutter GPU] ComputePipeline and ComputePass with dispatch #188480.

This issue covers only the Flutter GPU shader bundle. It does not touch the runtime stage format, which backs the FragmentProgram raster API.

Testing

  • Bundle a compute fixture and check, on every backend variant, the workgroup size, each storage buffer's binding, access, size and stride, and the 310 es / 430 GL versions.
  • Round-trip the packed bundle through verification and the table API.
  • Reject a shader that uses local_size_x_id.
  • Load a compute bundle in lib/gpu and check the storage buffers, workgroup size and descriptor set layouts.

Dependencies

None. The format bump is coordinated with the push constants change in #190406 so each change gets its own version.

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. changed the title [-][Impeller] Flutter GPU shader bundle carries compute workgroup size and storage buffer bindings[/-] [+][Flutter GPU] shader bundle carries compute workgroup size and storage buffer bindings[/+] on Jun 24, 2026
  4. moved this from 🤔 Needs Triage to 💡 Features in Flutter GPUon Jun 24, 2026
  5. self-assigned this
    on Oct 5, 2026
  6. added 3 commits that reference this issue on Oct 5, 2026
    a344fee
    9a407c7
    0ddff2c
  7. added a commit that references this issue on Oct 25, 2026
    30ed61a
  8. moved this from 💡 Features to ✅ Done in Flutter GPUon Oct 26, 2026
  9. added a commit that references this issue on Oct 26, 2026
    a3a21c8
  10. added a commit that references this issue on Oct 29, 2026
    3e73917
  11. 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.

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