Repository navigation
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecte: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.flutter-gpufound in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30Found to occur in 3.30has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
I'm experiencing an issue with passing a uniform value to my shader in a Flutter application using the flutter_gpu package. Despite setting the intended value in the Dart code, the vertex shader always receives a default matrix of mat4(0.0). A minimal reproducible repository is available here: https://github.com/vulpeep/gpu_image_example.
Steps to Reproduce
-
CustomPainter setup:
- In image_painter.dart, a transform matrix is created and written to a uniform buffer.
- The shader is expected to use this matrix to compute texture coordinates.
-
Vertex Shader Code:
#version 460 in vec2 inPosition; out vec2 fragTexCoord; uniform Transform { mat4 transform; }; void main() { gl_Position = vec4(inPosition * 2.0 - 1.0, 0.0, 1.0); fragTexCoord = (transform * vec4(vec2(inPosition.x, 1.0 - inPosition.y), 0.0, 1.0)).xy; }
-
Fragment Shader Code:
#version 460 in vec2 fragTexCoord; out vec4 FragColor; uniform sampler2D uTexture; void main() { FragColor = texture(uTexture, fragTexCoord); }
-
Execution:
- The Flutter app loads a texture (as shown in utils.dart and image_widget.dart) and renders it via a custom paint widget.
- Although the uniform is bound with the intended matrix, the output behaves as if no uniform was passed, resulting in incorrect texture mapping.
Behavior
- Expected: The value set in the Dart code should affect the vertex shader, producing correct texture coordinates and a properly rendered image.
- Actual: The shader always defaults to
mat4(0.0), ignoring the provided uniform value and leading to unexpected render output.
Additional Details
- Flutter version: I'm currently working with Flutter version 3.27.4. Due to an existing Flutter issue Impeller GPU calls fail to render on Windows (GLES) #160948, I am unable to test this problem on later versions.
- Platform specific behavior: Testing on macOS did not reveal this problem - the uniform is passed correctly on macOS for both Flutter version 3.27.4 and on the master branch.
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecte: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.flutter-gpufound in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30Found to occur in 3.30has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-windowsBuilding on or for Windows specificallyBuilding on or for Windows specificallyteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Type
Projects
- StatusShow more project fields🤔 Needs Triage


Activity
danagbemava-nc commentedon Mar 3, 2025
Reproducible using the code sample in the repo shared above. On stable 3.27.4, it renders a red screen, but on stable 3.29.0 and master, it just shows a black screen.
flutter doctor -v
[Impeller] Carry vec_size & columns in shader bundle uniform metadata
[Impeller] Carry vec_size & columns in shader bundle uniform metadata
[Flutter GPU] Carry vec_size & columns in shader bundle uniform metad…
lijialin9 commentedon Jun 22, 2026
On Windows, launching with --enable-impeller causes CustomPainterto render nothing at all (works fine without Impeller), including basic drawColor and GPU-based rendering. My Flutter version is as follows:
Flutter 3.45.0-1.0.pre-595 • channel main
Framework • revision 8c3e681 (19 hours ago) • 2026-06-21 15:53:38 -0400
Engine • hash e638968b39f342d68f7c1e83b50807f069ab9fc2 (revision 8c3e681) (19 hours ago) • 2026-06-21 19:53:38.000Z
Tools • Dart 3.13.0 (build 3.13.0-228.0.dev) • DevTools 2.59.0