Repository navigation
Description
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) andruntime_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_*_idfails 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/430GL 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.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Done
Activity
[-][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[/+][Flutter GPU] Shader bundles carry compute workgroup size and storage…
[Flutter GPU] Shader bundles carry compute workgroup size and storage…
[Flutter GPU] Shader bundles carry compute workgroup size and storage…
[Flutter GPU] Shader bundles carry compute workgroup size and storage…
[Flutter GPU] Compute shaders on Metal and Vulkan (flutter#193805)
[Flutter GPU] Compute shaders on Metal and Vulkan (flutter#193805)
github-actions commentedon Nov 9, 2026
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 -vand a minimal reproduction of the issue.