[Flutter GPU] Allow customizing the vertex layout on a RenderPipeline#186310
Merged
auto-submit[bot] merged 6 commits intoMay 12, 2026
Conversation
This was referenced May 10, 2026
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces custom vertex layout support in the Flutter GPU API, enabling users to define vertex attributes and buffer bindings via a new VertexLayout class. The implementation includes support for multiple vertex buffer slots and C++ validation against shader reflection metadata. Review feedback recommends adding Dart-side range validation for buffer slots and restructuring C++ initialization to prevent prohibited Dart VM callbacks while holding active typed-data handles.
e977b70 to
80c254d
Compare
Adds the v1 surface tracked by flutter#145013: a `VertexLayout` value type that the caller can pass to `GpuContext.createRenderPipeline` to override the impellerc-generated default interleaved layout, plus a `slot:` parameter on `RenderPass.bindVertexBuffer` so multiple vertex buffers can be bound to a draw. ## Dart surface ```dart enum VertexFormat { float32, float32x2, float32x3, float32x4, uint32, uint32x2, uint32x3, uint32x4, sint32, sint32x2, sint32x3, sint32x4, } class VertexAttribute { int location; int bufferBinding; int offsetInBytes; VertexFormat format; } class VertexBufferLayout { int binding; int strideInBytes; } class VertexLayout { List<VertexBufferLayout> buffers; List<VertexAttribute> attributes; } GpuContext.createRenderPipeline(vertex, fragment, {VertexLayout? vertexLayout}); RenderPass.bindVertexBuffer(BufferView, int vertexCount, {int slot = 0}); ``` ## v1 scope - 12 four-byte-element vertex formats (float32, uint32, sint32 in 1, 2, 3, and 4 component widths). These are the formats Impeller's HAL can express today as a `(type, bit_width, vec_size, columns)` tuple. Normalized, half-float, packed, BGRA-swizzled, and 64-bit formats are deferred to follow-ups gated on HAL changes; adding new values is purely additive. - v1 requires `VertexLayout.buffers` to declare densely-packed bindings starting from 0 because Impeller's `RenderPass::SetVertexBuffer` rejects sparse vertex bindings. Sparse support will be added once the HAL grows a `firstBinding`-style entry point. - Vertex step mode (vertex vs instance) and instance step rate are absent from the surface; both can be added later as named parameters with defaults without breaking callers. ## Validation `createRenderPipeline` throws a Dart exception when: - A `VertexAttribute.format` doesn't match the bound vertex shader's declared scalar type class (float vs signed int vs unsigned int). Component-count mismatches are NOT errors, mirroring WebGPU, Vulkan, and Metal default-substitution rules ((0, 0, 0, 1)). - An attribute's offset + format size overruns the buffer layout's stride. - An attribute references a `bufferBinding` not declared in the layout. - An attribute's `location` doesn't match any vertex shader input. - A `binding` is outside `[0, buffer_layout_count)` or duplicated. ## C++ plumbing - `Shader::GetStageInputs()` exposes the impellerc-reflected attribute metadata so the pipeline initializer can validate user formats and copy the per-location fields (name, set, columns, relaxed_precision) we don't carry on the Dart side. - `RenderPipeline` stores its own `impeller::VertexDescriptor` (built from the user layout, or fetched from the shader's reflection when no layout is supplied) and binds it on `BindToPipelineDescriptor` instead of going through `Shader::CreateVertexDescriptor` unconditionally. - `RenderPass` upgrades `vertex_buffer` to a `std::array<BufferView, 16>` indexed by binding slot, tracks the highest bound slot, and forwards the whole array to `impeller::RenderPass::SetVertexBuffer(BufferView*, count)`. ## Tests Adds five `gpu_test.dart` tests covering an explicit-layout-matching-default render and four validation paths (wrong format, overrun stride, unknown buffer binding, unknown location). All pass on flutter_tester_opengles (SwANGLE) and flutter_tester (Metal) locally. Refs: flutter#145013, flutter#102778, flutter#116168.
80c254d to
f8f215b
Compare
…tion
`VertexAttribute.location` is replaced with `VertexAttribute.name`, mirroring
how uniform bindings are resolved (`Shader.getUniformSlot('VertInfo')`). The
C++ side looks the matching `ShaderStageIOSlot` up by name from the shader's
reflection metadata and copies the `(location, set, columns, relaxed_precision)`
fields into the descriptor it hands to Impeller.
Why this matters: when a shader is written without explicit
`layout(location = N)` qualifiers (which is true for every shader in this
repo), glslang assigns locations at the GLSL-to-SPIR-V step. The auto-
assignment is deterministic in practice and is what every Impeller-internal
codegen path relies on, but it is implementation-defined per the GLSL spec,
and it silently shifts whenever a shader author reorders the `in`
declarations. With a location-keyed Dart API, a shader edit that swaps two
attributes of the same scalar type class (e.g. two `vec2`s) would pass
validation and feed position data through the texcoord stream at runtime.
Name-keyed lookup eliminates that class of bug by construction.
FFI plumbing change: `RenderPipeline._initialize` now takes a third
`ByteData?` carrying the concatenated UTF-8 bytes of every attribute name,
walked in parallel with the attributes integer table using the new
per-attribute `nameByteLength` field. Names are ASCII GLSL identifiers, so
the Dart side encodes via `String.codeUnits` and the C++ side reads them
as a `std::string_view`; lookup against the shader's `const char*`
`ShaderStageIOSlot::name` uses `std::strcmp` (the IOSlot's name lifetime
is anchored to the shader bundle's flatbuffer or to a static string
literal, both of which outlive the pipeline build).
Tests updated to use `name: 'position'` instead of `location: 0`. The
`rejects VertexAttribute with unknown location` test is renamed to
`rejects VertexAttribute with unknown name` and uses
`name: 'nonexistent_attribute'`. All `BlitCommandGLES` and `gpu_test.dart`
tests pass on both `flutter_tester_opengles` (SwANGLE) and
`flutter_tester` (Metal) locally.
wolfenrain
previously approved these changes
May 11, 2026
Replaces the flat `VertexLayout { buffers, attributes }` shape with a
nested `VertexLayout { buffers: [VertexBuffer { strideInBytes,
attributes: [VertexAttribute] }] }` hierarchy. Two redundant fields are
deleted in favor of structural nesting:
* `VertexBufferLayout.binding`: implicit in the buffer's position within
`VertexLayout.buffers`.
* `VertexAttribute.bufferBinding`: implicit in which `VertexBuffer` owns
the attribute.
`VertexBufferLayout` is renamed to `VertexBuffer` to reflect that each
entry now also owns its attribute list.
`VertexAttribute.offsetInBytes` now defaults to 0 so structure-of-arrays
call sites don't need to spell it out for the common case of one
attribute per buffer.
Three validation paths become impossible by construction and are
deleted: unknown `bufferBinding`, non-dense binding indices, and
duplicate binding indices.
A new validation rule is added in their place: two attributes within the
same `VertexBuffer` must not occupy overlapping byte ranges. The error
message names both attributes and both ranges.
FFI row shapes shrink accordingly: `bufferLayouts` rows go from
`[binding, stride]` to `[strideInBytes, attributeCount]`, and
`attributes` rows go from `[bufferBinding, offset, formatIndex,
nameByteLength]` to `[offsetInBytes, formatIndex, nameByteLength]`. The
C++ side walks the nested structure by consuming each buffer's
`attributeCount` attribute rows in order.
The unknown-`bufferBinding` test case is removed (impossible to
express); an overlapping-attributes test case is added. Verified locally
on `flutter_tester_opengles` and `flutter_tester`: 42 passed, 1 skipped
on both backends.
wolfenrain
previously approved these changes
May 11, 2026
Analyzer in CI flagged the explicit `String` annotation on the local `msg` variable as redundant (the `e.toString()` return type is obvious). Removing the annotation clears the `omit_obvious_local_variable_types` lint.
CI on commit 278720e surfaced three classes of issue, none caught by the local build alone. Fix all three here. 1. **GN layering check**: `render_pipeline.cc` started including `absl/status/status.h`, `absl/status/statusor.h`, and `absl/strings/str_cat.h` but `//flutter/lib/gpu:gpu` had no deps on those absl targets. The local `et build` succeeded because it does not enforce header layering; CI's `gn gen --check` does. Add the three absl deps to `lib/gpu/BUILD.gn`. 2. **`public_member_api_docs` lints**: removing the `ignore_for_file: public_member_api_docs` pragma from `vertex_layout.dart` exposed three missing docstrings on the const constructors of `VertexAttribute`, `VertexBuffer`, and `VertexLayout`. Add a brief doc comment for each. 3. **`dart format`**: `gpu_test.dart` had unformatted multi-line test callsites from the prior commit. Reformat to match what `dart format` produces. Verified locally on both `flutter_tester` (Metal) and `flutter_tester_opengles` (SwANGLE): 43 passing + 1 skipped on both. `engine/src/flutter/ci/analyze.sh` reports clean.
This was referenced May 12, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
May 14, 2026
Roll Flutter from 707dbc0420a3 to 23f6f5853f50 (149 revisions) flutter/flutter@707dbc0...23f6f58 2026-05-12 737941+loic-sharma@users.noreply.github.com Add 'cp: review' label to the manual cherrypick process (flutter/flutter#186158) 2026-05-12 engine-flutter-autoroll@skia.org Roll Packages from 19ec8b8 to 93cbed6 (3 revisions) (flutter/flutter#186401) 2026-05-12 30870216+gaaclarke@users.noreply.github.com Removes SDF option for macOS (always enabled) (flutter/flutter#186265) 2026-05-12 nico.reiab@gmail.com docs: fix typos in flutter_tools comments (flutter/flutter#186321) 2026-05-12 15619084+vashworth@users.noreply.github.com Pass XcodeBasedProject instead of String to functions in XcodeProjectInterpreter (flutter/flutter#186378) 2026-05-12 jason-simmons@users.noreply.github.com Update iOS scenario app test goldens to match changes from flutter/flutter#182662 (flutter/flutter#186390) 2026-05-12 engine-flutter-autoroll@skia.org Roll Skia from ad0aff15b9fa to 77a21bc723dc (2 revisions) (flutter/flutter#186396) 2026-05-12 32538273+ValentinVignal@users.noreply.github.com Migrate focus_node.unfocus.0.dart to use `RadioGroup` (flutter/flutter#183979) 2026-05-12 engine-flutter-autoroll@skia.org Roll Skia from 91d3c1e730af to ad0aff15b9fa (7 revisions) (flutter/flutter#186391) 2026-05-12 bdero@google.com [Flutter GPU] Allow customizing the vertex layout on a RenderPipeline (flutter/flutter#186310) 2026-05-12 97480502+b-luk@users.noreply.github.com Fix `EmbedderTest.CanRenderTextWithImpellerMetal` test breakage (flutter/flutter#186262) 2026-05-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from rFhU-YPqdCRCtCz7b... to z7ICmPtn4hspu02zk... (flutter/flutter#186384) 2026-05-12 bdero@google.com [Impeller] GLES: lazily allocate texture mip levels on first per-level write (flutter/flutter#186302) 2026-05-12 bdero@google.com [Android] Propagate --enable-flutter-gpu Intent extra to engine args (flutter/flutter#186298) 2026-05-11 47866232+chunhtai@users.noreply.github.com [ci] update no-response workflow to also look for old label name in e… (flutter/flutter#186373) 2026-05-11 bdero@google.com [ImpellerC] Write a depfile when --shader-bundle is in use (flutter/flutter#186341) 2026-05-11 nico.reiab@gmail.com docs: fix doubled-word typos in comments (flutter/flutter#186320) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 32281401997e to 91d3c1e730af (4 revisions) (flutter/flutter#186368) 2026-05-11 15619084+vashworth@users.noreply.github.com Show SwiftPM warnings right before iOS/macOS build (flutter/flutter#185984) 2026-05-11 15619084+vashworth@users.noreply.github.com Convert rebuilding-flutter-tool script to dart (flutter/flutter#185089) 2026-05-11 15619084+vashworth@users.noreply.github.com Use Xcode's LLDB (flutter/flutter#186273) 2026-05-11 mr-peipei@web.de Remove `currentMainUri` from `generateMainDartWithPluginRegistrant` (flutter/flutter#185907) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 2514f6b5f92b to 32281401997e (1 revision) (flutter/flutter#186349) 2026-05-11 engine-flutter-autoroll@skia.org Roll Packages from 92552b1 to 19ec8b8 (4 revisions) (flutter/flutter#186350) 2026-05-11 1063596+reidbaker@users.noreply.github.com Check for absolute paths in skills. (flutter/flutter#185632) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 9fb7d2814642 to 2514f6b5f92b (1 revision) (flutter/flutter#186347) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 8cafb209e836 to 9fb7d2814642 (4 revisions) (flutter/flutter#186335) 2026-05-10 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from sOBiPJb0xznDBZlf5... to rFhU-YPqdCRCtCz7b... (flutter/flutter#186328) 2026-05-10 engine-flutter-autoroll@skia.org Roll Skia from 05a03f99c74e to 8cafb209e836 (1 revision) (flutter/flutter#186315) 2026-05-10 bdero@google.com [Impeller] Vulkan: don't drop user-supplied viewport X, Y, and depth range (flutter/flutter#185886) 2026-05-09 mbrase@google.com Update Fuchsia tests to subpackage their child components (flutter/flutter#186259) 2026-05-09 victorsanniay@gmail.com Fix SelectableText crash with inline lambda contextMenuBuilder (flutter/flutter#184990) 2026-05-09 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 5_TnhTsHSqtCx37o6... to sOBiPJb0xznDBZlf5... (flutter/flutter#186289) 2026-05-09 engine-flutter-autoroll@skia.org Roll Skia from dc78d4bd2efb to 05a03f99c74e (2 revisions) (flutter/flutter#186283) 2026-05-09 22373191+Hari-07@users.noreply.github.com Improve non rect platform view rendering (flutter/flutter#182662) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from 31521f8508c7 to dc78d4bd2efb (1 revision) (flutter/flutter#186278) 2026-05-08 30870216+gaaclarke@users.noreply.github.com Moves wide_gamut_macos to arm64 (flutter/flutter#186214) 2026-05-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[iOS] Migrate VSyncClient to a pure Obj-C implementation (#186166)" (flutter/flutter#186266) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from a00db8749edb to 31521f8508c7 (2 revisions) (flutter/flutter#186264) 2026-05-08 97480502+b-luk@users.noreply.github.com Optimize compatible `DrawDiffRoundRect` calls to use `DrawRoundRect` (flutter/flutter#186203) 2026-05-08 bdero@google.com [triage] Add Flutter GPU as a triage team (flutter/flutter#186263) 2026-05-08 dmgr@google.com doc: Unified Check-Run User manual (flutter/flutter#186210) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from 5f7adf4403d6 to a00db8749edb (1 revision) (flutter/flutter#186257) 2026-05-08 engine-flutter-autoroll@skia.org Roll Packages from 0411f1d to 92552b1 (1 revision) (flutter/flutter#186256) 2026-05-08 34871572+gmackall@users.noreply.github.com Add logging to figure out jvm crashes for `hot_mode_tests` (flutter/flutter#186107) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from 926c09741ce2 to 5f7adf4403d6 (3 revisions) (flutter/flutter#186242) ...
stuartmorgan-g
pushed a commit
to flutter/core-packages
that referenced
this pull request
Jun 9, 2026
Roll Flutter from 707dbc0420a3 to 23f6f5853f50 (149 revisions) flutter/flutter@707dbc0...23f6f58 2026-05-12 737941+loic-sharma@users.noreply.github.com Add 'cp: review' label to the manual cherrypick process (flutter/flutter#186158) 2026-05-12 engine-flutter-autoroll@skia.org Roll Packages from 19ec8b861676 to 93cbed65f336 (3 revisions) (flutter/flutter#186401) 2026-05-12 30870216+gaaclarke@users.noreply.github.com Removes SDF option for macOS (always enabled) (flutter/flutter#186265) 2026-05-12 nico.reiab@gmail.com docs: fix typos in flutter_tools comments (flutter/flutter#186321) 2026-05-12 15619084+vashworth@users.noreply.github.com Pass XcodeBasedProject instead of String to functions in XcodeProjectInterpreter (flutter/flutter#186378) 2026-05-12 jason-simmons@users.noreply.github.com Update iOS scenario app test goldens to match changes from flutter/flutter#182662 (flutter/flutter#186390) 2026-05-12 engine-flutter-autoroll@skia.org Roll Skia from ad0aff15b9fa to 77a21bc723dc (2 revisions) (flutter/flutter#186396) 2026-05-12 32538273+ValentinVignal@users.noreply.github.com Migrate focus_node.unfocus.0.dart to use `RadioGroup` (flutter/flutter#183979) 2026-05-12 engine-flutter-autoroll@skia.org Roll Skia from 91d3c1e730af to ad0aff15b9fa (7 revisions) (flutter/flutter#186391) 2026-05-12 bdero@google.com [Flutter GPU] Allow customizing the vertex layout on a RenderPipeline (flutter/flutter#186310) 2026-05-12 97480502+b-luk@users.noreply.github.com Fix `EmbedderTest.CanRenderTextWithImpellerMetal` test breakage (flutter/flutter#186262) 2026-05-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from rFhU-YPqdCRCtCz7b... to z7ICmPtn4hspu02zk... (flutter/flutter#186384) 2026-05-12 bdero@google.com [Impeller] GLES: lazily allocate texture mip levels on first per-level write (flutter/flutter#186302) 2026-05-12 bdero@google.com [Android] Propagate --enable-flutter-gpu Intent extra to engine args (flutter/flutter#186298) 2026-05-11 47866232+chunhtai@users.noreply.github.com [ci] update no-response workflow to also look for old label name in e… (flutter/flutter#186373) 2026-05-11 bdero@google.com [ImpellerC] Write a depfile when --shader-bundle is in use (flutter/flutter#186341) 2026-05-11 nico.reiab@gmail.com docs: fix doubled-word typos in comments (flutter/flutter#186320) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 32281401997e to 91d3c1e730af (4 revisions) (flutter/flutter#186368) 2026-05-11 15619084+vashworth@users.noreply.github.com Show SwiftPM warnings right before iOS/macOS build (flutter/flutter#185984) 2026-05-11 15619084+vashworth@users.noreply.github.com Convert rebuilding-flutter-tool script to dart (flutter/flutter#185089) 2026-05-11 15619084+vashworth@users.noreply.github.com Use Xcode's LLDB (flutter/flutter#186273) 2026-05-11 mr-peipei@web.de Remove `currentMainUri` from `generateMainDartWithPluginRegistrant` (flutter/flutter#185907) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 2514f6b5f92b to 32281401997e (1 revision) (flutter/flutter#186349) 2026-05-11 engine-flutter-autoroll@skia.org Roll Packages from 92552b16bcc1 to 19ec8b861676 (4 revisions) (flutter/flutter#186350) 2026-05-11 1063596+reidbaker@users.noreply.github.com Check for absolute paths in skills. (flutter/flutter#185632) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 9fb7d2814642 to 2514f6b5f92b (1 revision) (flutter/flutter#186347) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 8cafb209e836 to 9fb7d2814642 (4 revisions) (flutter/flutter#186335) 2026-05-10 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from sOBiPJb0xznDBZlf5... to rFhU-YPqdCRCtCz7b... (flutter/flutter#186328) 2026-05-10 engine-flutter-autoroll@skia.org Roll Skia from 05a03f99c74e to 8cafb209e836 (1 revision) (flutter/flutter#186315) 2026-05-10 bdero@google.com [Impeller] Vulkan: don't drop user-supplied viewport X, Y, and depth range (flutter/flutter#185886) 2026-05-09 mbrase@google.com Update Fuchsia tests to subpackage their child components (flutter/flutter#186259) 2026-05-09 victorsanniay@gmail.com Fix SelectableText crash with inline lambda contextMenuBuilder (flutter/flutter#184990) 2026-05-09 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 5_TnhTsHSqtCx37o6... to sOBiPJb0xznDBZlf5... (flutter/flutter#186289) 2026-05-09 engine-flutter-autoroll@skia.org Roll Skia from dc78d4bd2efb to 05a03f99c74e (2 revisions) (flutter/flutter#186283) 2026-05-09 22373191+Hari-07@users.noreply.github.com Improve non rect platform view rendering (flutter/flutter#182662) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from 31521f8508c7 to dc78d4bd2efb (1 revision) (flutter/flutter#186278) 2026-05-08 30870216+gaaclarke@users.noreply.github.com Moves wide_gamut_macos to arm64 (flutter/flutter#186214) 2026-05-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[iOS] Migrate VSyncClient to a pure Obj-C implementation (#186166)" (flutter/flutter#186266) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from a00db8749edb to 31521f8508c7 (2 revisions) (flutter/flutter#186264) 2026-05-08 97480502+b-luk@users.noreply.github.com Optimize compatible `DrawDiffRoundRect` calls to use `DrawRoundRect` (flutter/flutter#186203) 2026-05-08 bdero@google.com [triage] Add Flutter GPU as a triage team (flutter/flutter#186263) 2026-05-08 dmgr@google.com doc: Unified Check-Run User manual (flutter/flutter#186210) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from 5f7adf4403d6 to a00db8749edb (1 revision) (flutter/flutter#186257) 2026-05-08 engine-flutter-autoroll@skia.org Roll Packages from cfdd1d3 to 92552b16bcc1 (1 revision) (flutter/flutter#186256) 2026-05-08 34871572+gmackall@users.noreply.github.com Add logging to figure out jvm crashes for `hot_mode_tests` (flutter/flutter#186107) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from 926c09741ce2 to 5f7adf4403d6 (3 revisions) (flutter/flutter#186242) ...
creatorpiyush
pushed a commit
to creatorpiyush/packages
that referenced
this pull request
Jun 10, 2026
…er#11700) Roll Flutter from 707dbc0420a3 to 23f6f5853f50 (149 revisions) flutter/flutter@707dbc0...23f6f58 2026-05-12 737941+loic-sharma@users.noreply.github.com Add 'cp: review' label to the manual cherrypick process (flutter/flutter#186158) 2026-05-12 engine-flutter-autoroll@skia.org Roll Packages from 19ec8b8 to 93cbed6 (3 revisions) (flutter/flutter#186401) 2026-05-12 30870216+gaaclarke@users.noreply.github.com Removes SDF option for macOS (always enabled) (flutter/flutter#186265) 2026-05-12 nico.reiab@gmail.com docs: fix typos in flutter_tools comments (flutter/flutter#186321) 2026-05-12 15619084+vashworth@users.noreply.github.com Pass XcodeBasedProject instead of String to functions in XcodeProjectInterpreter (flutter/flutter#186378) 2026-05-12 jason-simmons@users.noreply.github.com Update iOS scenario app test goldens to match changes from flutter/flutter#182662 (flutter/flutter#186390) 2026-05-12 engine-flutter-autoroll@skia.org Roll Skia from ad0aff15b9fa to 77a21bc723dc (2 revisions) (flutter/flutter#186396) 2026-05-12 32538273+ValentinVignal@users.noreply.github.com Migrate focus_node.unfocus.0.dart to use `RadioGroup` (flutter/flutter#183979) 2026-05-12 engine-flutter-autoroll@skia.org Roll Skia from 91d3c1e730af to ad0aff15b9fa (7 revisions) (flutter/flutter#186391) 2026-05-12 bdero@google.com [Flutter GPU] Allow customizing the vertex layout on a RenderPipeline (flutter/flutter#186310) 2026-05-12 97480502+b-luk@users.noreply.github.com Fix `EmbedderTest.CanRenderTextWithImpellerMetal` test breakage (flutter/flutter#186262) 2026-05-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from rFhU-YPqdCRCtCz7b... to z7ICmPtn4hspu02zk... (flutter/flutter#186384) 2026-05-12 bdero@google.com [Impeller] GLES: lazily allocate texture mip levels on first per-level write (flutter/flutter#186302) 2026-05-12 bdero@google.com [Android] Propagate --enable-flutter-gpu Intent extra to engine args (flutter/flutter#186298) 2026-05-11 47866232+chunhtai@users.noreply.github.com [ci] update no-response workflow to also look for old label name in e… (flutter/flutter#186373) 2026-05-11 bdero@google.com [ImpellerC] Write a depfile when --shader-bundle is in use (flutter/flutter#186341) 2026-05-11 nico.reiab@gmail.com docs: fix doubled-word typos in comments (flutter/flutter#186320) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 32281401997e to 91d3c1e730af (4 revisions) (flutter/flutter#186368) 2026-05-11 15619084+vashworth@users.noreply.github.com Show SwiftPM warnings right before iOS/macOS build (flutter/flutter#185984) 2026-05-11 15619084+vashworth@users.noreply.github.com Convert rebuilding-flutter-tool script to dart (flutter/flutter#185089) 2026-05-11 15619084+vashworth@users.noreply.github.com Use Xcode's LLDB (flutter/flutter#186273) 2026-05-11 mr-peipei@web.de Remove `currentMainUri` from `generateMainDartWithPluginRegistrant` (flutter/flutter#185907) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 2514f6b5f92b to 32281401997e (1 revision) (flutter/flutter#186349) 2026-05-11 engine-flutter-autoroll@skia.org Roll Packages from 92552b1 to 19ec8b8 (4 revisions) (flutter/flutter#186350) 2026-05-11 1063596+reidbaker@users.noreply.github.com Check for absolute paths in skills. (flutter/flutter#185632) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 9fb7d2814642 to 2514f6b5f92b (1 revision) (flutter/flutter#186347) 2026-05-11 engine-flutter-autoroll@skia.org Roll Skia from 8cafb209e836 to 9fb7d2814642 (4 revisions) (flutter/flutter#186335) 2026-05-10 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from sOBiPJb0xznDBZlf5... to rFhU-YPqdCRCtCz7b... (flutter/flutter#186328) 2026-05-10 engine-flutter-autoroll@skia.org Roll Skia from 05a03f99c74e to 8cafb209e836 (1 revision) (flutter/flutter#186315) 2026-05-10 bdero@google.com [Impeller] Vulkan: don't drop user-supplied viewport X, Y, and depth range (flutter/flutter#185886) 2026-05-09 mbrase@google.com Update Fuchsia tests to subpackage their child components (flutter/flutter#186259) 2026-05-09 victorsanniay@gmail.com Fix SelectableText crash with inline lambda contextMenuBuilder (flutter/flutter#184990) 2026-05-09 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 5_TnhTsHSqtCx37o6... to sOBiPJb0xznDBZlf5... (flutter/flutter#186289) 2026-05-09 engine-flutter-autoroll@skia.org Roll Skia from dc78d4bd2efb to 05a03f99c74e (2 revisions) (flutter/flutter#186283) 2026-05-09 22373191+Hari-07@users.noreply.github.com Improve non rect platform view rendering (flutter/flutter#182662) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from 31521f8508c7 to dc78d4bd2efb (1 revision) (flutter/flutter#186278) 2026-05-08 30870216+gaaclarke@users.noreply.github.com Moves wide_gamut_macos to arm64 (flutter/flutter#186214) 2026-05-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[iOS] Migrate VSyncClient to a pure Obj-C implementation (#186166)" (flutter/flutter#186266) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from a00db8749edb to 31521f8508c7 (2 revisions) (flutter/flutter#186264) 2026-05-08 97480502+b-luk@users.noreply.github.com Optimize compatible `DrawDiffRoundRect` calls to use `DrawRoundRect` (flutter/flutter#186203) 2026-05-08 bdero@google.com [triage] Add Flutter GPU as a triage team (flutter/flutter#186263) 2026-05-08 dmgr@google.com doc: Unified Check-Run User manual (flutter/flutter#186210) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from 5f7adf4403d6 to a00db8749edb (1 revision) (flutter/flutter#186257) 2026-05-08 engine-flutter-autoroll@skia.org Roll Packages from 0411f1d to 92552b1 (1 revision) (flutter/flutter#186256) 2026-05-08 34871572+gmackall@users.noreply.github.com Add logging to figure out jvm crashes for `hot_mode_tests` (flutter/flutter#186107) 2026-05-08 engine-flutter-autoroll@skia.org Roll Skia from 926c09741ce2 to 5f7adf4403d6 (3 revisions) (flutter/flutter#186242) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an explicit
VertexLayoutvalue type that the caller can pass toGpuContext.createRenderPipelineto override the default interleaved layout declared by the bound vertex shader's shader bundle, plus aslot:parameter onRenderPass.bindVertexBufferso multiple vertex buffers can be bound to a single draw. This unblocks structure-of-arrays mesh loading (positions in one buffer, normals + UVs in another, etc.) and lets a renderer reorder attributes from the impellerc-generated default.The shipped scope intentionally pins only what's expressible against today's HAL without backing the API into a corner. The deferred capabilities (instancing, sparse bindings, normalized / packed / half-float / BGRA / 64-bit formats) are tracked at #186307, #186308, and #186309, with TODO comments at the relevant call sites pointing at each tracking issue.
Dart surface
If
vertexLayoutisnull, the default for the bound vertex shader is used (today's behavior). The newslot:parameter defaults to0, so all existing single-buffer call sites compile unchanged.Attributes nest under the
VertexBufferthey read from; each buffer's position inVertexLayout.buffersdetermines the binding slot it must be bound to viaRenderPass.bindVertexBuffer(the first buffer is slot 0, the second is slot 1, and so on).offsetInBytesdefaults to 0 so the common structure-of-arrays case (one attribute per buffer at the start of each element) doesn't need to spell it out.Attributes are keyed by the shader-side input
namerather than a raw integer location, mirroring how uniform bindings are resolved viaShader.getUniformSlot('VertInfo'). This keeps the Dart layout robust to shader edits that reorderindeclarations (the underlying location, which is what every backend ultimately consumes, is read from the shader's reflection at pipeline build time).Example: structure-of-arrays glTF mesh
Most glTF mesh primitives store each vertex attribute (POSITION, NORMAL, TEXCOORD_0, ...) in its own accessor, often inside its own buffer view. Without a configurable vertex layout, callers were forced to interleave those attributes on the CPU before upload. With this change, each attribute can keep its own buffer and bind at its own slot.
Given a vertex shader that declares three named inputs:
A renderer can describe the SoA layout once at pipeline creation and then bind one buffer per slot per draw:
Interleaved layouts work too: declare one
VertexBufferwhosestrideInBytescovers the whole vertex, list every attribute under it, and give each attribute past the first an explicitoffsetInBytesinto the element:This is also how a caller would override the impellerc-generated default to skip an unused attribute or reorder the components.
Validation
createRenderPipelinethrows a Dart exception when:VertexAttribute.formatdoesn't match the bound vertex shader's declared scalar type class (float vs signed int vs unsigned int). Component-count mismatches are NOT errors, mirroring the default-substitution rules every modern HAL uses ((0, 0, 0, 1) fill).offsetInBytes + format.bytesPerElementoverruns the owningVertexBuffer's stride.VertexBufferoccupy overlapping byte ranges (i.e.[offsetInBytes, offsetInBytes + format.bytesPerElement)ranges that intersect).namedoesn't match any vertex shader input declaration.RenderPass.bindVertexBufferthrowsRangeErrorifslotis outside[0, 16).C++ plumbing
Shader::GetStageInputs()exposes the impellerc-reflected attribute metadata so the pipeline initializer can resolve user attribute names to(location, set, columns, relaxed_precision)and validate user formats against the shader's declared scalar type.RenderPipelinestores its ownimpeller::VertexDescriptor, built from the user layout when supplied or fetched from the shader's reflection otherwise.RenderPassupgradesvertex_bufferto astd::array<BufferView, 16>indexed by binding slot, tracks the highest bound slot, and forwards the whole array toimpeller::RenderPass::SetVertexBuffer(BufferView*, count).The packed
(buffer layouts, attributes, attribute names)data is passed via FFI as threeByteDatahandles and copied out of the typed-data handles before any callback into the Dart VM (elseDart_TypedDataAcquireDatawould forbid the callback). With nested attributes,bufferLayoutsrows shrink to[strideInBytes, attributeCount]andattributesrows shrink to[offsetInBytes, formatIndex, nameByteLength]; binding slots are implicit in each buffer's position, and the C++ side walks attribute rows by consuming each buffer'sattributeCountin order. Attribute names are encoded as concatenated UTF-8 bytes walked in parallel with the attributes integer table using each entry'snameByteLength.Tests
Adds six
gpu_test.darttests covering an explicit-layout-matching-default render, a slot-range check, and fourcreateRenderPipelinevalidation paths (wrong format, overrun stride, overlapping attributes within a buffer, unknown attribute name). All pass onflutter_tester_opengles(SwANGLE) andflutter_tester(Metal) locally.Fixes #145013.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.